/* * 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 { Form, Form$inboundSchema } from "../components/form.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 GetV1EmployeeFormHeaderXGustoAPIVersion = { 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 GetV1EmployeeFormHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1EmployeeFormHeaderXGustoAPIVersion >; export type GetV1EmployeeFormRequest = { /** * 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?: GetV1EmployeeFormHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: string; /** * The UUID of the form */ formId: string; }; export type GetV1EmployeeFormResponse = { httpMeta: HTTPMetadata; /** * Success */ form?: Form | undefined; }; /** @internal */ export const GetV1EmployeeFormHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1EmployeeFormHeaderXGustoAPIVersion); /** @internal */ export type GetV1EmployeeFormRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; form_id: string; }; /** @internal */ export const GetV1EmployeeFormRequest$outboundSchema: z.ZodType< GetV1EmployeeFormRequest$Outbound, z.ZodTypeDef, GetV1EmployeeFormRequest > = z.object({ xGustoAPIVersion: GetV1EmployeeFormHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeId: z.string(), formId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", formId: "form_id", }); }); export function getV1EmployeeFormRequestToJSON( getV1EmployeeFormRequest: GetV1EmployeeFormRequest, ): string { return JSON.stringify( GetV1EmployeeFormRequest$outboundSchema.parse(getV1EmployeeFormRequest), ); } /** @internal */ export const GetV1EmployeeFormResponse$inboundSchema: z.ZodType< GetV1EmployeeFormResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Form: Form$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Form": "form", }); }); export function getV1EmployeeFormResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1EmployeeFormResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1EmployeeFormResponse' from JSON`, ); }