/* * 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 { PayrollPrepared, PayrollPrepared$inboundSchema, } from "../components/payroll.js"; import { PayrollUpdate, PayrollUpdate$Outbound, PayrollUpdate$outboundSchema, } from "../components/payrollupdate.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 PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion = { 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 PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion = ClosedEnum< typeof PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion >; export type PutV1CompaniesCompanyIdPayrollsRequest = { /** * 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?: | PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; /** * The UUID of the payroll */ payrollId: string; payrollUpdate: PayrollUpdate; }; export type PutV1CompaniesCompanyIdPayrollsResponse = { httpMeta: HTTPMetadata; /** * Successful */ payrollPrepared?: PayrollPrepared | undefined; }; /** @internal */ export const PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion > = z.nativeEnum(PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion); /** @internal */ export type PutV1CompaniesCompanyIdPayrollsRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; payroll_id: string; "Payroll-Update": PayrollUpdate$Outbound; }; /** @internal */ export const PutV1CompaniesCompanyIdPayrollsRequest$outboundSchema: z.ZodType< PutV1CompaniesCompanyIdPayrollsRequest$Outbound, z.ZodTypeDef, PutV1CompaniesCompanyIdPayrollsRequest > = z.object({ xGustoAPIVersion: PutV1CompaniesCompanyIdPayrollsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), payrollId: z.string(), payrollUpdate: PayrollUpdate$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", payrollId: "payroll_id", payrollUpdate: "Payroll-Update", }); }); export function putV1CompaniesCompanyIdPayrollsRequestToJSON( putV1CompaniesCompanyIdPayrollsRequest: PutV1CompaniesCompanyIdPayrollsRequest, ): string { return JSON.stringify( PutV1CompaniesCompanyIdPayrollsRequest$outboundSchema.parse( putV1CompaniesCompanyIdPayrollsRequest, ), ); } /** @internal */ export const PutV1CompaniesCompanyIdPayrollsResponse$inboundSchema: z.ZodType< PutV1CompaniesCompanyIdPayrollsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Payroll-Prepared": PayrollPrepared$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Payroll-Prepared": "payrollPrepared", }); }); export function putV1CompaniesCompanyIdPayrollsResponseFromJSON( jsonString: string, ): SafeParseResult< PutV1CompaniesCompanyIdPayrollsResponse, SDKValidationError > { return safeParse( jsonString, (x) => PutV1CompaniesCompanyIdPayrollsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutV1CompaniesCompanyIdPayrollsResponse' from JSON`, ); }