/* * 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"; export const Name = { VacationHours: "Vacation Hours", SickHours: "Sick Hours", HolidayHours: "Holiday Hours", } as const; export type Name = ClosedEnum; /** * The representation of paid time off in Gusto. */ export type PaidTimeOff = { /** * The name of the paid time off type. */ name?: Name | null | undefined; /** * The name of the time off policy. */ policyName?: string | null | undefined; /** * The UUID of the time off policy. */ policyUuid?: string | null | undefined; /** * The unit the PTO type is accrued in. */ accrualUnit?: string | null | undefined; /** * The number of accrual units accrued per accrual period. */ accrualRate?: string | null | undefined; /** * The accrual method of the time off policy */ accrualMethod?: string | null | undefined; /** * The frequency at which the PTO type is accrued. */ accrualPeriod?: string | null | undefined; /** * The number of accrual units accrued. */ accrualBalance?: string | null | undefined; /** * The maximum number of accrual units allowed. A null value signifies no maximum. */ maximumAccrualBalance?: string | null | undefined; /** * Whether the accrual balance is paid to the employee upon termination. */ paidAtTermination?: boolean | undefined; }; /** @internal */ export const Name$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Name, ); /** @internal */ export const PaidTimeOff$inboundSchema: z.ZodType< PaidTimeOff, z.ZodTypeDef, unknown > = z.object({ name: z.nullable(Name$inboundSchema).optional(), policy_name: z.nullable(z.string()).optional(), policy_uuid: z.nullable(z.string()).optional(), accrual_unit: z.nullable(z.string()).optional(), accrual_rate: z.nullable(z.string()).optional(), accrual_method: z.nullable(z.string()).optional(), accrual_period: z.nullable(z.string()).optional(), accrual_balance: z.nullable(z.string()).optional(), maximum_accrual_balance: z.nullable(z.string()).optional(), paid_at_termination: z.boolean().optional(), }).transform((v) => { return remap$(v, { "policy_name": "policyName", "policy_uuid": "policyUuid", "accrual_unit": "accrualUnit", "accrual_rate": "accrualRate", "accrual_method": "accrualMethod", "accrual_period": "accrualPeriod", "accrual_balance": "accrualBalance", "maximum_accrual_balance": "maximumAccrualBalance", "paid_at_termination": "paidAtTermination", }); }); export function paidTimeOffFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaidTimeOff$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaidTimeOff' from JSON`, ); }