/* * 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 { 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 GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion = { 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 GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion >; export type GetV1GarnishmentsGarnishmentIdRequest = { /** * 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?: | GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion | undefined; /** * The UUID of the garnishment */ garnishmentId: string; }; export type GetV1GarnishmentsGarnishmentIdResponse = { httpMeta: HTTPMetadata; /** * Example response */ garnishment?: Garnishment | undefined; }; /** @internal */ export const GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z.nativeEnum(GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion); /** @internal */ export type GetV1GarnishmentsGarnishmentIdRequest$Outbound = { "X-Gusto-API-Version": string; garnishment_id: string; }; /** @internal */ export const GetV1GarnishmentsGarnishmentIdRequest$outboundSchema: z.ZodType< GetV1GarnishmentsGarnishmentIdRequest$Outbound, z.ZodTypeDef, GetV1GarnishmentsGarnishmentIdRequest > = z.object({ xGustoAPIVersion: GetV1GarnishmentsGarnishmentIdHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), garnishmentId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", garnishmentId: "garnishment_id", }); }); export function getV1GarnishmentsGarnishmentIdRequestToJSON( getV1GarnishmentsGarnishmentIdRequest: GetV1GarnishmentsGarnishmentIdRequest, ): string { return JSON.stringify( GetV1GarnishmentsGarnishmentIdRequest$outboundSchema.parse( getV1GarnishmentsGarnishmentIdRequest, ), ); } /** @internal */ export const GetV1GarnishmentsGarnishmentIdResponse$inboundSchema: z.ZodType< GetV1GarnishmentsGarnishmentIdResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Garnishment: Garnishment$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Garnishment": "garnishment", }); }); export function getV1GarnishmentsGarnishmentIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1GarnishmentsGarnishmentIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1GarnishmentsGarnishmentIdResponse' from JSON`, ); }