/* * 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 { Employee, Employee$inboundSchema } from "../components/employee.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 GetV1EmployeesHeaderXGustoAPIVersion = { 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 GetV1EmployeesHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1EmployeesHeaderXGustoAPIVersion >; export const QueryParamInclude = { AllCompensations: "all_compensations", AllHomeAddresses: "all_home_addresses", CompanyName: "company_name", CurrentHomeAddress: "current_home_address", CustomFields: "custom_fields", PortalInvitations: "portal_invitations", } as const; export type QueryParamInclude = ClosedEnum; export type GetV1EmployeesRequest = { /** * 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?: GetV1EmployeesHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: string; /** * Include the requested attribute(s) in each employee response. Multiple options are comma separated. */ include?: Array | undefined; }; export type GetV1EmployeesResponse = { httpMeta: HTTPMetadata; /** * successful */ employee?: Employee | undefined; }; /** @internal */ export const GetV1EmployeesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z.nativeEnum( GetV1EmployeesHeaderXGustoAPIVersion, ); /** @internal */ export const QueryParamInclude$outboundSchema: z.ZodNativeEnum< typeof QueryParamInclude > = z.nativeEnum(QueryParamInclude); /** @internal */ export type GetV1EmployeesRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; include?: Array | undefined; }; /** @internal */ export const GetV1EmployeesRequest$outboundSchema: z.ZodType< GetV1EmployeesRequest$Outbound, z.ZodTypeDef, GetV1EmployeesRequest > = z.object({ xGustoAPIVersion: GetV1EmployeesHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), employeeId: z.string(), include: z.array(QueryParamInclude$outboundSchema).optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", }); }); export function getV1EmployeesRequestToJSON( getV1EmployeesRequest: GetV1EmployeesRequest, ): string { return JSON.stringify( GetV1EmployeesRequest$outboundSchema.parse(getV1EmployeesRequest), ); } /** @internal */ export const GetV1EmployeesResponse$inboundSchema: z.ZodType< GetV1EmployeesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Employee: Employee$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Employee": "employee", }); }); export function getV1EmployeesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1EmployeesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1EmployeesResponse' from JSON`, ); }