/* * 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 { RFCDate } from "../../types/rfcdate.js"; import { EmployeeWorkAddress, EmployeeWorkAddress$inboundSchema, } from "../components/employeeworkaddress.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 PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion = { 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 PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion = ClosedEnum< typeof PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion >; export type PostV1EmployeesEmployeeIdWorkAddressesRequestBody = { /** * Reference to a company location */ locationUuid?: string | undefined; /** * Date the employee began working at the company location */ effectiveDate?: RFCDate | undefined; }; export type PostV1EmployeesEmployeeIdWorkAddressesRequest = { /** * The UUID of the employee */ employeeId: string; /** * 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?: | PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion | undefined; requestBody: PostV1EmployeesEmployeeIdWorkAddressesRequestBody; }; export type PostV1EmployeesEmployeeIdWorkAddressesResponse = { httpMeta: HTTPMetadata; /** * created */ employeeWorkAddress?: EmployeeWorkAddress | undefined; }; /** @internal */ export const PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion > = z.nativeEnum( PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion, ); /** @internal */ export type PostV1EmployeesEmployeeIdWorkAddressesRequestBody$Outbound = { location_uuid?: string | undefined; effective_date?: string | undefined; }; /** @internal */ export const PostV1EmployeesEmployeeIdWorkAddressesRequestBody$outboundSchema: z.ZodType< PostV1EmployeesEmployeeIdWorkAddressesRequestBody$Outbound, z.ZodTypeDef, PostV1EmployeesEmployeeIdWorkAddressesRequestBody > = z.object({ locationUuid: z.string().optional(), effectiveDate: z.instanceof(RFCDate).transform(v => v.toString()) .optional(), }).transform((v) => { return remap$(v, { locationUuid: "location_uuid", effectiveDate: "effective_date", }); }); export function postV1EmployeesEmployeeIdWorkAddressesRequestBodyToJSON( postV1EmployeesEmployeeIdWorkAddressesRequestBody: PostV1EmployeesEmployeeIdWorkAddressesRequestBody, ): string { return JSON.stringify( PostV1EmployeesEmployeeIdWorkAddressesRequestBody$outboundSchema.parse( postV1EmployeesEmployeeIdWorkAddressesRequestBody, ), ); } /** @internal */ export type PostV1EmployeesEmployeeIdWorkAddressesRequest$Outbound = { employee_id: string; "X-Gusto-API-Version": string; RequestBody: PostV1EmployeesEmployeeIdWorkAddressesRequestBody$Outbound; }; /** @internal */ export const PostV1EmployeesEmployeeIdWorkAddressesRequest$outboundSchema: z.ZodType< PostV1EmployeesEmployeeIdWorkAddressesRequest$Outbound, z.ZodTypeDef, PostV1EmployeesEmployeeIdWorkAddressesRequest > = z.object({ employeeId: z.string(), xGustoAPIVersion: PostV1EmployeesEmployeeIdWorkAddressesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), requestBody: z.lazy(() => PostV1EmployeesEmployeeIdWorkAddressesRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { employeeId: "employee_id", xGustoAPIVersion: "X-Gusto-API-Version", requestBody: "RequestBody", }); }); export function postV1EmployeesEmployeeIdWorkAddressesRequestToJSON( postV1EmployeesEmployeeIdWorkAddressesRequest: PostV1EmployeesEmployeeIdWorkAddressesRequest, ): string { return JSON.stringify( PostV1EmployeesEmployeeIdWorkAddressesRequest$outboundSchema.parse( postV1EmployeesEmployeeIdWorkAddressesRequest, ), ); } /** @internal */ export const PostV1EmployeesEmployeeIdWorkAddressesResponse$inboundSchema: z.ZodType< PostV1EmployeesEmployeeIdWorkAddressesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Employee-Work-Address": EmployeeWorkAddress$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Employee-Work-Address": "employeeWorkAddress", }); }); export function postV1EmployeesEmployeeIdWorkAddressesResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1EmployeesEmployeeIdWorkAddressesResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1EmployeesEmployeeIdWorkAddressesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1EmployeesEmployeeIdWorkAddressesResponse' from JSON`, ); }