/* * 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"; export const IdentityVerificationStatus = { Pass: "Pass", Fail: "Fail", Skipped: "Skipped", } as const; export type IdentityVerificationStatus = ClosedEnum< typeof IdentityVerificationStatus >; export type HomeAddress = { street1?: string | undefined; street2?: string | undefined; city?: string | undefined; state?: string | undefined; zip?: string | undefined; country: string; }; /** * The representation of a company's signatory */ export type Signatory = { uuid: string; firstName?: string | null | undefined; lastName?: string | null | undefined; title?: string | null | undefined; phone?: string | null | undefined; email?: string | undefined; birthday?: string | null | undefined; /** * Whether or not the signatory is also the payroll admin of the company. */ isAdmin?: boolean | undefined; /** * Indicates whether the signatory has an SSN in Gusto. */ hasSsn?: boolean | undefined; /** * The current version of the signatory. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version?: string | undefined; /** * | | | * * @remarks * |---|---| * |__Status__| __Description__ | * | Pass | Signatory can sign all forms | * | Fail | Signatory cannot sign forms | * | Skipped | Signatory cannot sign Form 8655 until the form is manually uploaded as wet-signed | * | null | Identity verification process has not been completed | */ identityVerificationStatus?: IdentityVerificationStatus | null | undefined; homeAddress?: HomeAddress | null | undefined; }; /** @internal */ export const IdentityVerificationStatus$inboundSchema: z.ZodNativeEnum< typeof IdentityVerificationStatus > = z.nativeEnum(IdentityVerificationStatus); /** @internal */ export const HomeAddress$inboundSchema: z.ZodType< HomeAddress, z.ZodTypeDef, unknown > = z.object({ street_1: z.string().optional(), street_2: z.string().optional(), city: z.string().optional(), state: z.string().optional(), zip: z.string().optional(), country: z.string().default("USA"), }).transform((v) => { return remap$(v, { "street_1": "street1", "street_2": "street2", }); }); export function homeAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HomeAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HomeAddress' from JSON`, ); } /** @internal */ export const Signatory$inboundSchema: z.ZodType< Signatory, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), first_name: z.nullable(z.string()).optional(), last_name: z.nullable(z.string()).optional(), title: z.nullable(z.string()).optional(), phone: z.nullable(z.string()).optional(), email: z.string().optional(), birthday: z.nullable(z.string()).optional(), is_admin: z.boolean().optional(), has_ssn: z.boolean().optional(), version: z.string().optional(), identity_verification_status: z.nullable( IdentityVerificationStatus$inboundSchema, ).optional(), home_address: z.nullable(z.lazy(() => HomeAddress$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "is_admin": "isAdmin", "has_ssn": "hasSsn", "identity_verification_status": "identityVerificationStatus", "home_address": "homeAddress", }); }); export function signatoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Signatory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Signatory' from JSON`, ); }