/* * 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 AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest = { /** * The account id. */ accountId: string; /** * 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 options include: * * @remarks * `state` * `start_date` * `end_date` */ filter?: string | undefined; /** * The maximum number of schedules to return. The service may return fewer than this value. If unspecified, at most 25 schedules will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. */ pageSize?: number | undefined; /** * The page token to request */ pageToken?: string | undefined; }; export type AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listAchWithdrawalSchedulesResponse?: | components.ListAchWithdrawalSchedulesResponse | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$inboundSchema: z.ZodType< AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), filter: z.string().optional(), page_size: z.number().int().optional(), page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$Outbound = { account_id: string; filter?: string | undefined; page_size?: number | undefined; page_token?: string | undefined; }; /** @internal */ export const AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$outboundSchema: z.ZodType< AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$Outbound, z.ZodTypeDef, AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest > = z.object({ accountId: z.string(), filter: z.string().optional(), pageSize: z.number().int().optional(), pageToken: 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 AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$ { /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$inboundSchema; /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$outboundSchema; /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$Outbound` instead. */ export type Outbound = AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$Outbound; } export function achWithdrawalSchedulesListAchWithdrawalSchedulesRequestToJSON( achWithdrawalSchedulesListAchWithdrawalSchedulesRequest: AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest, ): string { return JSON.stringify( AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$outboundSchema .parse(achWithdrawalSchedulesListAchWithdrawalSchedulesRequest), ); } export function achWithdrawalSchedulesListAchWithdrawalSchedulesRequestFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalSchedulesListAchWithdrawalSchedulesRequest' from JSON`, ); } /** @internal */ export const AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$inboundSchema: z.ZodType< AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListAchWithdrawalSchedulesResponse: components .ListAchWithdrawalSchedulesResponse$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListAchWithdrawalSchedulesResponse": "listAchWithdrawalSchedulesResponse", "Status": "status", }); }); /** @internal */ export type AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListAchWithdrawalSchedulesResponse?: | components.ListAchWithdrawalSchedulesResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$outboundSchema: z.ZodType< AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$Outbound, z.ZodTypeDef, AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listAchWithdrawalSchedulesResponse: components .ListAchWithdrawalSchedulesResponse$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listAchWithdrawalSchedulesResponse: "ListAchWithdrawalSchedulesResponse", 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 AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$ { /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$inboundSchema; /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$outboundSchema; /** @deprecated use `AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$Outbound` instead. */ export type Outbound = AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$Outbound; } export function achWithdrawalSchedulesListAchWithdrawalSchedulesResponseToJSON( achWithdrawalSchedulesListAchWithdrawalSchedulesResponse: AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse, ): string { return JSON.stringify( AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$outboundSchema .parse(achWithdrawalSchedulesListAchWithdrawalSchedulesResponse), ); } export function achWithdrawalSchedulesListAchWithdrawalSchedulesResponseFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalSchedulesListAchWithdrawalSchedulesResponse' from JSON`, ); }