/* * 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 { ChildSupportData, ChildSupportData$inboundSchema, } from "../components/childsupportdata.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 GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion = { 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 GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion >; export type GetV1GarnishmentsChildSupportRequest = { /** * 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?: | GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion | undefined; }; export type GetV1GarnishmentsChildSupportResponse = { httpMeta: HTTPMetadata; /** * Example response */ childSupportData?: ChildSupportData | undefined; }; /** @internal */ export const GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z.nativeEnum(GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion); /** @internal */ export type GetV1GarnishmentsChildSupportRequest$Outbound = { "X-Gusto-API-Version": string; }; /** @internal */ export const GetV1GarnishmentsChildSupportRequest$outboundSchema: z.ZodType< GetV1GarnishmentsChildSupportRequest$Outbound, z.ZodTypeDef, GetV1GarnishmentsChildSupportRequest > = z.object({ xGustoAPIVersion: GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", }); }); export function getV1GarnishmentsChildSupportRequestToJSON( getV1GarnishmentsChildSupportRequest: GetV1GarnishmentsChildSupportRequest, ): string { return JSON.stringify( GetV1GarnishmentsChildSupportRequest$outboundSchema.parse( getV1GarnishmentsChildSupportRequest, ), ); } /** @internal */ export const GetV1GarnishmentsChildSupportResponse$inboundSchema: z.ZodType< GetV1GarnishmentsChildSupportResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Child-Support-Data": ChildSupportData$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Child-Support-Data": "childSupportData", }); }); export function getV1GarnishmentsChildSupportResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1GarnishmentsChildSupportResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1GarnishmentsChildSupportResponse' from JSON`, ); }