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