/* * 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 { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { PayScheduleCreateRequest, PayScheduleCreateRequest$Outbound, PayScheduleCreateRequest$outboundSchema, } from "../components/payschedulecreaterequest.js"; import { PayScheduleShow, PayScheduleShow$inboundSchema, } from "../components/payscheduleshow.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 PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion = { 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 PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion = ClosedEnum; export type PostV1CompaniesCompanyIdPaySchedulesRequest = { /** * 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?: | PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; payScheduleCreateRequest: PayScheduleCreateRequest; }; export type PostV1CompaniesCompanyIdPaySchedulesResponse = { httpMeta: HTTPMetadata; /** * Created */ payScheduleShow?: PayScheduleShow | undefined; }; /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion > = z.nativeEnum(PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion); /** @internal */ export type PostV1CompaniesCompanyIdPaySchedulesRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; "Pay-Schedule-Create-Request": PayScheduleCreateRequest$Outbound; }; /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesRequest$outboundSchema: z.ZodType< PostV1CompaniesCompanyIdPaySchedulesRequest$Outbound, z.ZodTypeDef, PostV1CompaniesCompanyIdPaySchedulesRequest > = z.object({ xGustoAPIVersion: PostV1CompaniesCompanyIdPaySchedulesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), payScheduleCreateRequest: PayScheduleCreateRequest$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", payScheduleCreateRequest: "Pay-Schedule-Create-Request", }); }); export function postV1CompaniesCompanyIdPaySchedulesRequestToJSON( postV1CompaniesCompanyIdPaySchedulesRequest: PostV1CompaniesCompanyIdPaySchedulesRequest, ): string { return JSON.stringify( PostV1CompaniesCompanyIdPaySchedulesRequest$outboundSchema.parse( postV1CompaniesCompanyIdPaySchedulesRequest, ), ); } /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesResponse$inboundSchema: z.ZodType< PostV1CompaniesCompanyIdPaySchedulesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Pay-Schedule-Show": PayScheduleShow$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Pay-Schedule-Show": "payScheduleShow", }); }); export function postV1CompaniesCompanyIdPaySchedulesResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1CompaniesCompanyIdPaySchedulesResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1CompaniesCompanyIdPaySchedulesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1CompaniesCompanyIdPaySchedulesResponse' from JSON`, ); }