/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LedgerGetEntryRequest = { /** * The account id. */ accountId: string; /** * The entry id. */ entryId: string; }; export type LedgerGetEntryResponse = { httpMeta: components.HTTPMetadata; /** * OK */ entry?: components.Entry | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const LedgerGetEntryRequest$inboundSchema: z.ZodType< LedgerGetEntryRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), entry_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "entry_id": "entryId", }); }); /** @internal */ export type LedgerGetEntryRequest$Outbound = { account_id: string; entry_id: string; }; /** @internal */ export const LedgerGetEntryRequest$outboundSchema: z.ZodType< LedgerGetEntryRequest$Outbound, z.ZodTypeDef, LedgerGetEntryRequest > = z.object({ accountId: z.string(), entryId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", entryId: "entry_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerGetEntryRequest$ { /** @deprecated use `LedgerGetEntryRequest$inboundSchema` instead. */ export const inboundSchema = LedgerGetEntryRequest$inboundSchema; /** @deprecated use `LedgerGetEntryRequest$outboundSchema` instead. */ export const outboundSchema = LedgerGetEntryRequest$outboundSchema; /** @deprecated use `LedgerGetEntryRequest$Outbound` instead. */ export type Outbound = LedgerGetEntryRequest$Outbound; } export function ledgerGetEntryRequestToJSON( ledgerGetEntryRequest: LedgerGetEntryRequest, ): string { return JSON.stringify( LedgerGetEntryRequest$outboundSchema.parse(ledgerGetEntryRequest), ); } export function ledgerGetEntryRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerGetEntryRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerGetEntryRequest' from JSON`, ); } /** @internal */ export const LedgerGetEntryResponse$inboundSchema: z.ZodType< LedgerGetEntryResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Entry: components.Entry$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Entry": "entry", "Status": "status", }); }); /** @internal */ export type LedgerGetEntryResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Entry?: components.Entry$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const LedgerGetEntryResponse$outboundSchema: z.ZodType< LedgerGetEntryResponse$Outbound, z.ZodTypeDef, LedgerGetEntryResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, entry: components.Entry$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", entry: "Entry", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerGetEntryResponse$ { /** @deprecated use `LedgerGetEntryResponse$inboundSchema` instead. */ export const inboundSchema = LedgerGetEntryResponse$inboundSchema; /** @deprecated use `LedgerGetEntryResponse$outboundSchema` instead. */ export const outboundSchema = LedgerGetEntryResponse$outboundSchema; /** @deprecated use `LedgerGetEntryResponse$Outbound` instead. */ export type Outbound = LedgerGetEntryResponse$Outbound; } export function ledgerGetEntryResponseToJSON( ledgerGetEntryResponse: LedgerGetEntryResponse, ): string { return JSON.stringify( LedgerGetEntryResponse$outboundSchema.parse(ledgerGetEntryResponse), ); } export function ledgerGetEntryResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerGetEntryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerGetEntryResponse' from JSON`, ); }