/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Object returned when creating a partner managed company */ export type PartnerManagedCompany = { /** * Access token that can be used for OAuth access to the account. Access tokens expire 2 hours after they are issued. */ accessToken?: string | undefined; /** * Refresh token that can be exchanged for a new access token. */ refreshToken?: string | undefined; /** * Gusto's UUID for the company */ companyUuid?: string | undefined; /** * Time of access_token expiration in seconds */ expiresIn?: number | undefined; }; /** @internal */ export const PartnerManagedCompany$inboundSchema: z.ZodType< PartnerManagedCompany, z.ZodTypeDef, unknown > = z.object({ access_token: z.string().optional(), refresh_token: z.string().optional(), company_uuid: z.string().optional(), expires_in: z.number().int().optional(), }).transform((v) => { return remap$(v, { "access_token": "accessToken", "refresh_token": "refreshToken", "company_uuid": "companyUuid", "expires_in": "expiresIn", }); }); export function partnerManagedCompanyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartnerManagedCompany$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartnerManagedCompany' from JSON`, ); }