/* * 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 { HolidayPayPolicy, HolidayPayPolicy$inboundSchema, } from "../components/holidaypaypolicy.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export const PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion = { TwoThousandAndTwentyFiveMinus06Minus15: "2025-06-15", } as const; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export type PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion = ClosedEnum< typeof PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion >; export type NewYearsDay = { selected?: boolean | undefined; }; export type MlkDay = { selected?: boolean | undefined; }; export type PresidentsDay = { selected?: boolean | undefined; }; export type MemorialDay = { selected?: boolean | undefined; }; export type Juneteenth = { selected?: boolean | undefined; }; export type IndependenceDay = { selected?: boolean | undefined; }; export type LaborDay = { selected?: boolean | undefined; }; export type ColumbusDay = { selected?: boolean | undefined; }; export type VeteransDay = { selected?: boolean | undefined; }; export type Thanksgiving = { selected?: boolean | undefined; }; export type ChristmasDay = { selected?: boolean | undefined; }; /** * An object containing federal holiday objects, each containing a boolean selected property. */ export type FederalHolidays = { newYearsDay?: NewYearsDay | undefined; mlkDay?: MlkDay | undefined; presidentsDay?: PresidentsDay | undefined; memorialDay?: MemorialDay | undefined; juneteenth?: Juneteenth | undefined; independenceDay?: IndependenceDay | undefined; laborDay?: LaborDay | undefined; columbusDay?: ColumbusDay | undefined; veteransDay?: VeteransDay | undefined; thanksgiving?: Thanksgiving | undefined; christmasDay?: ChristmasDay | undefined; }; /** * Request body for creating or updating a holiday pay policy */ export type PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version: string; /** * An object containing federal holiday objects, each containing a boolean selected property. */ federalHolidays?: FederalHolidays | undefined; }; export type PutV1CompaniesCompanyUuidHolidayPayPolicyRequest = { /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ xGustoAPIVersion?: | PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; requestBody: PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody; }; export type PutV1CompaniesCompanyUuidHolidayPayPolicyResponse = { httpMeta: HTTPMetadata; /** * successful */ holidayPayPolicy?: HolidayPayPolicy | undefined; }; /** @internal */ export const PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion > = z.nativeEnum( PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion, ); /** @internal */ export type NewYearsDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const NewYearsDay$outboundSchema: z.ZodType< NewYearsDay$Outbound, z.ZodTypeDef, NewYearsDay > = z.object({ selected: z.boolean().optional(), }); export function newYearsDayToJSON(newYearsDay: NewYearsDay): string { return JSON.stringify(NewYearsDay$outboundSchema.parse(newYearsDay)); } /** @internal */ export type MlkDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const MlkDay$outboundSchema: z.ZodType< MlkDay$Outbound, z.ZodTypeDef, MlkDay > = z.object({ selected: z.boolean().optional(), }); export function mlkDayToJSON(mlkDay: MlkDay): string { return JSON.stringify(MlkDay$outboundSchema.parse(mlkDay)); } /** @internal */ export type PresidentsDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const PresidentsDay$outboundSchema: z.ZodType< PresidentsDay$Outbound, z.ZodTypeDef, PresidentsDay > = z.object({ selected: z.boolean().optional(), }); export function presidentsDayToJSON(presidentsDay: PresidentsDay): string { return JSON.stringify(PresidentsDay$outboundSchema.parse(presidentsDay)); } /** @internal */ export type MemorialDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const MemorialDay$outboundSchema: z.ZodType< MemorialDay$Outbound, z.ZodTypeDef, MemorialDay > = z.object({ selected: z.boolean().optional(), }); export function memorialDayToJSON(memorialDay: MemorialDay): string { return JSON.stringify(MemorialDay$outboundSchema.parse(memorialDay)); } /** @internal */ export type Juneteenth$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const Juneteenth$outboundSchema: z.ZodType< Juneteenth$Outbound, z.ZodTypeDef, Juneteenth > = z.object({ selected: z.boolean().optional(), }); export function juneteenthToJSON(juneteenth: Juneteenth): string { return JSON.stringify(Juneteenth$outboundSchema.parse(juneteenth)); } /** @internal */ export type IndependenceDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const IndependenceDay$outboundSchema: z.ZodType< IndependenceDay$Outbound, z.ZodTypeDef, IndependenceDay > = z.object({ selected: z.boolean().optional(), }); export function independenceDayToJSON( independenceDay: IndependenceDay, ): string { return JSON.stringify(IndependenceDay$outboundSchema.parse(independenceDay)); } /** @internal */ export type LaborDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const LaborDay$outboundSchema: z.ZodType< LaborDay$Outbound, z.ZodTypeDef, LaborDay > = z.object({ selected: z.boolean().optional(), }); export function laborDayToJSON(laborDay: LaborDay): string { return JSON.stringify(LaborDay$outboundSchema.parse(laborDay)); } /** @internal */ export type ColumbusDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const ColumbusDay$outboundSchema: z.ZodType< ColumbusDay$Outbound, z.ZodTypeDef, ColumbusDay > = z.object({ selected: z.boolean().optional(), }); export function columbusDayToJSON(columbusDay: ColumbusDay): string { return JSON.stringify(ColumbusDay$outboundSchema.parse(columbusDay)); } /** @internal */ export type VeteransDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const VeteransDay$outboundSchema: z.ZodType< VeteransDay$Outbound, z.ZodTypeDef, VeteransDay > = z.object({ selected: z.boolean().optional(), }); export function veteransDayToJSON(veteransDay: VeteransDay): string { return JSON.stringify(VeteransDay$outboundSchema.parse(veteransDay)); } /** @internal */ export type Thanksgiving$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const Thanksgiving$outboundSchema: z.ZodType< Thanksgiving$Outbound, z.ZodTypeDef, Thanksgiving > = z.object({ selected: z.boolean().optional(), }); export function thanksgivingToJSON(thanksgiving: Thanksgiving): string { return JSON.stringify(Thanksgiving$outboundSchema.parse(thanksgiving)); } /** @internal */ export type ChristmasDay$Outbound = { selected?: boolean | undefined; }; /** @internal */ export const ChristmasDay$outboundSchema: z.ZodType< ChristmasDay$Outbound, z.ZodTypeDef, ChristmasDay > = z.object({ selected: z.boolean().optional(), }); export function christmasDayToJSON(christmasDay: ChristmasDay): string { return JSON.stringify(ChristmasDay$outboundSchema.parse(christmasDay)); } /** @internal */ export type FederalHolidays$Outbound = { new_years_day?: NewYearsDay$Outbound | undefined; mlk_day?: MlkDay$Outbound | undefined; presidents_day?: PresidentsDay$Outbound | undefined; memorial_day?: MemorialDay$Outbound | undefined; juneteenth?: Juneteenth$Outbound | undefined; independence_day?: IndependenceDay$Outbound | undefined; labor_day?: LaborDay$Outbound | undefined; columbus_day?: ColumbusDay$Outbound | undefined; veterans_day?: VeteransDay$Outbound | undefined; thanksgiving?: Thanksgiving$Outbound | undefined; christmas_day?: ChristmasDay$Outbound | undefined; }; /** @internal */ export const FederalHolidays$outboundSchema: z.ZodType< FederalHolidays$Outbound, z.ZodTypeDef, FederalHolidays > = z.object({ newYearsDay: z.lazy(() => NewYearsDay$outboundSchema).optional(), mlkDay: z.lazy(() => MlkDay$outboundSchema).optional(), presidentsDay: z.lazy(() => PresidentsDay$outboundSchema).optional(), memorialDay: z.lazy(() => MemorialDay$outboundSchema).optional(), juneteenth: z.lazy(() => Juneteenth$outboundSchema).optional(), independenceDay: z.lazy(() => IndependenceDay$outboundSchema).optional(), laborDay: z.lazy(() => LaborDay$outboundSchema).optional(), columbusDay: z.lazy(() => ColumbusDay$outboundSchema).optional(), veteransDay: z.lazy(() => VeteransDay$outboundSchema).optional(), thanksgiving: z.lazy(() => Thanksgiving$outboundSchema).optional(), christmasDay: z.lazy(() => ChristmasDay$outboundSchema).optional(), }).transform((v) => { return remap$(v, { newYearsDay: "new_years_day", mlkDay: "mlk_day", presidentsDay: "presidents_day", memorialDay: "memorial_day", independenceDay: "independence_day", laborDay: "labor_day", columbusDay: "columbus_day", veteransDay: "veterans_day", christmasDay: "christmas_day", }); }); export function federalHolidaysToJSON( federalHolidays: FederalHolidays, ): string { return JSON.stringify(FederalHolidays$outboundSchema.parse(federalHolidays)); } /** @internal */ export type PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$Outbound = { version: string; federal_holidays?: FederalHolidays$Outbound | undefined; }; /** @internal */ export const PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$outboundSchema: z.ZodType< PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$Outbound, z.ZodTypeDef, PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody > = z.object({ version: z.string(), federalHolidays: z.lazy(() => FederalHolidays$outboundSchema).optional(), }).transform((v) => { return remap$(v, { federalHolidays: "federal_holidays", }); }); export function putV1CompaniesCompanyUuidHolidayPayPolicyRequestBodyToJSON( putV1CompaniesCompanyUuidHolidayPayPolicyRequestBody: PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody, ): string { return JSON.stringify( PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$outboundSchema.parse( putV1CompaniesCompanyUuidHolidayPayPolicyRequestBody, ), ); } /** @internal */ export type PutV1CompaniesCompanyUuidHolidayPayPolicyRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; RequestBody: PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$Outbound; }; /** @internal */ export const PutV1CompaniesCompanyUuidHolidayPayPolicyRequest$outboundSchema: z.ZodType< PutV1CompaniesCompanyUuidHolidayPayPolicyRequest$Outbound, z.ZodTypeDef, PutV1CompaniesCompanyUuidHolidayPayPolicyRequest > = z.object({ xGustoAPIVersion: PutV1CompaniesCompanyUuidHolidayPayPolicyHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyUuid: z.string(), requestBody: z.lazy(() => PutV1CompaniesCompanyUuidHolidayPayPolicyRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyUuid: "company_uuid", requestBody: "RequestBody", }); }); export function putV1CompaniesCompanyUuidHolidayPayPolicyRequestToJSON( putV1CompaniesCompanyUuidHolidayPayPolicyRequest: PutV1CompaniesCompanyUuidHolidayPayPolicyRequest, ): string { return JSON.stringify( PutV1CompaniesCompanyUuidHolidayPayPolicyRequest$outboundSchema.parse( putV1CompaniesCompanyUuidHolidayPayPolicyRequest, ), ); } /** @internal */ export const PutV1CompaniesCompanyUuidHolidayPayPolicyResponse$inboundSchema: z.ZodType< PutV1CompaniesCompanyUuidHolidayPayPolicyResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Holiday-Pay-Policy": HolidayPayPolicy$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Holiday-Pay-Policy": "holidayPayPolicy", }); }); export function putV1CompaniesCompanyUuidHolidayPayPolicyResponseFromJSON( jsonString: string, ): SafeParseResult< PutV1CompaniesCompanyUuidHolidayPayPolicyResponse, SDKValidationError > { return safeParse( jsonString, (x) => PutV1CompaniesCompanyUuidHolidayPayPolicyResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutV1CompaniesCompanyUuidHolidayPayPolicyResponse' from JSON`, ); }