/* * 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 { Admin, Admin$inboundSchema } from "../components/admin.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 GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion = { 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 GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion >; export type GetV1CompaniesCompanyIdAdminsRequest = { /** * 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?: | GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; /** * The page that is requested. When unspecified, will load all objects unless endpoint forces pagination. */ page?: number | undefined; /** * Number of objects per page. For majority of endpoints will default to 25 */ per?: number | undefined; }; export type GetV1CompaniesCompanyIdAdminsResponse = { httpMeta: HTTPMetadata; /** * Success */ admins?: Array | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z.nativeEnum(GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion); /** @internal */ export type GetV1CompaniesCompanyIdAdminsRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdAdminsRequest$outboundSchema: z.ZodType< GetV1CompaniesCompanyIdAdminsRequest$Outbound, z.ZodTypeDef, GetV1CompaniesCompanyIdAdminsRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesCompanyIdAdminsHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), companyId: z.string(), page: z.number().int().optional(), per: z.number().int().optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", }); }); export function getV1CompaniesCompanyIdAdminsRequestToJSON( getV1CompaniesCompanyIdAdminsRequest: GetV1CompaniesCompanyIdAdminsRequest, ): string { return JSON.stringify( GetV1CompaniesCompanyIdAdminsRequest$outboundSchema.parse( getV1CompaniesCompanyIdAdminsRequest, ), ); } /** @internal */ export const GetV1CompaniesCompanyIdAdminsResponse$inboundSchema: z.ZodType< GetV1CompaniesCompanyIdAdminsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, Admins: z.array(Admin$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Admins": "admins", }); }); export function getV1CompaniesCompanyIdAdminsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1CompaniesCompanyIdAdminsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1CompaniesCompanyIdAdminsResponse' from JSON`, ); }