/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export const GetApiV4SubnetsCountSubnetSpecializationOrType = { European: "european", Fiduciary: "fiduciary", Application: "application", System: "system", } as const; export type GetApiV4SubnetsCountSubnetSpecializationOrType = ClosedEnum< typeof GetApiV4SubnetsCountSubnetSpecializationOrType >; export const GetApiV4SubnetsCountSubnetSpecialization = { European: "european", Fiduciary: "fiduciary", } as const; export type GetApiV4SubnetsCountSubnetSpecialization = ClosedEnum< typeof GetApiV4SubnetsCountSubnetSpecialization >; export const GetApiV4SubnetsCountFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV4SubnetsCountFormat = ClosedEnum< typeof GetApiV4SubnetsCountFormat >; export const GetApiV4SubnetsCountSubnetAuthorization = { Public: "public", AuthorizedOnly: "authorized_only", } as const; export type GetApiV4SubnetsCountSubnetAuthorization = ClosedEnum< typeof GetApiV4SubnetsCountSubnetAuthorization >; export const GetApiV4SubnetsCountSubnetType = { Application: "application", System: "system", VerifiedApplication: "verified_application", } as const; export type GetApiV4SubnetsCountSubnetType = ClosedEnum< typeof GetApiV4SubnetsCountSubnetType >; export type GetApiV4SubnetsCountRequest = { /** * Subnet Specialization or Type */ subnetSpecializationOrType?: | Array | undefined; /** * Subnet Specialization */ subnetSpecialization?: | Array | undefined; format?: GetApiV4SubnetsCountFormat | undefined; /** * Subnet Authorization */ subnetAuthorization?: | Array | undefined; /** * Subnet Type */ subnetType?: Array | undefined; /** * Data Center ID */ dcId?: string | null | undefined; }; export type GetApiV4SubnetsCountResponse = | models.ErrorT | models.CountSubnetsResponse; /** @internal */ export const GetApiV4SubnetsCountSubnetSpecializationOrType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV4SubnetsCountSubnetSpecializationOrType); /** @internal */ export const GetApiV4SubnetsCountSubnetSpecializationOrType$outboundSchema: z.ZodNativeEnum = GetApiV4SubnetsCountSubnetSpecializationOrType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountSubnetSpecializationOrType$ { /** @deprecated use `GetApiV4SubnetsCountSubnetSpecializationOrType$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountSubnetSpecializationOrType$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountSubnetSpecializationOrType$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountSubnetSpecializationOrType$outboundSchema; } /** @internal */ export const GetApiV4SubnetsCountSubnetSpecialization$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV4SubnetsCountSubnetSpecialization); /** @internal */ export const GetApiV4SubnetsCountSubnetSpecialization$outboundSchema: z.ZodNativeEnum = GetApiV4SubnetsCountSubnetSpecialization$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountSubnetSpecialization$ { /** @deprecated use `GetApiV4SubnetsCountSubnetSpecialization$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountSubnetSpecialization$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountSubnetSpecialization$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountSubnetSpecialization$outboundSchema; } /** @internal */ export const GetApiV4SubnetsCountFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV4SubnetsCountFormat > = z.nativeEnum(GetApiV4SubnetsCountFormat); /** @internal */ export const GetApiV4SubnetsCountFormat$outboundSchema: z.ZodNativeEnum< typeof GetApiV4SubnetsCountFormat > = GetApiV4SubnetsCountFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountFormat$ { /** @deprecated use `GetApiV4SubnetsCountFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountFormat$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountFormat$outboundSchema; } /** @internal */ export const GetApiV4SubnetsCountSubnetAuthorization$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV4SubnetsCountSubnetAuthorization); /** @internal */ export const GetApiV4SubnetsCountSubnetAuthorization$outboundSchema: z.ZodNativeEnum = GetApiV4SubnetsCountSubnetAuthorization$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountSubnetAuthorization$ { /** @deprecated use `GetApiV4SubnetsCountSubnetAuthorization$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountSubnetAuthorization$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountSubnetAuthorization$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountSubnetAuthorization$outboundSchema; } /** @internal */ export const GetApiV4SubnetsCountSubnetType$inboundSchema: z.ZodNativeEnum< typeof GetApiV4SubnetsCountSubnetType > = z.nativeEnum(GetApiV4SubnetsCountSubnetType); /** @internal */ export const GetApiV4SubnetsCountSubnetType$outboundSchema: z.ZodNativeEnum< typeof GetApiV4SubnetsCountSubnetType > = GetApiV4SubnetsCountSubnetType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountSubnetType$ { /** @deprecated use `GetApiV4SubnetsCountSubnetType$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountSubnetType$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountSubnetType$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountSubnetType$outboundSchema; } /** @internal */ export const GetApiV4SubnetsCountRequest$inboundSchema: z.ZodType< GetApiV4SubnetsCountRequest, z.ZodTypeDef, unknown > = z.object({ subnet_specialization_or_type: z.array( GetApiV4SubnetsCountSubnetSpecializationOrType$inboundSchema, ).optional(), subnet_specialization: z.array( GetApiV4SubnetsCountSubnetSpecialization$inboundSchema, ).optional(), format: GetApiV4SubnetsCountFormat$inboundSchema.default("json"), subnet_authorization: z.array( GetApiV4SubnetsCountSubnetAuthorization$inboundSchema, ).optional(), subnet_type: z.array(GetApiV4SubnetsCountSubnetType$inboundSchema).optional(), dc_id: z.nullable(z.string()).default(null), }).transform((v) => { return remap$(v, { "subnet_specialization_or_type": "subnetSpecializationOrType", "subnet_specialization": "subnetSpecialization", "subnet_authorization": "subnetAuthorization", "subnet_type": "subnetType", "dc_id": "dcId", }); }); /** @internal */ export type GetApiV4SubnetsCountRequest$Outbound = { subnet_specialization_or_type?: Array | undefined; subnet_specialization?: Array | undefined; format: string; subnet_authorization?: Array | undefined; subnet_type?: Array | undefined; dc_id: string | null; }; /** @internal */ export const GetApiV4SubnetsCountRequest$outboundSchema: z.ZodType< GetApiV4SubnetsCountRequest$Outbound, z.ZodTypeDef, GetApiV4SubnetsCountRequest > = z.object({ subnetSpecializationOrType: z.array( GetApiV4SubnetsCountSubnetSpecializationOrType$outboundSchema, ).optional(), subnetSpecialization: z.array( GetApiV4SubnetsCountSubnetSpecialization$outboundSchema, ).optional(), format: GetApiV4SubnetsCountFormat$outboundSchema.default("json"), subnetAuthorization: z.array( GetApiV4SubnetsCountSubnetAuthorization$outboundSchema, ).optional(), subnetType: z.array(GetApiV4SubnetsCountSubnetType$outboundSchema).optional(), dcId: z.nullable(z.string()).default(null), }).transform((v) => { return remap$(v, { subnetSpecializationOrType: "subnet_specialization_or_type", subnetSpecialization: "subnet_specialization", subnetAuthorization: "subnet_authorization", subnetType: "subnet_type", dcId: "dc_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountRequest$ { /** @deprecated use `GetApiV4SubnetsCountRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountRequest$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountRequest$outboundSchema; /** @deprecated use `GetApiV4SubnetsCountRequest$Outbound` instead. */ export type Outbound = GetApiV4SubnetsCountRequest$Outbound; } export function getApiV4SubnetsCountRequestToJSON( getApiV4SubnetsCountRequest: GetApiV4SubnetsCountRequest, ): string { return JSON.stringify( GetApiV4SubnetsCountRequest$outboundSchema.parse( getApiV4SubnetsCountRequest, ), ); } export function getApiV4SubnetsCountRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV4SubnetsCountRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV4SubnetsCountRequest' from JSON`, ); } /** @internal */ export const GetApiV4SubnetsCountResponse$inboundSchema: z.ZodType< GetApiV4SubnetsCountResponse, z.ZodTypeDef, unknown > = z.union([ models.ErrorT$inboundSchema, models.CountSubnetsResponse$inboundSchema, ]); /** @internal */ export type GetApiV4SubnetsCountResponse$Outbound = | models.ErrorT$Outbound | models.CountSubnetsResponse$Outbound; /** @internal */ export const GetApiV4SubnetsCountResponse$outboundSchema: z.ZodType< GetApiV4SubnetsCountResponse$Outbound, z.ZodTypeDef, GetApiV4SubnetsCountResponse > = z.union([ models.ErrorT$outboundSchema, models.CountSubnetsResponse$outboundSchema, ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsCountResponse$ { /** @deprecated use `GetApiV4SubnetsCountResponse$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsCountResponse$inboundSchema; /** @deprecated use `GetApiV4SubnetsCountResponse$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsCountResponse$outboundSchema; /** @deprecated use `GetApiV4SubnetsCountResponse$Outbound` instead. */ export type Outbound = GetApiV4SubnetsCountResponse$Outbound; } export function getApiV4SubnetsCountResponseToJSON( getApiV4SubnetsCountResponse: GetApiV4SubnetsCountResponse, ): string { return JSON.stringify( GetApiV4SubnetsCountResponse$outboundSchema.parse( getApiV4SubnetsCountResponse, ), ); } export function getApiV4SubnetsCountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV4SubnetsCountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV4SubnetsCountResponse' from JSON`, ); }