/* * 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 { ClosedEnum } from "../../types/enums.js"; export const CompanyBenefitCreateRequestCatchUpType = { Elective: "elective", Deemed: "deemed", } as const; export type CompanyBenefitCreateRequestCatchUpType = ClosedEnum< typeof CompanyBenefitCreateRequestCatchUpType >; export type CompanyBenefitCreateRequest = { /** * The ID of the benefit to which the company benefit belongs. */ benefitType?: number | undefined; /** * Whether this benefit is active for employee participation. */ active?: boolean | undefined; /** * The description of the company benefit.For example, a company may offer multiple benefits with an ID of 1 (for Medical Insurance). The description would show something more specific like "Kaiser Permanente" or "Blue Cross/ Blue Shield". */ description: string; /** * Whether the employer is subject to pay employer taxes when an employee is on leave. Only applicable to third party sick pay benefits. */ responsibleForEmployerTaxes?: boolean | undefined; /** * Whether the employer is subject to file W-2 forms for an employee on leave. Only applicable to third party sick pay benefits. */ responsibleForEmployeeW2?: boolean | undefined; /** * The type of catch-up contribution for this benefit, as required by Section 603 of the SECURE 2.0 Act. Only applicable to pre-tax 401(k) and 403(b) benefits. */ catchUpType?: CompanyBenefitCreateRequestCatchUpType | null | undefined; }; /** @internal */ export const CompanyBenefitCreateRequestCatchUpType$outboundSchema: z.ZodNativeEnum = z.nativeEnum( CompanyBenefitCreateRequestCatchUpType, ); /** @internal */ export type CompanyBenefitCreateRequest$Outbound = { benefit_type?: number | undefined; active: boolean; description: string; responsible_for_employer_taxes?: boolean | undefined; responsible_for_employee_w2?: boolean | undefined; catch_up_type?: string | null | undefined; }; /** @internal */ export const CompanyBenefitCreateRequest$outboundSchema: z.ZodType< CompanyBenefitCreateRequest$Outbound, z.ZodTypeDef, CompanyBenefitCreateRequest > = z.object({ benefitType: z.number().int().optional(), active: z.boolean().default(true), description: z.string(), responsibleForEmployerTaxes: z.boolean().optional(), responsibleForEmployeeW2: z.boolean().optional(), catchUpType: z.nullable(CompanyBenefitCreateRequestCatchUpType$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { benefitType: "benefit_type", responsibleForEmployerTaxes: "responsible_for_employer_taxes", responsibleForEmployeeW2: "responsible_for_employee_w2", catchUpType: "catch_up_type", }); }); export function companyBenefitCreateRequestToJSON( companyBenefitCreateRequest: CompanyBenefitCreateRequest, ): string { return JSON.stringify( CompanyBenefitCreateRequest$outboundSchema.parse( companyBenefitCreateRequest, ), ); }