/* * 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 GetApiV3DataCentersFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3DataCentersFormat = ClosedEnum< typeof GetApiV3DataCentersFormat >; export const GetApiV3DataCentersIncludeNodeType = { ApiBoundary: "API_BOUNDARY", Replica: "REPLICA", } as const; export type GetApiV3DataCentersIncludeNodeType = ClosedEnum< typeof GetApiV3DataCentersIncludeNodeType >; export type GetApiV3DataCentersRequest = { /** * Subnet ID */ subnet?: string | null | undefined; format?: GetApiV3DataCentersFormat | undefined; /** * Node Types */ includeNodeType?: Array | undefined; }; /** @internal */ export const GetApiV3DataCentersFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV3DataCentersFormat > = z.nativeEnum(GetApiV3DataCentersFormat); /** @internal */ export const GetApiV3DataCentersFormat$outboundSchema: z.ZodNativeEnum< typeof GetApiV3DataCentersFormat > = GetApiV3DataCentersFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3DataCentersFormat$ { /** @deprecated use `GetApiV3DataCentersFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3DataCentersFormat$inboundSchema; /** @deprecated use `GetApiV3DataCentersFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3DataCentersFormat$outboundSchema; } /** @internal */ export const GetApiV3DataCentersIncludeNodeType$inboundSchema: z.ZodNativeEnum< typeof GetApiV3DataCentersIncludeNodeType > = z.nativeEnum(GetApiV3DataCentersIncludeNodeType); /** @internal */ export const GetApiV3DataCentersIncludeNodeType$outboundSchema: z.ZodNativeEnum< typeof GetApiV3DataCentersIncludeNodeType > = GetApiV3DataCentersIncludeNodeType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3DataCentersIncludeNodeType$ { /** @deprecated use `GetApiV3DataCentersIncludeNodeType$inboundSchema` instead. */ export const inboundSchema = GetApiV3DataCentersIncludeNodeType$inboundSchema; /** @deprecated use `GetApiV3DataCentersIncludeNodeType$outboundSchema` instead. */ export const outboundSchema = GetApiV3DataCentersIncludeNodeType$outboundSchema; } /** @internal */ export const GetApiV3DataCentersRequest$inboundSchema: z.ZodType< GetApiV3DataCentersRequest, z.ZodTypeDef, unknown > = z.object({ subnet: z.nullable(z.string()).default(null), format: GetApiV3DataCentersFormat$inboundSchema.default("json"), include_node_type: z.array(GetApiV3DataCentersIncludeNodeType$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { "include_node_type": "includeNodeType", }); }); /** @internal */ export type GetApiV3DataCentersRequest$Outbound = { subnet: string | null; format: string; include_node_type?: Array | undefined; }; /** @internal */ export const GetApiV3DataCentersRequest$outboundSchema: z.ZodType< GetApiV3DataCentersRequest$Outbound, z.ZodTypeDef, GetApiV3DataCentersRequest > = z.object({ subnet: z.nullable(z.string()).default(null), format: GetApiV3DataCentersFormat$outboundSchema.default("json"), includeNodeType: z.array(GetApiV3DataCentersIncludeNodeType$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { 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 GetApiV3DataCentersRequest$ { /** @deprecated use `GetApiV3DataCentersRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3DataCentersRequest$inboundSchema; /** @deprecated use `GetApiV3DataCentersRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3DataCentersRequest$outboundSchema; /** @deprecated use `GetApiV3DataCentersRequest$Outbound` instead. */ export type Outbound = GetApiV3DataCentersRequest$Outbound; } export function getApiV3DataCentersRequestToJSON( getApiV3DataCentersRequest: GetApiV3DataCentersRequest, ): string { return JSON.stringify( GetApiV3DataCentersRequest$outboundSchema.parse(getApiV3DataCentersRequest), ); } export function getApiV3DataCentersRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3DataCentersRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3DataCentersRequest' from JSON`, ); }