/* * 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"; export type PossibleLiabilities = { /** * Liability amount. */ liabilityAmount?: string | undefined; /** * The external payroll check date. */ payrollCheckDate?: string | null | undefined; /** * The UUID of the external payroll. */ externalPayrollUuid?: string | null | undefined; }; /** * The representation of tax liabilities selections. */ export type TaxLiabilitiesSelections = { /** * The ID of the tax. */ taxId?: number | undefined; /** * The name of the tax. */ taxName?: string | undefined; /** * A description of the tax, providing additional detail about the tax type. */ description?: string | null | undefined; /** * The UUID of last unpaid external payroll. */ lastUnpaidExternalPayrollUuid?: string | null | undefined; /** * Possible tax liabilities selections. */ possibleLiabilities?: Array | undefined; }; /** @internal */ export const PossibleLiabilities$inboundSchema: z.ZodType< PossibleLiabilities, z.ZodTypeDef, unknown > = z.object({ liability_amount: z.string().optional(), payroll_check_date: z.nullable(z.string()).optional(), external_payroll_uuid: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "liability_amount": "liabilityAmount", "payroll_check_date": "payrollCheckDate", "external_payroll_uuid": "externalPayrollUuid", }); }); export function possibleLiabilitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PossibleLiabilities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PossibleLiabilities' from JSON`, ); } /** @internal */ export const TaxLiabilitiesSelections$inboundSchema: z.ZodType< TaxLiabilitiesSelections, z.ZodTypeDef, unknown > = z.object({ tax_id: z.number().int().optional(), tax_name: z.string().optional(), description: z.nullable(z.string()).optional(), last_unpaid_external_payroll_uuid: z.nullable(z.string()).optional(), possible_liabilities: z.array(z.lazy(() => PossibleLiabilities$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "tax_id": "taxId", "tax_name": "taxName", "last_unpaid_external_payroll_uuid": "lastUnpaidExternalPayrollUuid", "possible_liabilities": "possibleLiabilities", }); }); export function taxLiabilitiesSelectionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxLiabilitiesSelections$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxLiabilitiesSelections' from JSON`, ); }