/* * 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 { ComputeAccelerator, ComputeAccelerator$inboundSchema, ComputeAccelerator$Outbound, ComputeAccelerator$outboundSchema, } from "./computeaccelerator.js"; export type ComputeAcceleratorList = { nextCursor: string | null; total: number; data: Array; }; /** @internal */ export const ComputeAcceleratorList$inboundSchema: z.ZodType< ComputeAcceleratorList, z.ZodTypeDef, unknown > = z.object({ next_cursor: z.nullable(z.string()), total: z.number().int(), data: z.array(ComputeAccelerator$inboundSchema), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", }); }); /** @internal */ export type ComputeAcceleratorList$Outbound = { next_cursor: string | null; total: number; data: Array; }; /** @internal */ export const ComputeAcceleratorList$outboundSchema: z.ZodType< ComputeAcceleratorList$Outbound, z.ZodTypeDef, ComputeAcceleratorList > = z.object({ nextCursor: z.nullable(z.string()), total: z.number().int(), data: z.array(ComputeAccelerator$outboundSchema), }).transform((v) => { return remap$(v, { nextCursor: "next_cursor", }); }); export function computeAcceleratorListToJSON( computeAcceleratorList: ComputeAcceleratorList, ): string { return JSON.stringify( ComputeAcceleratorList$outboundSchema.parse(computeAcceleratorList), ); } export function computeAcceleratorListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeAcceleratorList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeAcceleratorList' from JSON`, ); }