/* * 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"; /** * The number of members users in the organization, split by role. */ export type ByRole = { /** * The number of users with the admin role. */ admin?: number | undefined; /** * The number of users with the API access role. */ apiAccess?: number | undefined; }; export type MemberCounts = { /** * The number of members users in the organization, split by role. */ byRole: ByRole; /** * The total number of members users in the organization. */ total: number; }; /** @internal */ export const ByRole$inboundSchema: z.ZodType = z .object({ admin: z.number().int().optional(), api_access: z.number().int().optional(), }).transform((v) => { return remap$(v, { "api_access": "apiAccess", }); }); export function byRoleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ByRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ByRole' from JSON`, ); } /** @internal */ export const MemberCounts$inboundSchema: z.ZodType< MemberCounts, z.ZodTypeDef, unknown > = z.object({ by_role: z.lazy(() => ByRole$inboundSchema), total: z.number().int(), }).transform((v) => { return remap$(v, { "by_role": "byRole", }); }); export function memberCountsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MemberCounts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MemberCounts' from JSON`, ); }