/* * 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 { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { I9Authorization, I9Authorization$inboundSchema, } from "../components/i9authorization.js"; import { I9AuthorizationEmployerSignRequestBody, I9AuthorizationEmployerSignRequestBody$Outbound, I9AuthorizationEmployerSignRequestBody$outboundSchema, } from "../components/i9authorizationemployersignrequestbody.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 PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion = { 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 PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion = ClosedEnum< typeof PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion >; export type PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest = { /** * 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?: | PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: string; /** * Optional header to supply the IP address. This can be used to supply the IP address for signature endpoints instead of the signed_by_ip_address parameter. */ xGustoClientIp?: string | undefined; i9AuthorizationEmployerSignRequestBody: I9AuthorizationEmployerSignRequestBody; }; export type PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse = { httpMeta: HTTPMetadata; /** * Success */ i9Authorization?: I9Authorization | undefined; }; /** @internal */ export const PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion > = z.nativeEnum( PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion, ); /** @internal */ export type PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; "x-gusto-client-ip"?: string | undefined; "I9-Authorization-Employer-Sign-Request-Body": I9AuthorizationEmployerSignRequestBody$Outbound; }; /** @internal */ export const PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest$outboundSchema: z.ZodType< PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest$Outbound, z.ZodTypeDef, PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest > = z.object({ xGustoAPIVersion: PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeId: z.string(), xGustoClientIp: z.string().optional(), i9AuthorizationEmployerSignRequestBody: I9AuthorizationEmployerSignRequestBody$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", xGustoClientIp: "x-gusto-client-ip", i9AuthorizationEmployerSignRequestBody: "I9-Authorization-Employer-Sign-Request-Body", }); }); export function putV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequestToJSON( putV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest: PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest, ): string { return JSON.stringify( PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest$outboundSchema .parse(putV1EmployeesEmployeeIdI9AuthorizationEmployerSignRequest), ); } /** @internal */ export const PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse$inboundSchema: z.ZodType< PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "I9-Authorization": I9Authorization$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "I9-Authorization": "i9Authorization", }); }); export function putV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponseFromJSON( jsonString: string, ): SafeParseResult< PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse, SDKValidationError > { return safeParse( jsonString, (x) => PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PutV1EmployeesEmployeeIdI9AuthorizationEmployerSignResponse' from JSON`, ); }