/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AchWithdrawalSchedule, AchWithdrawalSchedule$inboundSchema, AchWithdrawalSchedule$Outbound, AchWithdrawalSchedule$outboundSchema, } from "./achwithdrawalschedule.js"; /** * A paged response containing a list of ACH withdrawal transfer schedules */ export type ListAchWithdrawalSchedulesResponse = { /** * The list of transfer schedules */ achWithdrawalSchedules?: Array | undefined; /** * The next page token */ nextPageToken?: string | undefined; }; /** @internal */ export const ListAchWithdrawalSchedulesResponse$inboundSchema: z.ZodType< ListAchWithdrawalSchedulesResponse, z.ZodTypeDef, unknown > = z.object({ ach_withdrawal_schedules: z.array(AchWithdrawalSchedule$inboundSchema) .optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "ach_withdrawal_schedules": "achWithdrawalSchedules", "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListAchWithdrawalSchedulesResponse$Outbound = { ach_withdrawal_schedules?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListAchWithdrawalSchedulesResponse$outboundSchema: z.ZodType< ListAchWithdrawalSchedulesResponse$Outbound, z.ZodTypeDef, ListAchWithdrawalSchedulesResponse > = z.object({ achWithdrawalSchedules: z.array(AchWithdrawalSchedule$outboundSchema) .optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { achWithdrawalSchedules: "ach_withdrawal_schedules", nextPageToken: "next_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 ListAchWithdrawalSchedulesResponse$ { /** @deprecated use `ListAchWithdrawalSchedulesResponse$inboundSchema` instead. */ export const inboundSchema = ListAchWithdrawalSchedulesResponse$inboundSchema; /** @deprecated use `ListAchWithdrawalSchedulesResponse$outboundSchema` instead. */ export const outboundSchema = ListAchWithdrawalSchedulesResponse$outboundSchema; /** @deprecated use `ListAchWithdrawalSchedulesResponse$Outbound` instead. */ export type Outbound = ListAchWithdrawalSchedulesResponse$Outbound; } export function listAchWithdrawalSchedulesResponseToJSON( listAchWithdrawalSchedulesResponse: ListAchWithdrawalSchedulesResponse, ): string { return JSON.stringify( ListAchWithdrawalSchedulesResponse$outboundSchema.parse( listAchWithdrawalSchedulesResponse, ), ); } export function listAchWithdrawalSchedulesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListAchWithdrawalSchedulesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListAchWithdrawalSchedulesResponse' from JSON`, ); }