/* * 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 { ContractorPaymentListing, ContractorPaymentListing$inboundSchema, } from "../components/contractorpaymentlisting.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 GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion = { 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 GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion >; export type GetV1ContractorsContractorUuidPaymentsRequest = { /** * 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?: | GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion | undefined; /** * The UUID of the contractor */ contractorUuid: string; /** * Sort the results. Format: `field` or `field:direction` where `field` is `check_date` or `created_at` and `direction` is `asc` or `desc`. */ sortBy?: string | undefined; /** * The page that is requested. When unspecified, will load all objects unless endpoint forces pagination. */ page?: number | undefined; /** * Number of objects per page. For majority of endpoints will default to 25 */ per?: number | undefined; }; export type GetV1ContractorsContractorUuidPaymentsResponse = { httpMeta: HTTPMetadata; /** * A JSON array of contractor payments */ contractorPaymentListings?: Array | undefined; }; /** @internal */ export const GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion > = z.nativeEnum( GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion, ); /** @internal */ export type GetV1ContractorsContractorUuidPaymentsRequest$Outbound = { "X-Gusto-API-Version": string; contractor_uuid: string; sort_by?: string | undefined; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetV1ContractorsContractorUuidPaymentsRequest$outboundSchema: z.ZodType< GetV1ContractorsContractorUuidPaymentsRequest$Outbound, z.ZodTypeDef, GetV1ContractorsContractorUuidPaymentsRequest > = z.object({ xGustoAPIVersion: GetV1ContractorsContractorUuidPaymentsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), contractorUuid: z.string(), sortBy: z.string().optional(), page: z.number().int().optional(), per: z.number().int().optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", contractorUuid: "contractor_uuid", sortBy: "sort_by", }); }); export function getV1ContractorsContractorUuidPaymentsRequestToJSON( getV1ContractorsContractorUuidPaymentsRequest: GetV1ContractorsContractorUuidPaymentsRequest, ): string { return JSON.stringify( GetV1ContractorsContractorUuidPaymentsRequest$outboundSchema.parse( getV1ContractorsContractorUuidPaymentsRequest, ), ); } /** @internal */ export const GetV1ContractorsContractorUuidPaymentsResponse$inboundSchema: z.ZodType< GetV1ContractorsContractorUuidPaymentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Contractor-Payment-Listings": z.array( ContractorPaymentListing$inboundSchema, ).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Contractor-Payment-Listings": "contractorPaymentListings", }); }); export function getV1ContractorsContractorUuidPaymentsResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1ContractorsContractorUuidPaymentsResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1ContractorsContractorUuidPaymentsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1ContractorsContractorUuidPaymentsResponse' from JSON`, ); }