/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 { ComputeTenant, ComputeTenant$inboundSchema, ComputeTenant$Outbound, ComputeTenant$outboundSchema, } from "./computetenant.js"; export type ComputeTenantList = { nextCursor: string | null; total: number; data: Array; }; /** @internal */ export const ComputeTenantList$inboundSchema: z.ZodType< ComputeTenantList, z.ZodTypeDef, unknown > = z.object({ next_cursor: z.nullable(z.string()), total: z.number().int(), data: z.array(ComputeTenant$inboundSchema), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", }); }); /** @internal */ export type ComputeTenantList$Outbound = { next_cursor: string | null; total: number; data: Array; }; /** @internal */ export const ComputeTenantList$outboundSchema: z.ZodType< ComputeTenantList$Outbound, z.ZodTypeDef, ComputeTenantList > = z.object({ nextCursor: z.nullable(z.string()), total: z.number().int(), data: z.array(ComputeTenant$outboundSchema), }).transform((v) => { return remap$(v, { nextCursor: "next_cursor", }); }); export function computeTenantListToJSON( computeTenantList: ComputeTenantList, ): string { return JSON.stringify( ComputeTenantList$outboundSchema.parse(computeTenantList), ); } export function computeTenantListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeTenantList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeTenantList' from JSON`, ); }