/* * 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 { PartnerManagedCompanyAcceptTermsOfServiceRequest, PartnerManagedCompanyAcceptTermsOfServiceRequest$Outbound, PartnerManagedCompanyAcceptTermsOfServiceRequest$outboundSchema, } from "../components/partnermanagedcompanyaccepttermsofservicerequest.js"; import { PartnerManagedCompanyTermsOfServiceResponse, PartnerManagedCompanyTermsOfServiceResponse$inboundSchema, } from "../components/partnermanagedcompanytermsofserviceresponse.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 PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion = { TwoThousandAndTwentySixMinus06Minus15: "2026-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 PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion = ClosedEnum< typeof PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion >; export type PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest = { /** * 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?: | PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; partnerManagedCompanyAcceptTermsOfServiceRequest: PartnerManagedCompanyAcceptTermsOfServiceRequest; }; export type PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse = { httpMeta: HTTPMetadata; /** * Example response */ partnerManagedCompanyTermsOfServiceResponse?: | PartnerManagedCompanyTermsOfServiceResponse | undefined; }; /** @internal */ export const PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion > = z.nativeEnum( PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion, ); /** @internal */ export type PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; "Partner-Managed-Company-Accept-Terms-Of-Service-Request": PartnerManagedCompanyAcceptTermsOfServiceRequest$Outbound; }; /** @internal */ export const PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest$outboundSchema: z.ZodType< PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest$Outbound, z.ZodTypeDef, PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest > = z.object({ xGustoAPIVersion: PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion$outboundSchema .default("2026-06-15"), companyUuid: z.string(), partnerManagedCompanyAcceptTermsOfServiceRequest: PartnerManagedCompanyAcceptTermsOfServiceRequest$outboundSchema, }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyUuid: "company_uuid", partnerManagedCompanyAcceptTermsOfServiceRequest: "Partner-Managed-Company-Accept-Terms-Of-Service-Request", }); }); export function postV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequestToJSON( postV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest: PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest, ): string { return JSON.stringify( PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest$outboundSchema .parse(postV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest), ); } /** @internal */ export const PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse$inboundSchema: z.ZodType< PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Partner-Managed-Company-Terms-Of-Service-Response": PartnerManagedCompanyTermsOfServiceResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Partner-Managed-Company-Terms-Of-Service-Response": "partnerManagedCompanyTermsOfServiceResponse", }); }); export function postV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PostV1PartnerManagedCompaniesCompanyUuidTermsOfServiceResponse' from JSON`, ); }