/* * 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 { CompanyLocationRequest, CompanyLocationRequest$Outbound, CompanyLocationRequest$outboundSchema, } from "../components/companylocationrequest.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { Location, Location$inboundSchema } from "../components/location.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 PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion = { 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 PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion = ClosedEnum; export type PostV1CompaniesCompanyIdLocationsRequest = { /** * 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?: | PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; companyLocationRequest: CompanyLocationRequest; }; export type PostV1CompaniesCompanyIdLocationsResponse = { httpMeta: HTTPMetadata; /** * Created */ location?: Location | undefined; }; /** @internal */ export const PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion > = z.nativeEnum(PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion); /** @internal */ export type PostV1CompaniesCompanyIdLocationsRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; "Company-Location-Request": CompanyLocationRequest$Outbound; }; /** @internal */ export const PostV1CompaniesCompanyIdLocationsRequest$outboundSchema: z.ZodType< PostV1CompaniesCompanyIdLocationsRequest$Outbound, z.ZodTypeDef, PostV1CompaniesCompanyIdLocationsRequest > = z.object({ xGustoAPIVersion: PostV1CompaniesCompanyIdLocationsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), companyLocationRequest: CompanyLocationRequest$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", companyLocationRequest: "Company-Location-Request", }); }); export function postV1CompaniesCompanyIdLocationsRequestToJSON( postV1CompaniesCompanyIdLocationsRequest: PostV1CompaniesCompanyIdLocationsRequest, ): string { return JSON.stringify( PostV1CompaniesCompanyIdLocationsRequest$outboundSchema.parse( postV1CompaniesCompanyIdLocationsRequest, ), ); } /** @internal */ export const PostV1CompaniesCompanyIdLocationsResponse$inboundSchema: z.ZodType< PostV1CompaniesCompanyIdLocationsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Location: Location$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Location": "location", }); }); export function postV1CompaniesCompanyIdLocationsResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1CompaniesCompanyIdLocationsResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1CompaniesCompanyIdLocationsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1CompaniesCompanyIdLocationsResponse' from JSON`, ); }