/* * 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 { Form1099, Form1099$inboundSchema } from "../components/form1099.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 GetV1ContractorFormHeaderXGustoAPIVersion = { 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 GetV1ContractorFormHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1ContractorFormHeaderXGustoAPIVersion >; export type GetV1ContractorFormRequest = { /** * 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?: GetV1ContractorFormHeaderXGustoAPIVersion | undefined; /** * The UUID of the contractor */ contractorUuid: string; /** * The UUID of the form */ formId: string; }; export type GetV1ContractorFormResponse = { httpMeta: HTTPMetadata; /** * Example response */ form1099?: Form1099 | undefined; }; /** @internal */ export const GetV1ContractorFormHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1ContractorFormHeaderXGustoAPIVersion); /** @internal */ export type GetV1ContractorFormRequest$Outbound = { "X-Gusto-API-Version": string; contractor_uuid: string; form_id: string; }; /** @internal */ export const GetV1ContractorFormRequest$outboundSchema: z.ZodType< GetV1ContractorFormRequest$Outbound, z.ZodTypeDef, GetV1ContractorFormRequest > = z.object({ xGustoAPIVersion: GetV1ContractorFormHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), contractorUuid: z.string(), formId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", contractorUuid: "contractor_uuid", formId: "form_id", }); }); export function getV1ContractorFormRequestToJSON( getV1ContractorFormRequest: GetV1ContractorFormRequest, ): string { return JSON.stringify( GetV1ContractorFormRequest$outboundSchema.parse(getV1ContractorFormRequest), ); } /** @internal */ export const GetV1ContractorFormResponse$inboundSchema: z.ZodType< GetV1ContractorFormResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Form_1099: Form1099$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Form_1099": "form1099", }); }); export function getV1ContractorFormResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1ContractorFormResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1ContractorFormResponse' from JSON`, ); }