/* * 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"; export const GetApiV3NodeProvidersCountIncludeNodeType = { ApiBoundary: "API_BOUNDARY", Replica: "REPLICA", } as const; export type GetApiV3NodeProvidersCountIncludeNodeType = ClosedEnum< typeof GetApiV3NodeProvidersCountIncludeNodeType >; export type GetApiV3NodeProvidersCountRequest = { /** * Only Assigned Nodes */ onlyAssignedNodes?: boolean | undefined; /** * Node Types */ includeNodeType?: | Array | undefined; }; /** @internal */ export const GetApiV3NodeProvidersCountIncludeNodeType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3NodeProvidersCountIncludeNodeType); /** @internal */ export const GetApiV3NodeProvidersCountIncludeNodeType$outboundSchema: z.ZodNativeEnum = GetApiV3NodeProvidersCountIncludeNodeType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NodeProvidersCountIncludeNodeType$ { /** @deprecated use `GetApiV3NodeProvidersCountIncludeNodeType$inboundSchema` instead. */ export const inboundSchema = GetApiV3NodeProvidersCountIncludeNodeType$inboundSchema; /** @deprecated use `GetApiV3NodeProvidersCountIncludeNodeType$outboundSchema` instead. */ export const outboundSchema = GetApiV3NodeProvidersCountIncludeNodeType$outboundSchema; } /** @internal */ export const GetApiV3NodeProvidersCountRequest$inboundSchema: z.ZodType< GetApiV3NodeProvidersCountRequest, z.ZodTypeDef, unknown > = z.object({ only_assigned_nodes: z.boolean().default(false), include_node_type: z.array( GetApiV3NodeProvidersCountIncludeNodeType$inboundSchema, ).optional(), }).transform((v) => { return remap$(v, { "only_assigned_nodes": "onlyAssignedNodes", "include_node_type": "includeNodeType", }); }); /** @internal */ export type GetApiV3NodeProvidersCountRequest$Outbound = { only_assigned_nodes: boolean; include_node_type?: Array | undefined; }; /** @internal */ export const GetApiV3NodeProvidersCountRequest$outboundSchema: z.ZodType< GetApiV3NodeProvidersCountRequest$Outbound, z.ZodTypeDef, GetApiV3NodeProvidersCountRequest > = z.object({ onlyAssignedNodes: z.boolean().default(false), includeNodeType: z.array( GetApiV3NodeProvidersCountIncludeNodeType$outboundSchema, ).optional(), }).transform((v) => { return remap$(v, { onlyAssignedNodes: "only_assigned_nodes", includeNodeType: "include_node_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NodeProvidersCountRequest$ { /** @deprecated use `GetApiV3NodeProvidersCountRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3NodeProvidersCountRequest$inboundSchema; /** @deprecated use `GetApiV3NodeProvidersCountRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3NodeProvidersCountRequest$outboundSchema; /** @deprecated use `GetApiV3NodeProvidersCountRequest$Outbound` instead. */ export type Outbound = GetApiV3NodeProvidersCountRequest$Outbound; } export function getApiV3NodeProvidersCountRequestToJSON( getApiV3NodeProvidersCountRequest: GetApiV3NodeProvidersCountRequest, ): string { return JSON.stringify( GetApiV3NodeProvidersCountRequest$outboundSchema.parse( getApiV3NodeProvidersCountRequest, ), ); } export function getApiV3NodeProvidersCountRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3NodeProvidersCountRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3NodeProvidersCountRequest' from JSON`, ); }