/* * 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 { PayrollBatchResults, PayrollBatchResults$inboundSchema, } from "../components/payrollbatchresults.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetV1PayrollBatchesPayrollBatchUuidSecurity = { systemAccessAuth: string; }; /** * 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 GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion = { 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 GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion = ClosedEnum; export type GetV1PayrollBatchesPayrollBatchUuidRequest = { /** * 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?: | GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion | undefined; /** * The UUID of the payroll cancellation batch returned by `POST /v1/payroll_batches`. */ payrollBatchUuid: string; }; export type GetV1PayrollBatchesPayrollBatchUuidResponse = { httpMeta: HTTPMetadata; /** * successful */ payrollBatchResults?: PayrollBatchResults | undefined; }; /** @internal */ export type GetV1PayrollBatchesPayrollBatchUuidSecurity$Outbound = { SystemAccessAuth: string; }; /** @internal */ export const GetV1PayrollBatchesPayrollBatchUuidSecurity$outboundSchema: z.ZodType< GetV1PayrollBatchesPayrollBatchUuidSecurity$Outbound, z.ZodTypeDef, GetV1PayrollBatchesPayrollBatchUuidSecurity > = z.object({ systemAccessAuth: z.string(), }).transform((v) => { return remap$(v, { systemAccessAuth: "SystemAccessAuth", }); }); export function getV1PayrollBatchesPayrollBatchUuidSecurityToJSON( getV1PayrollBatchesPayrollBatchUuidSecurity: GetV1PayrollBatchesPayrollBatchUuidSecurity, ): string { return JSON.stringify( GetV1PayrollBatchesPayrollBatchUuidSecurity$outboundSchema.parse( getV1PayrollBatchesPayrollBatchUuidSecurity, ), ); } /** @internal */ export const GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion > = z.nativeEnum(GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion); /** @internal */ export type GetV1PayrollBatchesPayrollBatchUuidRequest$Outbound = { "X-Gusto-API-Version": string; payroll_batch_uuid: string; }; /** @internal */ export const GetV1PayrollBatchesPayrollBatchUuidRequest$outboundSchema: z.ZodType< GetV1PayrollBatchesPayrollBatchUuidRequest$Outbound, z.ZodTypeDef, GetV1PayrollBatchesPayrollBatchUuidRequest > = z.object({ xGustoAPIVersion: GetV1PayrollBatchesPayrollBatchUuidHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), payrollBatchUuid: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", payrollBatchUuid: "payroll_batch_uuid", }); }); export function getV1PayrollBatchesPayrollBatchUuidRequestToJSON( getV1PayrollBatchesPayrollBatchUuidRequest: GetV1PayrollBatchesPayrollBatchUuidRequest, ): string { return JSON.stringify( GetV1PayrollBatchesPayrollBatchUuidRequest$outboundSchema.parse( getV1PayrollBatchesPayrollBatchUuidRequest, ), ); } /** @internal */ export const GetV1PayrollBatchesPayrollBatchUuidResponse$inboundSchema: z.ZodType< GetV1PayrollBatchesPayrollBatchUuidResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Payroll-Batch-Results": PayrollBatchResults$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Payroll-Batch-Results": "payrollBatchResults", }); }); export function getV1PayrollBatchesPayrollBatchUuidResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1PayrollBatchesPayrollBatchUuidResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1PayrollBatchesPayrollBatchUuidResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1PayrollBatchesPayrollBatchUuidResponse' from JSON`, ); }