/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Fixed USD amount to withhold for taxes. */ export type AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Percentage of total disbursement amount to withhold for taxes. */ export type AchWithdrawalSchedulePercentage = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The federal tax withholding. */ export type AchWithdrawalScheduleFederalTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: | AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: AchWithdrawalSchedulePercentage | null | undefined; }; /** * Fixed USD amount to withhold for taxes. */ export type AchWithdrawalScheduleIraDistributionAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Percentage of total disbursement amount to withhold for taxes. */ export type AchWithdrawalScheduleIraDistributionPercentage = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The state tax withholding. */ export type AchWithdrawalScheduleStateTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: AchWithdrawalScheduleIraDistributionAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: | AchWithdrawalScheduleIraDistributionPercentage | null | undefined; }; /** * The type of retirement distribution. */ export enum AchWithdrawalScheduleType { TypeUnspecified = "TYPE_UNSPECIFIED", Normal = "NORMAL", Disability = "DISABILITY", Sosepp = "SOSEPP", Premature = "PREMATURE", Death = "DEATH", ExcessContributionRemovalBeforeTaxDeadline = "EXCESS_CONTRIBUTION_REMOVAL_BEFORE_TAX_DEADLINE", ExcessContributionRemovalAfterTaxDeadline = "EXCESS_CONTRIBUTION_REMOVAL_AFTER_TAX_DEADLINE", RolloverToQualifiedPlan = "ROLLOVER_TO_QUALIFIED_PLAN", RolloverToIra = "ROLLOVER_TO_IRA", DistributionTransfer = "DISTRIBUTION_TRANSFER", RecharacterizationPriorYear = "RECHARACTERIZATION_PRIOR_YEAR", RecharacterizationCurrentYear = "RECHARACTERIZATION_CURRENT_YEAR", DistributionConversion = "DISTRIBUTION_CONVERSION", ManagementFee = "MANAGEMENT_FEE", PlanLoan401K = "PLAN_LOAN_401K", PrematureSimpleIraLessThan2Years = "PREMATURE_SIMPLE_IRA_LESS_THAN_2_YEARS", NormalRothIraGreaterThan5Years = "NORMAL_ROTH_IRA_GREATER_THAN_5_YEARS", NetIncomeAttributable = "NET_INCOME_ATTRIBUTABLE", Revocation = "REVOCATION", NonReportable = "NON_REPORTABLE", QualifiedCharitableDistribution = "QUALIFIED_CHARITABLE_DISTRIBUTION", } /** * The type of retirement distribution. */ export type AchWithdrawalScheduleTypeOpen = OpenEnum< typeof AchWithdrawalScheduleType >; /** * The ira distribution info for an IRA account */ export type IraDistribution = { /** * The federal tax withholding. */ federalTaxWithholding?: | AchWithdrawalScheduleFederalTaxWithholding | null | undefined; /** * The institution receiving retirement funds when performing a transfer to an identical retirement account type at a different financial institution. This is required for check and wire withdrawals because we can't always identify the institution using the transfer instructions. For cash journals this value will default to "Apex Clearing", regardless of what is passed in here */ receivingInstitution?: string | undefined; /** * The state tax withholding. */ stateTaxWithholding?: | AchWithdrawalScheduleStateTaxWithholding | null | undefined; /** * Whether or not this distribution has a state withholding waiver. */ stateWithholdingWaiver?: boolean | undefined; /** * Tax year for which the distribution is applied. */ taxYear?: number | undefined; /** * The type of retirement distribution. */ type?: AchWithdrawalScheduleTypeOpen | undefined; }; /** * A cash amount in the format of decimal value (mutually exclusive with 'full_disbursement') */ export type AchWithdrawalScheduleAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The schedule end date if there is a finite number of occurrences */ export type AchWithdrawalScheduleEndDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * The schedule start date */ export type AchWithdrawalScheduleStartDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * The state of the represented schedule */ export enum AchWithdrawalScheduleState { Active = "ACTIVE", Canceled = "CANCELED", Completed = "COMPLETED", } /** * The state of the represented schedule */ export type AchWithdrawalScheduleStateOpen = OpenEnum< typeof AchWithdrawalScheduleState >; /** * The time unit used to calculate the interval between transfers. The time period between transfers in a scheduled series is the unit of time times the multiplier */ export enum AchWithdrawalScheduleTimeUnit { Day = "DAY", Week = "WEEK", Month = "MONTH", } /** * The time unit used to calculate the interval between transfers. The time period between transfers in a scheduled series is the unit of time times the multiplier */ export type AchWithdrawalScheduleTimeUnitOpen = OpenEnum< typeof AchWithdrawalScheduleTimeUnit >; /** * Common schedule properties */ export type AchWithdrawalScheduleScheduleProperties = { /** * The schedule end date if there is a finite number of occurrences */ endDate?: AchWithdrawalScheduleEndDate | null | undefined; /** * The number of occurrences (empty or 0 indicates unlimited occurrences) */ occurrences?: number | undefined; /** * The schedule start date */ startDate?: AchWithdrawalScheduleStartDate | null | undefined; /** * The state of the represented schedule */ state?: AchWithdrawalScheduleStateOpen | undefined; /** * The time unit used to calculate the interval between transfers. The time period between transfers in a scheduled series is the unit of time times the multiplier */ timeUnit?: AchWithdrawalScheduleTimeUnitOpen | undefined; /** * The multiplier used to determine the length of the interval between transfers. The time period between transfers in a scheduled series is the unit of time times the multiplier */ unitMultiplier?: number | undefined; }; /** * The transfer schedule details */ export type AchWithdrawalScheduleScheduleDetails = { /** * A cash amount in the format of decimal value (mutually exclusive with 'full_disbursement') */ amount?: AchWithdrawalScheduleAmount | null | undefined; /** * External identifier supplied by the API caller. Each request must have a unique pairing of client_schedule_id and account */ clientScheduleId?: string | undefined; /** * Flag to indicate a full disbursement transfer (mutually exclusive with 'amount') */ fullDisbursement?: boolean | undefined; /** * Common schedule properties */ scheduleProperties?: | AchWithdrawalScheduleScheduleProperties | null | undefined; }; /** * A withdrawal transfer schedule using the ACH mechanism */ export type AchWithdrawalSchedule = { /** * The name of the bank relationship to be used in the ACH transaction */ bankRelationship?: string | undefined; /** * The ira distribution info for an IRA account */ iraDistribution?: IraDistribution | null | undefined; /** * The name of the ACH Withdrawal transfer schedule */ name?: string | undefined; /** * The transfer schedule details */ scheduleDetails?: AchWithdrawalScheduleScheduleDetails | null | undefined; }; /** @internal */ export const AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$inboundSchema: z.ZodType< AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$outboundSchema: z.ZodType< AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$Outbound, z.ZodTypeDef, AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$ { /** @deprecated use `AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$inboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$outboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$Outbound; } export function achWithdrawalScheduleIraDistributionFederalTaxWithholdingAmountToJSON( achWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount: AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount, ): string { return JSON.stringify( AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$outboundSchema .parse(achWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount), ); } export function achWithdrawalScheduleIraDistributionFederalTaxWithholdingAmountFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount' from JSON`, ); } /** @internal */ export const AchWithdrawalSchedulePercentage$inboundSchema: z.ZodType< AchWithdrawalSchedulePercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AchWithdrawalSchedulePercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const AchWithdrawalSchedulePercentage$outboundSchema: z.ZodType< AchWithdrawalSchedulePercentage$Outbound, z.ZodTypeDef, AchWithdrawalSchedulePercentage > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalSchedulePercentage$ { /** @deprecated use `AchWithdrawalSchedulePercentage$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedulePercentage$inboundSchema; /** @deprecated use `AchWithdrawalSchedulePercentage$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedulePercentage$outboundSchema; /** @deprecated use `AchWithdrawalSchedulePercentage$Outbound` instead. */ export type Outbound = AchWithdrawalSchedulePercentage$Outbound; } export function achWithdrawalSchedulePercentageToJSON( achWithdrawalSchedulePercentage: AchWithdrawalSchedulePercentage, ): string { return JSON.stringify( AchWithdrawalSchedulePercentage$outboundSchema.parse( achWithdrawalSchedulePercentage, ), ); } export function achWithdrawalSchedulePercentageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalSchedulePercentage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalSchedulePercentage' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleFederalTaxWithholding$inboundSchema: z.ZodType = z.object({ amount: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$inboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => AchWithdrawalSchedulePercentage$inboundSchema), ).optional(), }); /** @internal */ export type AchWithdrawalScheduleFederalTaxWithholding$Outbound = { amount?: | AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$Outbound | null | undefined; percentage?: AchWithdrawalSchedulePercentage$Outbound | null | undefined; }; /** @internal */ export const AchWithdrawalScheduleFederalTaxWithholding$outboundSchema: z.ZodType< AchWithdrawalScheduleFederalTaxWithholding$Outbound, z.ZodTypeDef, AchWithdrawalScheduleFederalTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionFederalTaxWithholdingAmount$outboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => AchWithdrawalSchedulePercentage$outboundSchema), ).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleFederalTaxWithholding$ { /** @deprecated use `AchWithdrawalScheduleFederalTaxWithholding$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleFederalTaxWithholding$inboundSchema; /** @deprecated use `AchWithdrawalScheduleFederalTaxWithholding$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleFederalTaxWithholding$outboundSchema; /** @deprecated use `AchWithdrawalScheduleFederalTaxWithholding$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleFederalTaxWithholding$Outbound; } export function achWithdrawalScheduleFederalTaxWithholdingToJSON( achWithdrawalScheduleFederalTaxWithholding: AchWithdrawalScheduleFederalTaxWithholding, ): string { return JSON.stringify( AchWithdrawalScheduleFederalTaxWithholding$outboundSchema.parse( achWithdrawalScheduleFederalTaxWithholding, ), ); } export function achWithdrawalScheduleFederalTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleFederalTaxWithholding, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleFederalTaxWithholding$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalScheduleFederalTaxWithholding' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleIraDistributionAmount$inboundSchema: z.ZodType = z.object({ value: z.string().optional(), }); /** @internal */ export type AchWithdrawalScheduleIraDistributionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AchWithdrawalScheduleIraDistributionAmount$outboundSchema: z.ZodType< AchWithdrawalScheduleIraDistributionAmount$Outbound, z.ZodTypeDef, AchWithdrawalScheduleIraDistributionAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleIraDistributionAmount$ { /** @deprecated use `AchWithdrawalScheduleIraDistributionAmount$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleIraDistributionAmount$inboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionAmount$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleIraDistributionAmount$outboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionAmount$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleIraDistributionAmount$Outbound; } export function achWithdrawalScheduleIraDistributionAmountToJSON( achWithdrawalScheduleIraDistributionAmount: AchWithdrawalScheduleIraDistributionAmount, ): string { return JSON.stringify( AchWithdrawalScheduleIraDistributionAmount$outboundSchema.parse( achWithdrawalScheduleIraDistributionAmount, ), ); } export function achWithdrawalScheduleIraDistributionAmountFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleIraDistributionAmount, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleIraDistributionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalScheduleIraDistributionAmount' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleIraDistributionPercentage$inboundSchema: z.ZodType< AchWithdrawalScheduleIraDistributionPercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AchWithdrawalScheduleIraDistributionPercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const AchWithdrawalScheduleIraDistributionPercentage$outboundSchema: z.ZodType< AchWithdrawalScheduleIraDistributionPercentage$Outbound, z.ZodTypeDef, AchWithdrawalScheduleIraDistributionPercentage > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleIraDistributionPercentage$ { /** @deprecated use `AchWithdrawalScheduleIraDistributionPercentage$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleIraDistributionPercentage$inboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionPercentage$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleIraDistributionPercentage$outboundSchema; /** @deprecated use `AchWithdrawalScheduleIraDistributionPercentage$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleIraDistributionPercentage$Outbound; } export function achWithdrawalScheduleIraDistributionPercentageToJSON( achWithdrawalScheduleIraDistributionPercentage: AchWithdrawalScheduleIraDistributionPercentage, ): string { return JSON.stringify( AchWithdrawalScheduleIraDistributionPercentage$outboundSchema.parse( achWithdrawalScheduleIraDistributionPercentage, ), ); } export function achWithdrawalScheduleIraDistributionPercentageFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleIraDistributionPercentage, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleIraDistributionPercentage$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalScheduleIraDistributionPercentage' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleStateTaxWithholding$inboundSchema: z.ZodType< AchWithdrawalScheduleStateTaxWithholding, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionAmount$inboundSchema), ).optional(), percentage: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionPercentage$inboundSchema), ).optional(), }); /** @internal */ export type AchWithdrawalScheduleStateTaxWithholding$Outbound = { amount?: | AchWithdrawalScheduleIraDistributionAmount$Outbound | null | undefined; percentage?: | AchWithdrawalScheduleIraDistributionPercentage$Outbound | null | undefined; }; /** @internal */ export const AchWithdrawalScheduleStateTaxWithholding$outboundSchema: z.ZodType< AchWithdrawalScheduleStateTaxWithholding$Outbound, z.ZodTypeDef, AchWithdrawalScheduleStateTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionAmount$outboundSchema), ).optional(), percentage: z.nullable( z.lazy(() => AchWithdrawalScheduleIraDistributionPercentage$outboundSchema), ).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleStateTaxWithholding$ { /** @deprecated use `AchWithdrawalScheduleStateTaxWithholding$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleStateTaxWithholding$inboundSchema; /** @deprecated use `AchWithdrawalScheduleStateTaxWithholding$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleStateTaxWithholding$outboundSchema; /** @deprecated use `AchWithdrawalScheduleStateTaxWithholding$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleStateTaxWithholding$Outbound; } export function achWithdrawalScheduleStateTaxWithholdingToJSON( achWithdrawalScheduleStateTaxWithholding: AchWithdrawalScheduleStateTaxWithholding, ): string { return JSON.stringify( AchWithdrawalScheduleStateTaxWithholding$outboundSchema.parse( achWithdrawalScheduleStateTaxWithholding, ), ); } export function achWithdrawalScheduleStateTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleStateTaxWithholding, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleStateTaxWithholding$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalScheduleStateTaxWithholding' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleType$inboundSchema: z.ZodType< AchWithdrawalScheduleTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AchWithdrawalScheduleType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AchWithdrawalScheduleType$outboundSchema: z.ZodType< AchWithdrawalScheduleTypeOpen, z.ZodTypeDef, AchWithdrawalScheduleTypeOpen > = z.union([ z.nativeEnum(AchWithdrawalScheduleType), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleType$ { /** @deprecated use `AchWithdrawalScheduleType$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleType$inboundSchema; /** @deprecated use `AchWithdrawalScheduleType$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleType$outboundSchema; } /** @internal */ export const IraDistribution$inboundSchema: z.ZodType< IraDistribution, z.ZodTypeDef, unknown > = z.object({ federal_tax_withholding: z.nullable( z.lazy(() => AchWithdrawalScheduleFederalTaxWithholding$inboundSchema), ).optional(), receiving_institution: z.string().optional(), state_tax_withholding: z.nullable( z.lazy(() => AchWithdrawalScheduleStateTaxWithholding$inboundSchema), ).optional(), state_withholding_waiver: z.boolean().optional(), tax_year: z.number().int().optional(), type: AchWithdrawalScheduleType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "federal_tax_withholding": "federalTaxWithholding", "receiving_institution": "receivingInstitution", "state_tax_withholding": "stateTaxWithholding", "state_withholding_waiver": "stateWithholdingWaiver", "tax_year": "taxYear", }); }); /** @internal */ export type IraDistribution$Outbound = { federal_tax_withholding?: | AchWithdrawalScheduleFederalTaxWithholding$Outbound | null | undefined; receiving_institution?: string | undefined; state_tax_withholding?: | AchWithdrawalScheduleStateTaxWithholding$Outbound | null | undefined; state_withholding_waiver?: boolean | undefined; tax_year?: number | undefined; type?: string | undefined; }; /** @internal */ export const IraDistribution$outboundSchema: z.ZodType< IraDistribution$Outbound, z.ZodTypeDef, IraDistribution > = z.object({ federalTaxWithholding: z.nullable( z.lazy(() => AchWithdrawalScheduleFederalTaxWithholding$outboundSchema), ).optional(), receivingInstitution: z.string().optional(), stateTaxWithholding: z.nullable( z.lazy(() => AchWithdrawalScheduleStateTaxWithholding$outboundSchema), ).optional(), stateWithholdingWaiver: z.boolean().optional(), taxYear: z.number().int().optional(), type: AchWithdrawalScheduleType$outboundSchema.optional(), }).transform((v) => { return remap$(v, { federalTaxWithholding: "federal_tax_withholding", receivingInstitution: "receiving_institution", stateTaxWithholding: "state_tax_withholding", stateWithholdingWaiver: "state_withholding_waiver", taxYear: "tax_year", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IraDistribution$ { /** @deprecated use `IraDistribution$inboundSchema` instead. */ export const inboundSchema = IraDistribution$inboundSchema; /** @deprecated use `IraDistribution$outboundSchema` instead. */ export const outboundSchema = IraDistribution$outboundSchema; /** @deprecated use `IraDistribution$Outbound` instead. */ export type Outbound = IraDistribution$Outbound; } export function iraDistributionToJSON( iraDistribution: IraDistribution, ): string { return JSON.stringify(IraDistribution$outboundSchema.parse(iraDistribution)); } export function iraDistributionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IraDistribution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IraDistribution' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleAmount$inboundSchema: z.ZodType< AchWithdrawalScheduleAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AchWithdrawalScheduleAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AchWithdrawalScheduleAmount$outboundSchema: z.ZodType< AchWithdrawalScheduleAmount$Outbound, z.ZodTypeDef, AchWithdrawalScheduleAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleAmount$ { /** @deprecated use `AchWithdrawalScheduleAmount$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleAmount$inboundSchema; /** @deprecated use `AchWithdrawalScheduleAmount$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleAmount$outboundSchema; /** @deprecated use `AchWithdrawalScheduleAmount$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleAmount$Outbound; } export function achWithdrawalScheduleAmountToJSON( achWithdrawalScheduleAmount: AchWithdrawalScheduleAmount, ): string { return JSON.stringify( AchWithdrawalScheduleAmount$outboundSchema.parse( achWithdrawalScheduleAmount, ), ); } export function achWithdrawalScheduleAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalScheduleAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalScheduleAmount' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleEndDate$inboundSchema: z.ZodType< AchWithdrawalScheduleEndDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type AchWithdrawalScheduleEndDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const AchWithdrawalScheduleEndDate$outboundSchema: z.ZodType< AchWithdrawalScheduleEndDate$Outbound, z.ZodTypeDef, AchWithdrawalScheduleEndDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleEndDate$ { /** @deprecated use `AchWithdrawalScheduleEndDate$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleEndDate$inboundSchema; /** @deprecated use `AchWithdrawalScheduleEndDate$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleEndDate$outboundSchema; /** @deprecated use `AchWithdrawalScheduleEndDate$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleEndDate$Outbound; } export function achWithdrawalScheduleEndDateToJSON( achWithdrawalScheduleEndDate: AchWithdrawalScheduleEndDate, ): string { return JSON.stringify( AchWithdrawalScheduleEndDate$outboundSchema.parse( achWithdrawalScheduleEndDate, ), ); } export function achWithdrawalScheduleEndDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalScheduleEndDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalScheduleEndDate' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleStartDate$inboundSchema: z.ZodType< AchWithdrawalScheduleStartDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type AchWithdrawalScheduleStartDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const AchWithdrawalScheduleStartDate$outboundSchema: z.ZodType< AchWithdrawalScheduleStartDate$Outbound, z.ZodTypeDef, AchWithdrawalScheduleStartDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleStartDate$ { /** @deprecated use `AchWithdrawalScheduleStartDate$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleStartDate$inboundSchema; /** @deprecated use `AchWithdrawalScheduleStartDate$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleStartDate$outboundSchema; /** @deprecated use `AchWithdrawalScheduleStartDate$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleStartDate$Outbound; } export function achWithdrawalScheduleStartDateToJSON( achWithdrawalScheduleStartDate: AchWithdrawalScheduleStartDate, ): string { return JSON.stringify( AchWithdrawalScheduleStartDate$outboundSchema.parse( achWithdrawalScheduleStartDate, ), ); } export function achWithdrawalScheduleStartDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalScheduleStartDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalScheduleStartDate' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleState$inboundSchema: z.ZodType< AchWithdrawalScheduleStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AchWithdrawalScheduleState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AchWithdrawalScheduleState$outboundSchema: z.ZodType< AchWithdrawalScheduleStateOpen, z.ZodTypeDef, AchWithdrawalScheduleStateOpen > = z.union([ z.nativeEnum(AchWithdrawalScheduleState), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleState$ { /** @deprecated use `AchWithdrawalScheduleState$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleState$inboundSchema; /** @deprecated use `AchWithdrawalScheduleState$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleState$outboundSchema; } /** @internal */ export const AchWithdrawalScheduleTimeUnit$inboundSchema: z.ZodType< AchWithdrawalScheduleTimeUnitOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AchWithdrawalScheduleTimeUnit), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AchWithdrawalScheduleTimeUnit$outboundSchema: z.ZodType< AchWithdrawalScheduleTimeUnitOpen, z.ZodTypeDef, AchWithdrawalScheduleTimeUnitOpen > = z.union([ z.nativeEnum(AchWithdrawalScheduleTimeUnit), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleTimeUnit$ { /** @deprecated use `AchWithdrawalScheduleTimeUnit$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleTimeUnit$inboundSchema; /** @deprecated use `AchWithdrawalScheduleTimeUnit$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleTimeUnit$outboundSchema; } /** @internal */ export const AchWithdrawalScheduleScheduleProperties$inboundSchema: z.ZodType< AchWithdrawalScheduleScheduleProperties, z.ZodTypeDef, unknown > = z.object({ end_date: z.nullable(z.lazy(() => AchWithdrawalScheduleEndDate$inboundSchema)) .optional(), occurrences: z.number().int().optional(), start_date: z.nullable( z.lazy(() => AchWithdrawalScheduleStartDate$inboundSchema), ).optional(), state: AchWithdrawalScheduleState$inboundSchema.optional(), time_unit: AchWithdrawalScheduleTimeUnit$inboundSchema.optional(), unit_multiplier: z.number().int().optional(), }).transform((v) => { return remap$(v, { "end_date": "endDate", "start_date": "startDate", "time_unit": "timeUnit", "unit_multiplier": "unitMultiplier", }); }); /** @internal */ export type AchWithdrawalScheduleScheduleProperties$Outbound = { end_date?: AchWithdrawalScheduleEndDate$Outbound | null | undefined; occurrences?: number | undefined; start_date?: AchWithdrawalScheduleStartDate$Outbound | null | undefined; state?: string | undefined; time_unit?: string | undefined; unit_multiplier?: number | undefined; }; /** @internal */ export const AchWithdrawalScheduleScheduleProperties$outboundSchema: z.ZodType< AchWithdrawalScheduleScheduleProperties$Outbound, z.ZodTypeDef, AchWithdrawalScheduleScheduleProperties > = z.object({ endDate: z.nullable(z.lazy(() => AchWithdrawalScheduleEndDate$outboundSchema)) .optional(), occurrences: z.number().int().optional(), startDate: z.nullable( z.lazy(() => AchWithdrawalScheduleStartDate$outboundSchema), ).optional(), state: AchWithdrawalScheduleState$outboundSchema.optional(), timeUnit: AchWithdrawalScheduleTimeUnit$outboundSchema.optional(), unitMultiplier: z.number().int().optional(), }).transform((v) => { return remap$(v, { endDate: "end_date", startDate: "start_date", timeUnit: "time_unit", unitMultiplier: "unit_multiplier", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleScheduleProperties$ { /** @deprecated use `AchWithdrawalScheduleScheduleProperties$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleScheduleProperties$inboundSchema; /** @deprecated use `AchWithdrawalScheduleScheduleProperties$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleScheduleProperties$outboundSchema; /** @deprecated use `AchWithdrawalScheduleScheduleProperties$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleScheduleProperties$Outbound; } export function achWithdrawalScheduleSchedulePropertiesToJSON( achWithdrawalScheduleScheduleProperties: AchWithdrawalScheduleScheduleProperties, ): string { return JSON.stringify( AchWithdrawalScheduleScheduleProperties$outboundSchema.parse( achWithdrawalScheduleScheduleProperties, ), ); } export function achWithdrawalScheduleSchedulePropertiesFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalScheduleScheduleProperties, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalScheduleScheduleProperties$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalScheduleScheduleProperties' from JSON`, ); } /** @internal */ export const AchWithdrawalScheduleScheduleDetails$inboundSchema: z.ZodType< AchWithdrawalScheduleScheduleDetails, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable(z.lazy(() => AchWithdrawalScheduleAmount$inboundSchema)) .optional(), client_schedule_id: z.string().optional(), full_disbursement: z.boolean().optional(), schedule_properties: z.nullable( z.lazy(() => AchWithdrawalScheduleScheduleProperties$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "client_schedule_id": "clientScheduleId", "full_disbursement": "fullDisbursement", "schedule_properties": "scheduleProperties", }); }); /** @internal */ export type AchWithdrawalScheduleScheduleDetails$Outbound = { amount?: AchWithdrawalScheduleAmount$Outbound | null | undefined; client_schedule_id?: string | undefined; full_disbursement?: boolean | undefined; schedule_properties?: | AchWithdrawalScheduleScheduleProperties$Outbound | null | undefined; }; /** @internal */ export const AchWithdrawalScheduleScheduleDetails$outboundSchema: z.ZodType< AchWithdrawalScheduleScheduleDetails$Outbound, z.ZodTypeDef, AchWithdrawalScheduleScheduleDetails > = z.object({ amount: z.nullable(z.lazy(() => AchWithdrawalScheduleAmount$outboundSchema)) .optional(), clientScheduleId: z.string().optional(), fullDisbursement: z.boolean().optional(), scheduleProperties: z.nullable( z.lazy(() => AchWithdrawalScheduleScheduleProperties$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { clientScheduleId: "client_schedule_id", fullDisbursement: "full_disbursement", scheduleProperties: "schedule_properties", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalScheduleScheduleDetails$ { /** @deprecated use `AchWithdrawalScheduleScheduleDetails$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalScheduleScheduleDetails$inboundSchema; /** @deprecated use `AchWithdrawalScheduleScheduleDetails$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalScheduleScheduleDetails$outboundSchema; /** @deprecated use `AchWithdrawalScheduleScheduleDetails$Outbound` instead. */ export type Outbound = AchWithdrawalScheduleScheduleDetails$Outbound; } export function achWithdrawalScheduleScheduleDetailsToJSON( achWithdrawalScheduleScheduleDetails: AchWithdrawalScheduleScheduleDetails, ): string { return JSON.stringify( AchWithdrawalScheduleScheduleDetails$outboundSchema.parse( achWithdrawalScheduleScheduleDetails, ), ); } export function achWithdrawalScheduleScheduleDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalScheduleScheduleDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalScheduleScheduleDetails' from JSON`, ); } /** @internal */ export const AchWithdrawalSchedule$inboundSchema: z.ZodType< AchWithdrawalSchedule, z.ZodTypeDef, unknown > = z.object({ bank_relationship: z.string().optional(), ira_distribution: z.nullable(z.lazy(() => IraDistribution$inboundSchema)) .optional(), name: z.string().optional(), schedule_details: z.nullable( z.lazy(() => AchWithdrawalScheduleScheduleDetails$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "bank_relationship": "bankRelationship", "ira_distribution": "iraDistribution", "schedule_details": "scheduleDetails", }); }); /** @internal */ export type AchWithdrawalSchedule$Outbound = { bank_relationship?: string | undefined; ira_distribution?: IraDistribution$Outbound | null | undefined; name?: string | undefined; schedule_details?: | AchWithdrawalScheduleScheduleDetails$Outbound | null | undefined; }; /** @internal */ export const AchWithdrawalSchedule$outboundSchema: z.ZodType< AchWithdrawalSchedule$Outbound, z.ZodTypeDef, AchWithdrawalSchedule > = z.object({ bankRelationship: z.string().optional(), iraDistribution: z.nullable(z.lazy(() => IraDistribution$outboundSchema)) .optional(), name: z.string().optional(), scheduleDetails: z.nullable( z.lazy(() => AchWithdrawalScheduleScheduleDetails$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { bankRelationship: "bank_relationship", iraDistribution: "ira_distribution", scheduleDetails: "schedule_details", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalSchedule$ { /** @deprecated use `AchWithdrawalSchedule$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedule$inboundSchema; /** @deprecated use `AchWithdrawalSchedule$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedule$outboundSchema; /** @deprecated use `AchWithdrawalSchedule$Outbound` instead. */ export type Outbound = AchWithdrawalSchedule$Outbound; } export function achWithdrawalScheduleToJSON( achWithdrawalSchedule: AchWithdrawalSchedule, ): string { return JSON.stringify( AchWithdrawalSchedule$outboundSchema.parse(achWithdrawalSchedule), ); } export function achWithdrawalScheduleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchWithdrawalSchedule$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalSchedule' from JSON`, ); }