/* * 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 { ContractorPaymentGroupWithBlockers, ContractorPaymentGroupWithBlockers$inboundSchema, } from "../components/contractorpaymentgroupwithblockers.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 GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion = { 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 GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion >; export type GetV1CompaniesCompanyIdContractorPaymentGroupsRequest = { /** * The UUID of the company */ companyId: string; /** * The time period for which to retrieve contractor payment groups. Defaults to 6 months ago. */ startDate?: string | undefined; /** * The time period for which to retrieve contractor payment groups. Defaults to today's date. */ endDate?: 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; /** * 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?: | GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion | undefined; }; export type GetV1CompaniesCompanyIdContractorPaymentGroupsResponse = { httpMeta: HTTPMetadata; /** * List of Contractor Payment Groups */ contractorPaymentGroupWithBlockers?: | Array | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion > = z.nativeEnum( GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion, ); /** @internal */ export type GetV1CompaniesCompanyIdContractorPaymentGroupsRequest$Outbound = { company_id: string; start_date?: string | undefined; end_date?: string | undefined; page?: number | undefined; per?: number | undefined; "X-Gusto-API-Version": string; }; /** @internal */ export const GetV1CompaniesCompanyIdContractorPaymentGroupsRequest$outboundSchema: z.ZodType< GetV1CompaniesCompanyIdContractorPaymentGroupsRequest$Outbound, z.ZodTypeDef, GetV1CompaniesCompanyIdContractorPaymentGroupsRequest > = z.object({ companyId: z.string(), startDate: z.string().optional(), endDate: z.string().optional(), page: z.number().int().optional(), per: z.number().int().optional(), xGustoAPIVersion: GetV1CompaniesCompanyIdContractorPaymentGroupsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), }).transform((v) => { return remap$(v, { companyId: "company_id", startDate: "start_date", endDate: "end_date", xGustoAPIVersion: "X-Gusto-API-Version", }); }); export function getV1CompaniesCompanyIdContractorPaymentGroupsRequestToJSON( getV1CompaniesCompanyIdContractorPaymentGroupsRequest: GetV1CompaniesCompanyIdContractorPaymentGroupsRequest, ): string { return JSON.stringify( GetV1CompaniesCompanyIdContractorPaymentGroupsRequest$outboundSchema.parse( getV1CompaniesCompanyIdContractorPaymentGroupsRequest, ), ); } /** @internal */ export const GetV1CompaniesCompanyIdContractorPaymentGroupsResponse$inboundSchema: z.ZodType< GetV1CompaniesCompanyIdContractorPaymentGroupsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Contractor-Payment-Group-With-Blockers": z.array( ContractorPaymentGroupWithBlockers$inboundSchema, ).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Contractor-Payment-Group-With-Blockers": "contractorPaymentGroupWithBlockers", }); }); export function getV1CompaniesCompanyIdContractorPaymentGroupsResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1CompaniesCompanyIdContractorPaymentGroupsResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1CompaniesCompanyIdContractorPaymentGroupsResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetV1CompaniesCompanyIdContractorPaymentGroupsResponse' from JSON`, ); }