/* * 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 { AppSchemasLedgersLedger, AppSchemasLedgersLedger$inboundSchema, AppSchemasLedgersLedger$Outbound, AppSchemasLedgersLedger$outboundSchema, } from "./appschemasledgersledger.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AppSchemasLedgersLedgerList = { data: Array; maxIndex: number; totalLedgers: number; }; /** @internal */ export const AppSchemasLedgersLedgerList$inboundSchema: z.ZodType< AppSchemasLedgersLedgerList, z.ZodTypeDef, unknown > = z.object({ data: z.array(AppSchemasLedgersLedger$inboundSchema), max_index: z.number().int(), total_ledgers: z.number().int(), }).transform((v) => { return remap$(v, { "max_index": "maxIndex", "total_ledgers": "totalLedgers", }); }); /** @internal */ export type AppSchemasLedgersLedgerList$Outbound = { data: Array; max_index: number; total_ledgers: number; }; /** @internal */ export const AppSchemasLedgersLedgerList$outboundSchema: z.ZodType< AppSchemasLedgersLedgerList$Outbound, z.ZodTypeDef, AppSchemasLedgersLedgerList > = z.object({ data: z.array(AppSchemasLedgersLedger$outboundSchema), maxIndex: z.number().int(), totalLedgers: z.number().int(), }).transform((v) => { return remap$(v, { maxIndex: "max_index", totalLedgers: "total_ledgers", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AppSchemasLedgersLedgerList$ { /** @deprecated use `AppSchemasLedgersLedgerList$inboundSchema` instead. */ export const inboundSchema = AppSchemasLedgersLedgerList$inboundSchema; /** @deprecated use `AppSchemasLedgersLedgerList$outboundSchema` instead. */ export const outboundSchema = AppSchemasLedgersLedgerList$outboundSchema; /** @deprecated use `AppSchemasLedgersLedgerList$Outbound` instead. */ export type Outbound = AppSchemasLedgersLedgerList$Outbound; } export function appSchemasLedgersLedgerListToJSON( appSchemasLedgersLedgerList: AppSchemasLedgersLedgerList, ): string { return JSON.stringify( AppSchemasLedgersLedgerList$outboundSchema.parse( appSchemasLedgersLedgerList, ), ); } export function appSchemasLedgersLedgerListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppSchemasLedgersLedgerList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppSchemasLedgersLedgerList' from JSON`, ); }