/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CustomFieldType, CustomFieldType$inboundSchema, } from "./customfieldtype.js"; /** * A custom field on a company */ export type CompanyCustomField = { /** * UUID of the company custom field */ uuid: string; /** * Name of the company custom field */ name: string; /** * Input type for the custom field. */ type: CustomFieldType; /** * Description of the company custom field */ description?: string | null | undefined; /** * An array of options for fields of type radio. Otherwise, null. */ selectionOptions?: Array | null | undefined; }; /** @internal */ export const CompanyCustomField$inboundSchema: z.ZodType< CompanyCustomField, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), name: z.string(), type: CustomFieldType$inboundSchema, description: z.nullable(z.string()).optional(), selection_options: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "selection_options": "selectionOptions", }); }); export function companyCustomFieldFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CompanyCustomField$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyCustomField' from JSON`, ); }