/* * 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 CompanyBenefitUpdateRequestCatchUpType = { Elective: "elective", Deemed: "deemed", } as const; export type CompanyBenefitUpdateRequestCatchUpType = ClosedEnum< typeof CompanyBenefitUpdateRequestCatchUpType >; export type CompanyBenefitUpdateRequest = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/versioning#object-layer) for information on how to use this field. */ version: string; /** * Whether this benefit is active for employee participation. Company benefits may only be deactivated if no employees are actively participating. */ 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 | undefined; /** * Whether the employer is subject to pay employer taxes when an employee is on leave. Only applicable to short-term and long-term disability benefits (different from voluntary disability). */ responsibleForEmployerTaxes?: boolean | undefined; /** * Whether the employer is subject to file W-2 forms for an employee on leave. Only applicable to short-term and long-term disability benefits (different from voluntary disability). */ 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?: CompanyBenefitUpdateRequestCatchUpType | null | undefined; }; /** @internal */ export const CompanyBenefitUpdateRequestCatchUpType$outboundSchema: z.ZodNativeEnum = z.nativeEnum( CompanyBenefitUpdateRequestCatchUpType, ); /** @internal */ export type CompanyBenefitUpdateRequest$Outbound = { version: string; active?: boolean | undefined; description?: string | undefined; responsible_for_employer_taxes?: boolean | undefined; responsible_for_employee_w2?: boolean | undefined; catch_up_type?: string | null | undefined; }; /** @internal */ export const CompanyBenefitUpdateRequest$outboundSchema: z.ZodType< CompanyBenefitUpdateRequest$Outbound, z.ZodTypeDef, CompanyBenefitUpdateRequest > = z.object({ version: z.string(), active: z.boolean().optional(), description: z.string().optional(), responsibleForEmployerTaxes: z.boolean().optional(), responsibleForEmployeeW2: z.boolean().optional(), catchUpType: z.nullable(CompanyBenefitUpdateRequestCatchUpType$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { responsibleForEmployerTaxes: "responsible_for_employer_taxes", responsibleForEmployeeW2: "responsible_for_employee_w2", catchUpType: "catch_up_type", }); }); export function companyBenefitUpdateRequestToJSON( companyBenefitUpdateRequest: CompanyBenefitUpdateRequest, ): string { return JSON.stringify( CompanyBenefitUpdateRequest$outboundSchema.parse( companyBenefitUpdateRequest, ), ); }