/* * 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 AccountTransfersListTransfersRequest = { /** * The correspondent id. */ correspondentId: string; /** * The account id. */ accountId: string; /** * The maximum number of transfers to return. The service may return fewer than this value. If unspecified, at most 100 transfers will be returned. The maximum value is 200; values above 200 will be coerced to 200. */ pageSize?: number | undefined; /** * A page token, received from a previous `ListTransfers` call. Provide this to retrieve the subsequent page. * * @remarks * * When paginating, all other parameters provided to `ListTransfers` must match the call that provided the page token. */ 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; * * @remarks * * Currently supported CEL filters: -------------------------------- * acat_control_number (add to queries for better performance) * state == State.* * nscc_status == NsccStatus.* * direction == Direction.* * transfer_type == TransferType.* * reject_code == RejectCode.* * create_time * last_nscc_status_updated_time * receiver.account_id * receiver.account_number * receiver.participant_number * receiver.correspondent_code * receiver.correspondent_id * deliverer.account_id * deliverer.account_number * deliverer.participant_number * deliverer.correspondent_code * deliverer.correspondent_id * * - Empty filters are allowed, which return the most recent page_size worth of transfers, in practice this is not performant and should be avoided if possible * * - Macros are NOT allowed, using them will result in an INVALID_ARGUMENT being returned * * - The following CEL operators are NOT allowed, using them will result in an INVALID_ARGUMENT being returned: string.matches(substr) + - / * * * - Queries using acat_control_number will result in increased performance */ filter?: string | undefined; }; export type AccountTransfersListTransfersResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listTransfersResponse?: components.ListTransfersResponse | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AccountTransfersListTransfersRequest$inboundSchema: z.ZodType< AccountTransfersListTransfersRequest, z.ZodTypeDef, unknown > = z.object({ correspondent_id: z.string(), account_id: z.string(), page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "correspondent_id": "correspondentId", "account_id": "accountId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type AccountTransfersListTransfersRequest$Outbound = { correspondent_id: string; account_id: string; page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const AccountTransfersListTransfersRequest$outboundSchema: z.ZodType< AccountTransfersListTransfersRequest$Outbound, z.ZodTypeDef, AccountTransfersListTransfersRequest > = z.object({ correspondentId: z.string(), accountId: z.string(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { correspondentId: "correspondent_id", 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 AccountTransfersListTransfersRequest$ { /** @deprecated use `AccountTransfersListTransfersRequest$inboundSchema` instead. */ export const inboundSchema = AccountTransfersListTransfersRequest$inboundSchema; /** @deprecated use `AccountTransfersListTransfersRequest$outboundSchema` instead. */ export const outboundSchema = AccountTransfersListTransfersRequest$outboundSchema; /** @deprecated use `AccountTransfersListTransfersRequest$Outbound` instead. */ export type Outbound = AccountTransfersListTransfersRequest$Outbound; } export function accountTransfersListTransfersRequestToJSON( accountTransfersListTransfersRequest: AccountTransfersListTransfersRequest, ): string { return JSON.stringify( AccountTransfersListTransfersRequest$outboundSchema.parse( accountTransfersListTransfersRequest, ), ); } export function accountTransfersListTransfersRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountTransfersListTransfersRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountTransfersListTransfersRequest' from JSON`, ); } /** @internal */ export const AccountTransfersListTransfersResponse$inboundSchema: z.ZodType< AccountTransfersListTransfersResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListTransfersResponse: components.ListTransfersResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListTransfersResponse": "listTransfersResponse", "Status": "status", }); }); /** @internal */ export type AccountTransfersListTransfersResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListTransfersResponse?: components.ListTransfersResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountTransfersListTransfersResponse$outboundSchema: z.ZodType< AccountTransfersListTransfersResponse$Outbound, z.ZodTypeDef, AccountTransfersListTransfersResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listTransfersResponse: components.ListTransfersResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listTransfersResponse: "ListTransfersResponse", 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 AccountTransfersListTransfersResponse$ { /** @deprecated use `AccountTransfersListTransfersResponse$inboundSchema` instead. */ export const inboundSchema = AccountTransfersListTransfersResponse$inboundSchema; /** @deprecated use `AccountTransfersListTransfersResponse$outboundSchema` instead. */ export const outboundSchema = AccountTransfersListTransfersResponse$outboundSchema; /** @deprecated use `AccountTransfersListTransfersResponse$Outbound` instead. */ export type Outbound = AccountTransfersListTransfersResponse$Outbound; } export function accountTransfersListTransfersResponseToJSON( accountTransfersListTransfersResponse: AccountTransfersListTransfersResponse, ): string { return JSON.stringify( AccountTransfersListTransfersResponse$outboundSchema.parse( accountTransfersListTransfersResponse, ), ); } export function accountTransfersListTransfersResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountTransfersListTransfersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountTransfersListTransfersResponse' from JSON`, ); }