/* * 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { Transaction, Transaction$inboundSchema, Transaction$Outbound, Transaction$outboundSchema, } from "./transaction.js"; export type ListTransactionsResponseV2 = { data: Array; nextCursor?: string | undefined; previousCursor?: string | undefined; }; /** @internal */ export const ListTransactionsResponseV2$inboundSchema: z.ZodType< ListTransactionsResponseV2, z.ZodTypeDef, unknown > = z.object({ data: z.array(Transaction$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 ListTransactionsResponseV2$Outbound = { data: Array; next_cursor?: string | undefined; previous_cursor?: string | undefined; }; /** @internal */ export const ListTransactionsResponseV2$outboundSchema: z.ZodType< ListTransactionsResponseV2$Outbound, z.ZodTypeDef, ListTransactionsResponseV2 > = z.object({ data: z.array(Transaction$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 ListTransactionsResponseV2$ { /** @deprecated use `ListTransactionsResponseV2$inboundSchema` instead. */ export const inboundSchema = ListTransactionsResponseV2$inboundSchema; /** @deprecated use `ListTransactionsResponseV2$outboundSchema` instead. */ export const outboundSchema = ListTransactionsResponseV2$outboundSchema; /** @deprecated use `ListTransactionsResponseV2$Outbound` instead. */ export type Outbound = ListTransactionsResponseV2$Outbound; } export function listTransactionsResponseV2ToJSON( listTransactionsResponseV2: ListTransactionsResponseV2, ): string { return JSON.stringify( ListTransactionsResponseV2$outboundSchema.parse(listTransactionsResponseV2), ); } export function listTransactionsResponseV2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListTransactionsResponseV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListTransactionsResponseV2' from JSON`, ); }