/* * 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 { EmployeeBenefit, EmployeeBenefit$inboundSchema, } from "../components/employeebenefit.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 GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion = { 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 GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion >; /** * Available options: * * @remarks * - all_benefits: Include all effective dated benefits for each employee instead of only the current benefits. */ export const GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude = { AllBenefits: "all_benefits", } as const; /** * Available options: * * @remarks * - all_benefits: Include all effective dated benefits for each employee instead of only the current benefits. */ export type GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude = ClosedEnum; export type GetV1EmployeesEmployeeIdEmployeeBenefitsRequest = { /** * 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?: | GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: 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_benefits: Include all effective dated benefits for each employee instead of only the current benefits. */ include?: | GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude | undefined; }; export type GetV1EmployeesEmployeeIdEmployeeBenefitsResponse = { httpMeta: HTTPMetadata; /** * Example response */ employeeBenefits?: Array | undefined; }; /** @internal */ export const GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion > = z.nativeEnum( GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion, ); /** @internal */ export const GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude$outboundSchema: z.ZodNativeEnum< typeof GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude > = z.nativeEnum(GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude); /** @internal */ export type GetV1EmployeesEmployeeIdEmployeeBenefitsRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; page?: number | undefined; per?: number | undefined; include?: string | undefined; }; /** @internal */ export const GetV1EmployeesEmployeeIdEmployeeBenefitsRequest$outboundSchema: z.ZodType< GetV1EmployeesEmployeeIdEmployeeBenefitsRequest$Outbound, z.ZodTypeDef, GetV1EmployeesEmployeeIdEmployeeBenefitsRequest > = z.object({ xGustoAPIVersion: GetV1EmployeesEmployeeIdEmployeeBenefitsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeId: z.string(), page: z.number().int().optional(), per: z.number().int().optional(), include: GetV1EmployeesEmployeeIdEmployeeBenefitsQueryParamInclude$outboundSchema .optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", }); }); export function getV1EmployeesEmployeeIdEmployeeBenefitsRequestToJSON( getV1EmployeesEmployeeIdEmployeeBenefitsRequest: GetV1EmployeesEmployeeIdEmployeeBenefitsRequest, ): string { return JSON.stringify( GetV1EmployeesEmployeeIdEmployeeBenefitsRequest$outboundSchema.parse( getV1EmployeesEmployeeIdEmployeeBenefitsRequest, ), ); } /** @internal */ export const GetV1EmployeesEmployeeIdEmployeeBenefitsResponse$inboundSchema: z.ZodType< GetV1EmployeesEmployeeIdEmployeeBenefitsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Employee-Benefits": z.array(EmployeeBenefit$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Employee-Benefits": "employeeBenefits", }); }); export function getV1EmployeesEmployeeIdEmployeeBenefitsResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1EmployeesEmployeeIdEmployeeBenefitsResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1EmployeesEmployeeIdEmployeeBenefitsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1EmployeesEmployeeIdEmployeeBenefitsResponse' from JSON`, ); }