/* * 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 SupportedBenefit = { /** * The benefit type in Gusto. */ benefitType?: number | undefined; /** * The name of the benefit. */ name?: string | undefined; /** * The description of the benefit. */ description?: string | undefined; /** * Whether the benefit is deducted before tax calculations, thus reducing one’s taxable income */ pretax?: boolean | undefined; /** * Whether the benefit is deducted after tax calculations. */ posttax?: boolean | undefined; /** * Whether the benefit is considered imputed income. */ imputed?: boolean | undefined; /** * Whether the benefit is healthcare related. */ healthcare?: boolean | undefined; /** * Whether the benefit is associated with retirement planning. */ retirement?: boolean | undefined; /** * Whether the benefit has a government mandated yearly limit. If the benefit has a government mandated yearly limit, employees cannot be added to more than one benefit of this type. */ yearlyLimit?: boolean | undefined; /** * Category where the benefit belongs to. */ category?: string | undefined; /** * Whether this benefit can be written (created, updated, or destroyed). Returns true if the benefit type is permitted for the application, false otherwise. */ writableByApplication?: boolean | undefined; }; /** @internal */ export const SupportedBenefit$inboundSchema: z.ZodType< SupportedBenefit, z.ZodTypeDef, unknown > = z.object({ benefit_type: z.number().int().optional(), name: z.string().optional(), description: z.string().optional(), pretax: z.boolean().optional(), posttax: z.boolean().optional(), imputed: z.boolean().optional(), healthcare: z.boolean().optional(), retirement: z.boolean().optional(), yearly_limit: z.boolean().optional(), category: z.string().optional(), writable_by_application: z.boolean().optional(), }).transform((v) => { return remap$(v, { "benefit_type": "benefitType", "yearly_limit": "yearlyLimit", "writable_by_application": "writableByApplication", }); }); export function supportedBenefitFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SupportedBenefit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportedBenefit' from JSON`, ); }