/* * 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 of an employee */ export type EmployeeCustomField = { id: string; /** * This is the id of the response object from when you get the company custom fields */ companyCustomFieldId: string; name: string; /** * Input type for the custom field. */ type: CustomFieldType; description?: string | null | undefined; value: string; /** * An array of options for fields of type radio. Otherwise, null. */ selectionOptions?: Array | null | undefined; }; /** @internal */ export const EmployeeCustomField$inboundSchema: z.ZodType< EmployeeCustomField, z.ZodTypeDef, unknown > = z.object({ id: z.string(), company_custom_field_id: z.string(), name: z.string(), type: CustomFieldType$inboundSchema, description: z.nullable(z.string()).optional(), value: z.string(), selection_options: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "company_custom_field_id": "companyCustomFieldId", "selection_options": "selectionOptions", }); }); export function employeeCustomFieldFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeCustomField$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeCustomField' from JSON`, ); }