/* * 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 { AppSchemasV2LedgersLedger, AppSchemasV2LedgersLedger$inboundSchema, AppSchemasV2LedgersLedger$Outbound, AppSchemasV2LedgersLedger$outboundSchema, } from "./appschemasv2ledgersledger.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AppSchemasV2LedgersLedgerList = { data: Array; nextCursor?: string | undefined; previousCursor?: string | undefined; }; /** @internal */ export const AppSchemasV2LedgersLedgerList$inboundSchema: z.ZodType< AppSchemasV2LedgersLedgerList, z.ZodTypeDef, unknown > = z.object({ data: z.array(AppSchemasV2LedgersLedger$inboundSchema), next_cursor: z.string().optional(), previous_cursor: z.string().optional(), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", "previous_cursor": "previousCursor", }); }); /** @internal */ export type AppSchemasV2LedgersLedgerList$Outbound = { data: Array; next_cursor?: string | undefined; previous_cursor?: string | undefined; }; /** @internal */ export const AppSchemasV2LedgersLedgerList$outboundSchema: z.ZodType< AppSchemasV2LedgersLedgerList$Outbound, z.ZodTypeDef, AppSchemasV2LedgersLedgerList > = z.object({ data: z.array(AppSchemasV2LedgersLedger$outboundSchema), nextCursor: z.string().optional(), previousCursor: z.string().optional(), }).transform((v) => { return remap$(v, { nextCursor: "next_cursor", previousCursor: "previous_cursor", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AppSchemasV2LedgersLedgerList$ { /** @deprecated use `AppSchemasV2LedgersLedgerList$inboundSchema` instead. */ export const inboundSchema = AppSchemasV2LedgersLedgerList$inboundSchema; /** @deprecated use `AppSchemasV2LedgersLedgerList$outboundSchema` instead. */ export const outboundSchema = AppSchemasV2LedgersLedgerList$outboundSchema; /** @deprecated use `AppSchemasV2LedgersLedgerList$Outbound` instead. */ export type Outbound = AppSchemasV2LedgersLedgerList$Outbound; } export function appSchemasV2LedgersLedgerListToJSON( appSchemasV2LedgersLedgerList: AppSchemasV2LedgersLedgerList, ): string { return JSON.stringify( AppSchemasV2LedgersLedgerList$outboundSchema.parse( appSchemasV2LedgersLedgerList, ), ); } export function appSchemasV2LedgersLedgerListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppSchemasV2LedgersLedgerList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppSchemasV2LedgersLedgerList' from JSON`, ); }