/* * 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"; /** * How Gusto will handle taxes already collected. */ export const ReconcileTaxMethod = { PayTaxes: "pay_taxes", RefundTaxes: "refund_taxes", } as const; /** * How Gusto will handle taxes already collected. */ export type ReconcileTaxMethod = ClosedEnum; export type TaxRefunds = { /** * Dollar amount. */ amount?: string | undefined; /** * What kind of tax this is. */ description?: string | undefined; }; /** * Record representing the suspension of a company's Gusto account. */ export type CompanySuspension = { /** * Unique identifier for this suspension. */ uuid?: string | undefined; /** * Unique identifier for the company which is suspended. */ companyUuid?: string | undefined; /** * Date that the suspension took effect. */ effectiveDate?: string | undefined; /** * Which competitor the company is joining instead. Only required if `reason` is `'switching_provider'`. */ leavingFor?: string | null | undefined; /** * Explanation for why the company's account was suspended. */ reason?: string | undefined; /** * How Gusto will handle taxes already collected. */ reconcileTaxMethod?: ReconcileTaxMethod | undefined; /** * Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. * * @remarks */ fileQuarterlyForms?: boolean | undefined; /** * Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. * * @remarks */ fileYearlyForms?: boolean | undefined; /** * User-supplied comments describing why they are suspending their account. */ comments?: string | null | undefined; /** * Describes the taxes which are refundable to the company for this suspension. These may be refunded or paid by Gusto depending on the value in `reconcile_tax_method`. * * @remarks */ taxRefunds?: Array | undefined; }; /** @internal */ export const ReconcileTaxMethod$inboundSchema: z.ZodNativeEnum< typeof ReconcileTaxMethod > = z.nativeEnum(ReconcileTaxMethod); /** @internal */ export const TaxRefunds$inboundSchema: z.ZodType< TaxRefunds, z.ZodTypeDef, unknown > = z.object({ amount: z.string().optional(), description: z.string().optional(), }); export function taxRefundsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxRefunds$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxRefunds' from JSON`, ); } /** @internal */ export const CompanySuspension$inboundSchema: z.ZodType< CompanySuspension, z.ZodTypeDef, unknown > = z.object({ uuid: z.string().optional(), company_uuid: z.string().optional(), effective_date: z.string().optional(), leaving_for: z.nullable(z.string()).optional(), reason: z.string().optional(), reconcile_tax_method: ReconcileTaxMethod$inboundSchema.optional(), file_quarterly_forms: z.boolean().optional(), file_yearly_forms: z.boolean().optional(), comments: z.nullable(z.string()).optional(), tax_refunds: z.array(z.lazy(() => TaxRefunds$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "company_uuid": "companyUuid", "effective_date": "effectiveDate", "leaving_for": "leavingFor", "reconcile_tax_method": "reconcileTaxMethod", "file_quarterly_forms": "fileQuarterlyForms", "file_yearly_forms": "fileYearlyForms", "tax_refunds": "taxRefunds", }); }); export function companySuspensionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CompanySuspension$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanySuspension' from JSON`, ); }