/* * 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 GetApiV3SubnetsFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3SubnetsFormat = ClosedEnum; export type GetApiV3SubnetsRequest = { /** * Data Center ID */ dcId?: string | null | undefined; format?: GetApiV3SubnetsFormat | undefined; }; /** @internal */ export const GetApiV3SubnetsFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV3SubnetsFormat > = z.nativeEnum(GetApiV3SubnetsFormat); /** @internal */ export const GetApiV3SubnetsFormat$outboundSchema: z.ZodNativeEnum< typeof GetApiV3SubnetsFormat > = GetApiV3SubnetsFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3SubnetsFormat$ { /** @deprecated use `GetApiV3SubnetsFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3SubnetsFormat$inboundSchema; /** @deprecated use `GetApiV3SubnetsFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3SubnetsFormat$outboundSchema; } /** @internal */ export const GetApiV3SubnetsRequest$inboundSchema: z.ZodType< GetApiV3SubnetsRequest, z.ZodTypeDef, unknown > = z.object({ dc_id: z.nullable(z.string()).default(null), format: GetApiV3SubnetsFormat$inboundSchema.default("json"), }).transform((v) => { return remap$(v, { "dc_id": "dcId", }); }); /** @internal */ export type GetApiV3SubnetsRequest$Outbound = { dc_id: string | null; format: string; }; /** @internal */ export const GetApiV3SubnetsRequest$outboundSchema: z.ZodType< GetApiV3SubnetsRequest$Outbound, z.ZodTypeDef, GetApiV3SubnetsRequest > = z.object({ dcId: z.nullable(z.string()).default(null), format: GetApiV3SubnetsFormat$outboundSchema.default("json"), }).transform((v) => { return remap$(v, { 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 GetApiV3SubnetsRequest$ { /** @deprecated use `GetApiV3SubnetsRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3SubnetsRequest$inboundSchema; /** @deprecated use `GetApiV3SubnetsRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3SubnetsRequest$outboundSchema; /** @deprecated use `GetApiV3SubnetsRequest$Outbound` instead. */ export type Outbound = GetApiV3SubnetsRequest$Outbound; } export function getApiV3SubnetsRequestToJSON( getApiV3SubnetsRequest: GetApiV3SubnetsRequest, ): string { return JSON.stringify( GetApiV3SubnetsRequest$outboundSchema.parse(getApiV3SubnetsRequest), ); } export function getApiV3SubnetsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3SubnetsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3SubnetsRequest' from JSON`, ); }