/* * 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 LedgerListActivitiesRequest = { /** * The account id. */ accountId: string; /** * The maximum number of activities to return. The service may return fewer than this value Default is 100 (subject to change) The maximum is 1000, values exceeding this will be set to 1000 (subject to change) */ pageSize?: number | undefined; /** * A page token, received from a previous `ListActivity` call. Provide this to retrieve the subsequent page When paginating, all other parameters provided to `ListActivity` must match the call that provided the page token in order to maintain a stable result set */ pageToken?: string | undefined; /** * A CEL string to filter results; See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) page in Guides for more information; */ filter?: string | undefined; }; export type LedgerListActivitiesResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listActivitiesResponse?: components.ListActivitiesResponse | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const LedgerListActivitiesRequest$inboundSchema: z.ZodType< LedgerListActivitiesRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type LedgerListActivitiesRequest$Outbound = { account_id: string; page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const LedgerListActivitiesRequest$outboundSchema: z.ZodType< LedgerListActivitiesRequest$Outbound, z.ZodTypeDef, LedgerListActivitiesRequest > = z.object({ accountId: z.string(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { accountId: "account_id", pageSize: "page_size", pageToken: "page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerListActivitiesRequest$ { /** @deprecated use `LedgerListActivitiesRequest$inboundSchema` instead. */ export const inboundSchema = LedgerListActivitiesRequest$inboundSchema; /** @deprecated use `LedgerListActivitiesRequest$outboundSchema` instead. */ export const outboundSchema = LedgerListActivitiesRequest$outboundSchema; /** @deprecated use `LedgerListActivitiesRequest$Outbound` instead. */ export type Outbound = LedgerListActivitiesRequest$Outbound; } export function ledgerListActivitiesRequestToJSON( ledgerListActivitiesRequest: LedgerListActivitiesRequest, ): string { return JSON.stringify( LedgerListActivitiesRequest$outboundSchema.parse( ledgerListActivitiesRequest, ), ); } export function ledgerListActivitiesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerListActivitiesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerListActivitiesRequest' from JSON`, ); } /** @internal */ export const LedgerListActivitiesResponse$inboundSchema: z.ZodType< LedgerListActivitiesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListActivitiesResponse: components.ListActivitiesResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListActivitiesResponse": "listActivitiesResponse", "Status": "status", }); }); /** @internal */ export type LedgerListActivitiesResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListActivitiesResponse?: | components.ListActivitiesResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const LedgerListActivitiesResponse$outboundSchema: z.ZodType< LedgerListActivitiesResponse$Outbound, z.ZodTypeDef, LedgerListActivitiesResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listActivitiesResponse: components.ListActivitiesResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listActivitiesResponse: "ListActivitiesResponse", 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 LedgerListActivitiesResponse$ { /** @deprecated use `LedgerListActivitiesResponse$inboundSchema` instead. */ export const inboundSchema = LedgerListActivitiesResponse$inboundSchema; /** @deprecated use `LedgerListActivitiesResponse$outboundSchema` instead. */ export const outboundSchema = LedgerListActivitiesResponse$outboundSchema; /** @deprecated use `LedgerListActivitiesResponse$Outbound` instead. */ export type Outbound = LedgerListActivitiesResponse$Outbound; } export function ledgerListActivitiesResponseToJSON( ledgerListActivitiesResponse: LedgerListActivitiesResponse, ): string { return JSON.stringify( LedgerListActivitiesResponse$outboundSchema.parse( ledgerListActivitiesResponse, ), ); } export function ledgerListActivitiesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerListActivitiesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerListActivitiesResponse' from JSON`, ); }