/* * 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 { PayScheduleAssignmentBody, PayScheduleAssignmentBody$Outbound, PayScheduleAssignmentBody$outboundSchema, } from "../components/payscheduleassignmentbody.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 PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion = { 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 PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion = ClosedEnum< typeof PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion >; export type PostV1CompaniesCompanyIdPaySchedulesAssignRequest = { /** * 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?: | PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; payScheduleAssignmentBody: PayScheduleAssignmentBody; }; export type PostV1CompaniesCompanyIdPaySchedulesAssignResponse = { httpMeta: HTTPMetadata; }; /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion > = z.nativeEnum( PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion, ); /** @internal */ export type PostV1CompaniesCompanyIdPaySchedulesAssignRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; "Pay-Schedule-Assignment-Body": PayScheduleAssignmentBody$Outbound; }; /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesAssignRequest$outboundSchema: z.ZodType< PostV1CompaniesCompanyIdPaySchedulesAssignRequest$Outbound, z.ZodTypeDef, PostV1CompaniesCompanyIdPaySchedulesAssignRequest > = z.object({ xGustoAPIVersion: PostV1CompaniesCompanyIdPaySchedulesAssignHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), payScheduleAssignmentBody: PayScheduleAssignmentBody$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", payScheduleAssignmentBody: "Pay-Schedule-Assignment-Body", }); }); export function postV1CompaniesCompanyIdPaySchedulesAssignRequestToJSON( postV1CompaniesCompanyIdPaySchedulesAssignRequest: PostV1CompaniesCompanyIdPaySchedulesAssignRequest, ): string { return JSON.stringify( PostV1CompaniesCompanyIdPaySchedulesAssignRequest$outboundSchema.parse( postV1CompaniesCompanyIdPaySchedulesAssignRequest, ), ); } /** @internal */ export const PostV1CompaniesCompanyIdPaySchedulesAssignResponse$inboundSchema: z.ZodType< PostV1CompaniesCompanyIdPaySchedulesAssignResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", }); }); export function postV1CompaniesCompanyIdPaySchedulesAssignResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1CompaniesCompanyIdPaySchedulesAssignResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1CompaniesCompanyIdPaySchedulesAssignResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1CompaniesCompanyIdPaySchedulesAssignResponse' from JSON`, ); }