/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The document option's section in the list of acceptable documents on the Form I-9 */ export const Section = { A: "A", A1: "A1", A2: "A2", A3: "A3", B: "B", C: "C", } as const; /** * The document option's section in the list of acceptable documents on the Form I-9 */ export type Section = ClosedEnum; /** * An employee's I-9 verification document option based on the authorization status */ export type I9AuthorizationDocumentOption = { /** * The document option's section in the list of acceptable documents on the Form I-9 */ section: Section; /** * The document option's description */ description: string; /** * The document option's document type */ documentType: string; /** * The document option's document titles */ documentTitle: Array; /** * Whether the document is a common choice for I-9 verification */ commonChoice: boolean; }; /** @internal */ export const Section$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Section); /** @internal */ export const I9AuthorizationDocumentOption$inboundSchema: z.ZodType< I9AuthorizationDocumentOption, z.ZodTypeDef, unknown > = z.object({ section: Section$inboundSchema, description: z.string(), document_type: z.string(), document_title: z.array(z.string()), common_choice: z.boolean(), }).transform((v) => { return remap$(v, { "document_type": "documentType", "document_title": "documentTitle", "common_choice": "commonChoice", }); }); export function i9AuthorizationDocumentOptionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => I9AuthorizationDocumentOption$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'I9AuthorizationDocumentOption' from JSON`, ); }