/* * 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 { Subnet, Subnet$inboundSchema, Subnet$Outbound, Subnet$outboundSchema, } from "./subnet.js"; export type ListSubnetsResponse = { /** * Subnets */ data?: Array | undefined; /** * Next Cursor */ nextCursor?: string | undefined; /** * Previous Cursor */ previousCursor?: string | undefined; }; /** @internal */ export const ListSubnetsResponse$inboundSchema: z.ZodType< ListSubnetsResponse, z.ZodTypeDef, unknown > = z.object({ data: z.array(Subnet$inboundSchema).optional(), next_cursor: z.string().optional(), previous_cursor: z.string().optional(), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", "previous_cursor": "previousCursor", }); }); /** @internal */ export type ListSubnetsResponse$Outbound = { data?: Array | undefined; next_cursor?: string | undefined; previous_cursor?: string | undefined; }; /** @internal */ export const ListSubnetsResponse$outboundSchema: z.ZodType< ListSubnetsResponse$Outbound, z.ZodTypeDef, ListSubnetsResponse > = z.object({ data: z.array(Subnet$outboundSchema).optional(), nextCursor: z.string().optional(), previousCursor: z.string().optional(), }).transform((v) => { return remap$(v, { nextCursor: "next_cursor", previousCursor: "previous_cursor", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListSubnetsResponse$ { /** @deprecated use `ListSubnetsResponse$inboundSchema` instead. */ export const inboundSchema = ListSubnetsResponse$inboundSchema; /** @deprecated use `ListSubnetsResponse$outboundSchema` instead. */ export const outboundSchema = ListSubnetsResponse$outboundSchema; /** @deprecated use `ListSubnetsResponse$Outbound` instead. */ export type Outbound = ListSubnetsResponse$Outbound; } export function listSubnetsResponseToJSON( listSubnetsResponse: ListSubnetsResponse, ): string { return JSON.stringify( ListSubnetsResponse$outboundSchema.parse(listSubnetsResponse), ); } export function listSubnetsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListSubnetsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListSubnetsResponse' from JSON`, ); }