/* * 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 TaxSuggestions = { /** * The ID of the tax. */ taxId?: number | undefined; /** * Calculated tax amount. */ amount?: string | undefined; }; /** * The representation of an external payroll with minimal information. */ export type ExternalPayrollTaxSuggestions = { /** * The UUID of the employee. */ employeeUuid?: string | undefined; /** * Possible tax liabilities selections. */ taxSuggestions?: Array | undefined; }; /** @internal */ export const TaxSuggestions$inboundSchema: z.ZodType< TaxSuggestions, z.ZodTypeDef, unknown > = z.object({ tax_id: z.number().int().optional(), amount: z.string().optional(), }).transform((v) => { return remap$(v, { "tax_id": "taxId", }); }); export function taxSuggestionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxSuggestions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxSuggestions' from JSON`, ); } /** @internal */ export const ExternalPayrollTaxSuggestions$inboundSchema: z.ZodType< ExternalPayrollTaxSuggestions, z.ZodTypeDef, unknown > = z.object({ employee_uuid: z.string().optional(), tax_suggestions: z.array(z.lazy(() => TaxSuggestions$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "employee_uuid": "employeeUuid", "tax_suggestions": "taxSuggestions", }); }); export function externalPayrollTaxSuggestionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExternalPayrollTaxSuggestions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExternalPayrollTaxSuggestions' from JSON`, ); }