/* * 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 { Garnishment, Garnishment$inboundSchema, } from "../components/garnishment.js"; import { GarnishmentRequest, GarnishmentRequest$Outbound, GarnishmentRequest$outboundSchema, } from "../components/garnishmentrequest.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 PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion = { 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 PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion = ClosedEnum< typeof PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion >; export type PostV1EmployeesEmployeeIdGarnishmentsRequest = { /** * 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?: | PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: string; garnishmentRequest: GarnishmentRequest; }; export type PostV1EmployeesEmployeeIdGarnishmentsResponse = { httpMeta: HTTPMetadata; /** * Example response */ garnishment?: Garnishment | undefined; }; /** @internal */ export const PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion > = z.nativeEnum(PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion); /** @internal */ export type PostV1EmployeesEmployeeIdGarnishmentsRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; "Garnishment-Request": GarnishmentRequest$Outbound; }; /** @internal */ export const PostV1EmployeesEmployeeIdGarnishmentsRequest$outboundSchema: z.ZodType< PostV1EmployeesEmployeeIdGarnishmentsRequest$Outbound, z.ZodTypeDef, PostV1EmployeesEmployeeIdGarnishmentsRequest > = z.object({ xGustoAPIVersion: PostV1EmployeesEmployeeIdGarnishmentsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeId: z.string(), garnishmentRequest: GarnishmentRequest$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", garnishmentRequest: "Garnishment-Request", }); }); export function postV1EmployeesEmployeeIdGarnishmentsRequestToJSON( postV1EmployeesEmployeeIdGarnishmentsRequest: PostV1EmployeesEmployeeIdGarnishmentsRequest, ): string { return JSON.stringify( PostV1EmployeesEmployeeIdGarnishmentsRequest$outboundSchema.parse( postV1EmployeesEmployeeIdGarnishmentsRequest, ), ); } /** @internal */ export const PostV1EmployeesEmployeeIdGarnishmentsResponse$inboundSchema: z.ZodType< PostV1EmployeesEmployeeIdGarnishmentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Garnishment: Garnishment$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Garnishment": "garnishment", }); }); export function postV1EmployeesEmployeeIdGarnishmentsResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1EmployeesEmployeeIdGarnishmentsResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1EmployeesEmployeeIdGarnishmentsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1EmployeesEmployeeIdGarnishmentsResponse' from JSON`, ); }