/* * 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 LedgerGetActivityRequest = { /** * The account id. */ accountId: string; /** * The activity id. */ activityId: string; }; export type LedgerGetActivityResponse = { httpMeta: components.HTTPMetadata; /** * OK */ activity?: components.Activity | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const LedgerGetActivityRequest$inboundSchema: z.ZodType< LedgerGetActivityRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), activity_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "activity_id": "activityId", }); }); /** @internal */ export type LedgerGetActivityRequest$Outbound = { account_id: string; activity_id: string; }; /** @internal */ export const LedgerGetActivityRequest$outboundSchema: z.ZodType< LedgerGetActivityRequest$Outbound, z.ZodTypeDef, LedgerGetActivityRequest > = z.object({ accountId: z.string(), activityId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", activityId: "activity_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerGetActivityRequest$ { /** @deprecated use `LedgerGetActivityRequest$inboundSchema` instead. */ export const inboundSchema = LedgerGetActivityRequest$inboundSchema; /** @deprecated use `LedgerGetActivityRequest$outboundSchema` instead. */ export const outboundSchema = LedgerGetActivityRequest$outboundSchema; /** @deprecated use `LedgerGetActivityRequest$Outbound` instead. */ export type Outbound = LedgerGetActivityRequest$Outbound; } export function ledgerGetActivityRequestToJSON( ledgerGetActivityRequest: LedgerGetActivityRequest, ): string { return JSON.stringify( LedgerGetActivityRequest$outboundSchema.parse(ledgerGetActivityRequest), ); } export function ledgerGetActivityRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerGetActivityRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerGetActivityRequest' from JSON`, ); } /** @internal */ export const LedgerGetActivityResponse$inboundSchema: z.ZodType< LedgerGetActivityResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Activity: components.Activity$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Activity": "activity", "Status": "status", }); }); /** @internal */ export type LedgerGetActivityResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Activity?: components.Activity$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const LedgerGetActivityResponse$outboundSchema: z.ZodType< LedgerGetActivityResponse$Outbound, z.ZodTypeDef, LedgerGetActivityResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, activity: components.Activity$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", activity: "Activity", 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 LedgerGetActivityResponse$ { /** @deprecated use `LedgerGetActivityResponse$inboundSchema` instead. */ export const inboundSchema = LedgerGetActivityResponse$inboundSchema; /** @deprecated use `LedgerGetActivityResponse$outboundSchema` instead. */ export const outboundSchema = LedgerGetActivityResponse$outboundSchema; /** @deprecated use `LedgerGetActivityResponse$Outbound` instead. */ export type Outbound = LedgerGetActivityResponse$Outbound; } export function ledgerGetActivityResponseToJSON( ledgerGetActivityResponse: LedgerGetActivityResponse, ): string { return JSON.stringify( LedgerGetActivityResponse$outboundSchema.parse(ledgerGetActivityResponse), ); } export function ledgerGetActivityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerGetActivityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerGetActivityResponse' from JSON`, ); }