/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export type GetApiV4SubnetsSubnetIdRequest = { /** * Subnet ID */ subnetId: string; }; export type GetApiV4SubnetsSubnetIdResponse = models.ErrorT | models.Subnet; /** @internal */ export const GetApiV4SubnetsSubnetIdRequest$inboundSchema: z.ZodType< GetApiV4SubnetsSubnetIdRequest, z.ZodTypeDef, unknown > = z.object({ subnet_id: z.string(), }).transform((v) => { return remap$(v, { "subnet_id": "subnetId", }); }); /** @internal */ export type GetApiV4SubnetsSubnetIdRequest$Outbound = { subnet_id: string; }; /** @internal */ export const GetApiV4SubnetsSubnetIdRequest$outboundSchema: z.ZodType< GetApiV4SubnetsSubnetIdRequest$Outbound, z.ZodTypeDef, GetApiV4SubnetsSubnetIdRequest > = z.object({ subnetId: z.string(), }).transform((v) => { return remap$(v, { subnetId: "subnet_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsSubnetIdRequest$ { /** @deprecated use `GetApiV4SubnetsSubnetIdRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsSubnetIdRequest$inboundSchema; /** @deprecated use `GetApiV4SubnetsSubnetIdRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsSubnetIdRequest$outboundSchema; /** @deprecated use `GetApiV4SubnetsSubnetIdRequest$Outbound` instead. */ export type Outbound = GetApiV4SubnetsSubnetIdRequest$Outbound; } export function getApiV4SubnetsSubnetIdRequestToJSON( getApiV4SubnetsSubnetIdRequest: GetApiV4SubnetsSubnetIdRequest, ): string { return JSON.stringify( GetApiV4SubnetsSubnetIdRequest$outboundSchema.parse( getApiV4SubnetsSubnetIdRequest, ), ); } export function getApiV4SubnetsSubnetIdRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV4SubnetsSubnetIdRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV4SubnetsSubnetIdRequest' from JSON`, ); } /** @internal */ export const GetApiV4SubnetsSubnetIdResponse$inboundSchema: z.ZodType< GetApiV4SubnetsSubnetIdResponse, z.ZodTypeDef, unknown > = z.union([models.ErrorT$inboundSchema, models.Subnet$inboundSchema]); /** @internal */ export type GetApiV4SubnetsSubnetIdResponse$Outbound = | models.ErrorT$Outbound | models.Subnet$Outbound; /** @internal */ export const GetApiV4SubnetsSubnetIdResponse$outboundSchema: z.ZodType< GetApiV4SubnetsSubnetIdResponse$Outbound, z.ZodTypeDef, GetApiV4SubnetsSubnetIdResponse > = z.union([models.ErrorT$outboundSchema, models.Subnet$outboundSchema]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV4SubnetsSubnetIdResponse$ { /** @deprecated use `GetApiV4SubnetsSubnetIdResponse$inboundSchema` instead. */ export const inboundSchema = GetApiV4SubnetsSubnetIdResponse$inboundSchema; /** @deprecated use `GetApiV4SubnetsSubnetIdResponse$outboundSchema` instead. */ export const outboundSchema = GetApiV4SubnetsSubnetIdResponse$outboundSchema; /** @deprecated use `GetApiV4SubnetsSubnetIdResponse$Outbound` instead. */ export type Outbound = GetApiV4SubnetsSubnetIdResponse$Outbound; } export function getApiV4SubnetsSubnetIdResponseToJSON( getApiV4SubnetsSubnetIdResponse: GetApiV4SubnetsSubnetIdResponse, ): string { return JSON.stringify( GetApiV4SubnetsSubnetIdResponse$outboundSchema.parse( getApiV4SubnetsSubnetIdResponse, ), ); } export function getApiV4SubnetsSubnetIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV4SubnetsSubnetIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV4SubnetsSubnetIdResponse' from JSON`, ); }