/* * 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 { Compensation, Compensation$inboundSchema, } from "../components/compensation.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 GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion = { 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 GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion >; /** * Available options: * * @remarks * - all_compensations: Include all effective dated compensations for each job instead of only the current compensation */ export const GetV1JobsJobIdCompensationsQueryParamInclude = { AllCompensations: "all_compensations", } as const; /** * Available options: * * @remarks * - all_compensations: Include all effective dated compensations for each job instead of only the current compensation */ export type GetV1JobsJobIdCompensationsQueryParamInclude = ClosedEnum< typeof GetV1JobsJobIdCompensationsQueryParamInclude >; export type GetV1JobsJobIdCompensationsRequest = { /** * 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?: | GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion | undefined; /** * The UUID of the job */ jobId: string; /** * 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; /** * Available options: * * @remarks * - all_compensations: Include all effective dated compensations for each job instead of only the current compensation */ include?: GetV1JobsJobIdCompensationsQueryParamInclude | undefined; }; export type GetV1JobsJobIdCompensationsResponse = { httpMeta: HTTPMetadata; /** * Successful */ compensations?: Array | undefined; }; /** @internal */ export const GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion); /** @internal */ export const GetV1JobsJobIdCompensationsQueryParamInclude$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1JobsJobIdCompensationsQueryParamInclude); /** @internal */ export type GetV1JobsJobIdCompensationsRequest$Outbound = { "X-Gusto-API-Version": string; job_id: string; page?: number | undefined; per?: number | undefined; include?: string | undefined; }; /** @internal */ export const GetV1JobsJobIdCompensationsRequest$outboundSchema: z.ZodType< GetV1JobsJobIdCompensationsRequest$Outbound, z.ZodTypeDef, GetV1JobsJobIdCompensationsRequest > = z.object({ xGustoAPIVersion: GetV1JobsJobIdCompensationsHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), jobId: z.string(), page: z.number().int().optional(), per: z.number().int().optional(), include: GetV1JobsJobIdCompensationsQueryParamInclude$outboundSchema .optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", jobId: "job_id", }); }); export function getV1JobsJobIdCompensationsRequestToJSON( getV1JobsJobIdCompensationsRequest: GetV1JobsJobIdCompensationsRequest, ): string { return JSON.stringify( GetV1JobsJobIdCompensationsRequest$outboundSchema.parse( getV1JobsJobIdCompensationsRequest, ), ); } /** @internal */ export const GetV1JobsJobIdCompensationsResponse$inboundSchema: z.ZodType< GetV1JobsJobIdCompensationsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Compensations: z.array(Compensation$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Compensations": "compensations", }); }); export function getV1JobsJobIdCompensationsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1JobsJobIdCompensationsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1JobsJobIdCompensationsResponse' from JSON`, ); }