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