/* * 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"; /** * A paid holiday derived from the company's holiday pay policy */ export type PaidHoliday = { /** * The holiday's identifier (null for custom holidays) */ holidayKey?: string | null | undefined; /** * The holiday's official name */ holidayName?: string | undefined; /** * The holiday's start date (YYYY-MM-DD) */ startDate?: string | undefined; /** * The holiday's end date (YYYY-MM-DD) */ endDate?: string | undefined; }; /** @internal */ export const PaidHoliday$inboundSchema: z.ZodType< PaidHoliday, z.ZodTypeDef, unknown > = z.object({ holiday_key: z.nullable(z.string()).optional(), holiday_name: z.string().optional(), start_date: z.string().optional(), end_date: z.string().optional(), }).transform((v) => { return remap$(v, { "holiday_key": "holidayKey", "holiday_name": "holidayName", "start_date": "startDate", "end_date": "endDate", }); }); export function paidHolidayFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaidHoliday$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaidHoliday' from JSON`, ); }