/* * 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 { ExternalPayroll, ExternalPayroll$inboundSchema, } from "../components/externalpayroll.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 GetV1ExternalPayrollHeaderXGustoAPIVersion = { 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 GetV1ExternalPayrollHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1ExternalPayrollHeaderXGustoAPIVersion >; export type GetV1ExternalPayrollRequest = { /** * 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?: GetV1ExternalPayrollHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; /** * The UUID of the external payroll */ externalPayrollId: string; }; export type GetV1ExternalPayrollResponse = { httpMeta: HTTPMetadata; /** * Success */ externalPayroll?: ExternalPayroll | undefined; }; /** @internal */ export const GetV1ExternalPayrollHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1ExternalPayrollHeaderXGustoAPIVersion); /** @internal */ export type GetV1ExternalPayrollRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; external_payroll_id: string; }; /** @internal */ export const GetV1ExternalPayrollRequest$outboundSchema: z.ZodType< GetV1ExternalPayrollRequest$Outbound, z.ZodTypeDef, GetV1ExternalPayrollRequest > = z.object({ xGustoAPIVersion: GetV1ExternalPayrollHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyUuid: z.string(), externalPayrollId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyUuid: "company_uuid", externalPayrollId: "external_payroll_id", }); }); export function getV1ExternalPayrollRequestToJSON( getV1ExternalPayrollRequest: GetV1ExternalPayrollRequest, ): string { return JSON.stringify( GetV1ExternalPayrollRequest$outboundSchema.parse( getV1ExternalPayrollRequest, ), ); } /** @internal */ export const GetV1ExternalPayrollResponse$inboundSchema: z.ZodType< GetV1ExternalPayrollResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "External-Payroll": ExternalPayroll$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "External-Payroll": "externalPayroll", }); }); export function getV1ExternalPayrollResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1ExternalPayrollResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1ExternalPayrollResponse' from JSON`, ); }