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