/* * 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"; /** * The address of the person or entity taking receipt of the wired funds. This will be populated automatically in the case of a valid first-party wire */ export type WireWithdrawalScheduleAddress = { /** * Required: Describes the city in which the entity is located. */ city?: string | undefined; /** * Required: The country code used for geolocation, identity verification, and/or mail delivery purposes. */ country?: string | undefined; /** * Required: The postal code used for geolocation, identity verification, and/or mail delivery purposes. */ postalCode?: string | undefined; /** * Required: The state code used for geolocation, identity verification, and/or mail delivery purposes. */ state?: string | undefined; /** * The street name and number relating to a party's legal or mailing address. */ streetAddress?: Array | undefined; }; /** * The beneficiary of the wire withdrawal */ export type WireWithdrawalScheduleBeneficiary = { /** * The bank account of the person or entity taking receipt of the wired funds. Limited to 25 characters if intermediaryDetails.account is set */ account?: string | undefined; /** * The name of the person or entity taking receipt of the wired funds. This field defaults to the name of the account owner and should only be populated when performing a third party wire transfer */ accountTitle?: string | undefined; /** * The address of the person or entity taking receipt of the wired funds. This will be populated automatically in the case of a valid first-party wire */ address?: WireWithdrawalScheduleAddress | null | undefined; /** * Indicates if this beneficiary is a third party beneficiary. A wire transfer is considered third party if the beneficiary is not the exact same person and/or entity that the funds originated from. This includes wire transfers where the originator account is an individual account and the beneficiary account is a joint account */ thirdParty?: boolean | undefined; }; /** * The address of the intermediary party */ export type WireWithdrawalScheduleIntermediaryAddress = { /** * Required: Describes the city in which the entity is located. */ city?: string | undefined; /** * Required: The country code used for geolocation, identity verification, and/or mail delivery purposes. */ country?: string | undefined; /** * Required: The postal code used for geolocation, identity verification, and/or mail delivery purposes. */ postalCode?: string | undefined; /** * Required: The state code used for geolocation, identity verification, and/or mail delivery purposes. */ state?: string | undefined; /** * The street name and number relating to a party's legal or mailing address. */ streetAddress?: Array | undefined; }; /** * The intermediary party */ export type Intermediary = { /** * The account number of the intermediary party */ account?: string | undefined; /** * The name of the intermediary party */ accountTitle?: string | undefined; /** * The address of the intermediary party */ address?: WireWithdrawalScheduleIntermediaryAddress | null | undefined; }; /** * The type of bank identifier specified */ export enum WireWithdrawalScheduleRecipientBankType { TypeUnspecified = "TYPE_UNSPECIFIED", Aba = "ABA", Bic = "BIC", } /** * The type of bank identifier specified */ export type WireWithdrawalScheduleRecipientBankTypeOpen = OpenEnum< typeof WireWithdrawalScheduleRecipientBankType >; /** * An identifier that represents ABA routing number for domestic wire or BIC for foreign wire */ export type BankId = { /** * The bank identifier */ id?: string | undefined; /** * The type of bank identifier specified */ type?: WireWithdrawalScheduleRecipientBankTypeOpen | undefined; }; /** * The address of the recipient bank / financial institution */ export type WireWithdrawalScheduleRecipientBankAddress = { /** * Required: Describes the city in which the entity is located. */ city?: string | undefined; /** * Required: The country code used for geolocation, identity verification, and/or mail delivery purposes. */ country?: string | undefined; /** * Required: The postal code used for geolocation, identity verification, and/or mail delivery purposes. */ postalCode?: string | undefined; /** * Required: The state code used for geolocation, identity verification, and/or mail delivery purposes. */ state?: string | undefined; /** * The street name and number relating to a party's legal or mailing address. */ streetAddress?: Array | undefined; }; /** * Bank details required in the case of an international wire transfer */ export type InternationalBankDetails = { /** * Any additional information to be communicated to the recipient bank, such as intermediary banks to be used. */ additionalInfo?: string | undefined; /** * The address of the recipient bank / financial institution */ address?: WireWithdrawalScheduleRecipientBankAddress | null | undefined; /** * The name of the recipient bank / financial institution */ bankName?: string | undefined; }; /** * The recipient bank / financial institution */ export type RecipientBank = { /** * An identifier that represents ABA routing number for domestic wire or BIC for foreign wire */ bankId?: BankId | null | undefined; /** * Bank details required in the case of an international wire transfer */ internationalBankDetails?: InternationalBankDetails | null | undefined; }; /** * Fixed USD amount to withhold for taxes. */ export type WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount = { /** * 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 WireWithdrawalSchedulePercentage = { /** * 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 WireWithdrawalScheduleFederalTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: | WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: WireWithdrawalSchedulePercentage | null | undefined; }; /** * Fixed USD amount to withhold for taxes. */ export type WireWithdrawalScheduleRetirementDistributionAmount = { /** * 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 WireWithdrawalScheduleRetirementDistributionPercentage = { /** * 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 WireWithdrawalScheduleStateTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: | WireWithdrawalScheduleRetirementDistributionAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: | WireWithdrawalScheduleRetirementDistributionPercentage | null | undefined; }; /** * The type of retirement distribution. */ export enum WireWithdrawalScheduleType { 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 WireWithdrawalScheduleTypeOpen = OpenEnum< typeof WireWithdrawalScheduleType >; /** * The distribution info for a retirement account */ export type WireWithdrawalScheduleRetirementDistribution = { /** * The federal tax withholding. */ federalTaxWithholding?: | WireWithdrawalScheduleFederalTaxWithholding | 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?: | WireWithdrawalScheduleStateTaxWithholding | 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?: WireWithdrawalScheduleTypeOpen | undefined; }; /** * A cash amount in the format of decimal value (mutually exclusive with 'full_disbursement') */ export type WireWithdrawalScheduleAmount = { /** * 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 WireWithdrawalScheduleEndDate = { /** * 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 WireWithdrawalScheduleStartDate = { /** * 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 WireWithdrawalScheduleState { Active = "ACTIVE", Canceled = "CANCELED", Completed = "COMPLETED", } /** * The state of the represented schedule */ export type WireWithdrawalScheduleStateOpen = OpenEnum< typeof WireWithdrawalScheduleState >; /** * 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 WireWithdrawalScheduleTimeUnit { 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 WireWithdrawalScheduleTimeUnitOpen = OpenEnum< typeof WireWithdrawalScheduleTimeUnit >; /** * Common schedule properties */ export type WireWithdrawalScheduleScheduleProperties = { /** * The schedule end date if there is a finite number of occurrences */ endDate?: WireWithdrawalScheduleEndDate | null | undefined; /** * The number of occurrences (empty or 0 indicates unlimited occurrences) */ occurrences?: number | undefined; /** * The schedule start date */ startDate?: WireWithdrawalScheduleStartDate | null | undefined; /** * The state of the represented schedule */ state?: WireWithdrawalScheduleStateOpen | 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?: WireWithdrawalScheduleTimeUnitOpen | 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 WireWithdrawalScheduleScheduleDetails = { /** * A cash amount in the format of decimal value (mutually exclusive with 'full_disbursement') */ amount?: WireWithdrawalScheduleAmount | 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?: | WireWithdrawalScheduleScheduleProperties | null | undefined; }; /** * A withdrawal transfer schedule using the Wire mechanism */ export type WireWithdrawalSchedule = { /** * The beneficiary of the wire withdrawal */ beneficiary?: WireWithdrawalScheduleBeneficiary | null | undefined; /** * The intermediary party */ intermediary?: Intermediary | null | undefined; /** * The name of the Wire Withdrawal transfer schedule */ name?: string | undefined; /** * The recipient bank / financial institution */ recipientBank?: RecipientBank | null | undefined; /** * The distribution info for a retirement account */ retirementDistribution?: | WireWithdrawalScheduleRetirementDistribution | null | undefined; /** * The transfer schedule details */ scheduleDetails?: WireWithdrawalScheduleScheduleDetails | null | undefined; }; /** @internal */ export const WireWithdrawalScheduleAddress$inboundSchema: z.ZodType< WireWithdrawalScheduleAddress, z.ZodTypeDef, unknown > = z.object({ city: z.string().optional(), country: z.string().optional(), postal_code: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "postal_code": "postalCode", }); }); /** @internal */ export type WireWithdrawalScheduleAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalScheduleAddress$outboundSchema: z.ZodType< WireWithdrawalScheduleAddress$Outbound, z.ZodTypeDef, WireWithdrawalScheduleAddress > = z.object({ city: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { postalCode: "postal_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalScheduleAddress$ { /** @deprecated use `WireWithdrawalScheduleAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleAddress$inboundSchema; /** @deprecated use `WireWithdrawalScheduleAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleAddress$outboundSchema; /** @deprecated use `WireWithdrawalScheduleAddress$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleAddress$Outbound; } export function wireWithdrawalScheduleAddressToJSON( wireWithdrawalScheduleAddress: WireWithdrawalScheduleAddress, ): string { return JSON.stringify( WireWithdrawalScheduleAddress$outboundSchema.parse( wireWithdrawalScheduleAddress, ), ); } export function wireWithdrawalScheduleAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleAddress' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleBeneficiary$inboundSchema: z.ZodType< WireWithdrawalScheduleBeneficiary, z.ZodTypeDef, unknown > = z.object({ account: z.string().optional(), account_title: z.string().optional(), address: z.nullable(z.lazy(() => WireWithdrawalScheduleAddress$inboundSchema)) .optional(), third_party: z.boolean().optional(), }).transform((v) => { return remap$(v, { "account_title": "accountTitle", "third_party": "thirdParty", }); }); /** @internal */ export type WireWithdrawalScheduleBeneficiary$Outbound = { account?: string | undefined; account_title?: string | undefined; address?: WireWithdrawalScheduleAddress$Outbound | null | undefined; third_party?: boolean | undefined; }; /** @internal */ export const WireWithdrawalScheduleBeneficiary$outboundSchema: z.ZodType< WireWithdrawalScheduleBeneficiary$Outbound, z.ZodTypeDef, WireWithdrawalScheduleBeneficiary > = z.object({ account: z.string().optional(), accountTitle: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalScheduleAddress$outboundSchema), ).optional(), thirdParty: z.boolean().optional(), }).transform((v) => { return remap$(v, { accountTitle: "account_title", thirdParty: "third_party", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalScheduleBeneficiary$ { /** @deprecated use `WireWithdrawalScheduleBeneficiary$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleBeneficiary$inboundSchema; /** @deprecated use `WireWithdrawalScheduleBeneficiary$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleBeneficiary$outboundSchema; /** @deprecated use `WireWithdrawalScheduleBeneficiary$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleBeneficiary$Outbound; } export function wireWithdrawalScheduleBeneficiaryToJSON( wireWithdrawalScheduleBeneficiary: WireWithdrawalScheduleBeneficiary, ): string { return JSON.stringify( WireWithdrawalScheduleBeneficiary$outboundSchema.parse( wireWithdrawalScheduleBeneficiary, ), ); } export function wireWithdrawalScheduleBeneficiaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleBeneficiary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleBeneficiary' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleIntermediaryAddress$inboundSchema: z.ZodType< WireWithdrawalScheduleIntermediaryAddress, z.ZodTypeDef, unknown > = z.object({ city: z.string().optional(), country: z.string().optional(), postal_code: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "postal_code": "postalCode", }); }); /** @internal */ export type WireWithdrawalScheduleIntermediaryAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalScheduleIntermediaryAddress$outboundSchema: z.ZodType< WireWithdrawalScheduleIntermediaryAddress$Outbound, z.ZodTypeDef, WireWithdrawalScheduleIntermediaryAddress > = z.object({ city: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { postalCode: "postal_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalScheduleIntermediaryAddress$ { /** @deprecated use `WireWithdrawalScheduleIntermediaryAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleIntermediaryAddress$inboundSchema; /** @deprecated use `WireWithdrawalScheduleIntermediaryAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleIntermediaryAddress$outboundSchema; /** @deprecated use `WireWithdrawalScheduleIntermediaryAddress$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleIntermediaryAddress$Outbound; } export function wireWithdrawalScheduleIntermediaryAddressToJSON( wireWithdrawalScheduleIntermediaryAddress: WireWithdrawalScheduleIntermediaryAddress, ): string { return JSON.stringify( WireWithdrawalScheduleIntermediaryAddress$outboundSchema.parse( wireWithdrawalScheduleIntermediaryAddress, ), ); } export function wireWithdrawalScheduleIntermediaryAddressFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleIntermediaryAddress, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleIntermediaryAddress$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleIntermediaryAddress' from JSON`, ); } /** @internal */ export const Intermediary$inboundSchema: z.ZodType< Intermediary, z.ZodTypeDef, unknown > = z.object({ account: z.string().optional(), account_title: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalScheduleIntermediaryAddress$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "account_title": "accountTitle", }); }); /** @internal */ export type Intermediary$Outbound = { account?: string | undefined; account_title?: string | undefined; address?: | WireWithdrawalScheduleIntermediaryAddress$Outbound | null | undefined; }; /** @internal */ export const Intermediary$outboundSchema: z.ZodType< Intermediary$Outbound, z.ZodTypeDef, Intermediary > = z.object({ account: z.string().optional(), accountTitle: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalScheduleIntermediaryAddress$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { accountTitle: "account_title", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Intermediary$ { /** @deprecated use `Intermediary$inboundSchema` instead. */ export const inboundSchema = Intermediary$inboundSchema; /** @deprecated use `Intermediary$outboundSchema` instead. */ export const outboundSchema = Intermediary$outboundSchema; /** @deprecated use `Intermediary$Outbound` instead. */ export type Outbound = Intermediary$Outbound; } export function intermediaryToJSON(intermediary: Intermediary): string { return JSON.stringify(Intermediary$outboundSchema.parse(intermediary)); } export function intermediaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Intermediary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Intermediary' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleRecipientBankType$inboundSchema: z.ZodType< WireWithdrawalScheduleRecipientBankTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalScheduleRecipientBankType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalScheduleRecipientBankType$outboundSchema: z.ZodType< WireWithdrawalScheduleRecipientBankTypeOpen, z.ZodTypeDef, WireWithdrawalScheduleRecipientBankTypeOpen > = z.union([ z.nativeEnum(WireWithdrawalScheduleRecipientBankType), 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 WireWithdrawalScheduleRecipientBankType$ { /** @deprecated use `WireWithdrawalScheduleRecipientBankType$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRecipientBankType$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRecipientBankType$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRecipientBankType$outboundSchema; } /** @internal */ export const BankId$inboundSchema: z.ZodType = z .object({ id: z.string().optional(), type: WireWithdrawalScheduleRecipientBankType$inboundSchema.optional(), }); /** @internal */ export type BankId$Outbound = { id?: string | undefined; type?: string | undefined; }; /** @internal */ export const BankId$outboundSchema: z.ZodType< BankId$Outbound, z.ZodTypeDef, BankId > = z.object({ id: z.string().optional(), type: WireWithdrawalScheduleRecipientBankType$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 BankId$ { /** @deprecated use `BankId$inboundSchema` instead. */ export const inboundSchema = BankId$inboundSchema; /** @deprecated use `BankId$outboundSchema` instead. */ export const outboundSchema = BankId$outboundSchema; /** @deprecated use `BankId$Outbound` instead. */ export type Outbound = BankId$Outbound; } export function bankIdToJSON(bankId: BankId): string { return JSON.stringify(BankId$outboundSchema.parse(bankId)); } export function bankIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BankId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BankId' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleRecipientBankAddress$inboundSchema: z.ZodType = z.object({ city: z.string().optional(), country: z.string().optional(), postal_code: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "postal_code": "postalCode", }); }); /** @internal */ export type WireWithdrawalScheduleRecipientBankAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalScheduleRecipientBankAddress$outboundSchema: z.ZodType< WireWithdrawalScheduleRecipientBankAddress$Outbound, z.ZodTypeDef, WireWithdrawalScheduleRecipientBankAddress > = z.object({ city: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), streetAddress: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { postalCode: "postal_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalScheduleRecipientBankAddress$ { /** @deprecated use `WireWithdrawalScheduleRecipientBankAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRecipientBankAddress$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRecipientBankAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRecipientBankAddress$outboundSchema; /** @deprecated use `WireWithdrawalScheduleRecipientBankAddress$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleRecipientBankAddress$Outbound; } export function wireWithdrawalScheduleRecipientBankAddressToJSON( wireWithdrawalScheduleRecipientBankAddress: WireWithdrawalScheduleRecipientBankAddress, ): string { return JSON.stringify( WireWithdrawalScheduleRecipientBankAddress$outboundSchema.parse( wireWithdrawalScheduleRecipientBankAddress, ), ); } export function wireWithdrawalScheduleRecipientBankAddressFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleRecipientBankAddress, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleRecipientBankAddress$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleRecipientBankAddress' from JSON`, ); } /** @internal */ export const InternationalBankDetails$inboundSchema: z.ZodType< InternationalBankDetails, z.ZodTypeDef, unknown > = z.object({ additional_info: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalScheduleRecipientBankAddress$inboundSchema), ).optional(), bank_name: z.string().optional(), }).transform((v) => { return remap$(v, { "additional_info": "additionalInfo", "bank_name": "bankName", }); }); /** @internal */ export type InternationalBankDetails$Outbound = { additional_info?: string | undefined; address?: | WireWithdrawalScheduleRecipientBankAddress$Outbound | null | undefined; bank_name?: string | undefined; }; /** @internal */ export const InternationalBankDetails$outboundSchema: z.ZodType< InternationalBankDetails$Outbound, z.ZodTypeDef, InternationalBankDetails > = z.object({ additionalInfo: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalScheduleRecipientBankAddress$outboundSchema), ).optional(), bankName: z.string().optional(), }).transform((v) => { return remap$(v, { additionalInfo: "additional_info", bankName: "bank_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InternationalBankDetails$ { /** @deprecated use `InternationalBankDetails$inboundSchema` instead. */ export const inboundSchema = InternationalBankDetails$inboundSchema; /** @deprecated use `InternationalBankDetails$outboundSchema` instead. */ export const outboundSchema = InternationalBankDetails$outboundSchema; /** @deprecated use `InternationalBankDetails$Outbound` instead. */ export type Outbound = InternationalBankDetails$Outbound; } export function internationalBankDetailsToJSON( internationalBankDetails: InternationalBankDetails, ): string { return JSON.stringify( InternationalBankDetails$outboundSchema.parse(internationalBankDetails), ); } export function internationalBankDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InternationalBankDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternationalBankDetails' from JSON`, ); } /** @internal */ export const RecipientBank$inboundSchema: z.ZodType< RecipientBank, z.ZodTypeDef, unknown > = z.object({ bank_id: z.nullable(z.lazy(() => BankId$inboundSchema)).optional(), international_bank_details: z.nullable( z.lazy(() => InternationalBankDetails$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "bank_id": "bankId", "international_bank_details": "internationalBankDetails", }); }); /** @internal */ export type RecipientBank$Outbound = { bank_id?: BankId$Outbound | null | undefined; international_bank_details?: | InternationalBankDetails$Outbound | null | undefined; }; /** @internal */ export const RecipientBank$outboundSchema: z.ZodType< RecipientBank$Outbound, z.ZodTypeDef, RecipientBank > = z.object({ bankId: z.nullable(z.lazy(() => BankId$outboundSchema)).optional(), internationalBankDetails: z.nullable( z.lazy(() => InternationalBankDetails$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { bankId: "bank_id", internationalBankDetails: "international_bank_details", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RecipientBank$ { /** @deprecated use `RecipientBank$inboundSchema` instead. */ export const inboundSchema = RecipientBank$inboundSchema; /** @deprecated use `RecipientBank$outboundSchema` instead. */ export const outboundSchema = RecipientBank$outboundSchema; /** @deprecated use `RecipientBank$Outbound` instead. */ export type Outbound = RecipientBank$Outbound; } export function recipientBankToJSON(recipientBank: RecipientBank): string { return JSON.stringify(RecipientBank$outboundSchema.parse(recipientBank)); } export function recipientBankFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RecipientBank$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RecipientBank' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$inboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$outboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$Outbound, z.ZodTypeDef, WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount > = 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 WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$ { /** @deprecated use `WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$outboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$Outbound; } export function wireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmountToJSON( wireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount: WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount, ): string { return JSON.stringify( WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$outboundSchema .parse( wireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount, ), ); } export function wireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmountFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalSchedulePercentage$inboundSchema: z.ZodType< WireWithdrawalSchedulePercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalSchedulePercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalSchedulePercentage$outboundSchema: z.ZodType< WireWithdrawalSchedulePercentage$Outbound, z.ZodTypeDef, WireWithdrawalSchedulePercentage > = 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 WireWithdrawalSchedulePercentage$ { /** @deprecated use `WireWithdrawalSchedulePercentage$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalSchedulePercentage$inboundSchema; /** @deprecated use `WireWithdrawalSchedulePercentage$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalSchedulePercentage$outboundSchema; /** @deprecated use `WireWithdrawalSchedulePercentage$Outbound` instead. */ export type Outbound = WireWithdrawalSchedulePercentage$Outbound; } export function wireWithdrawalSchedulePercentageToJSON( wireWithdrawalSchedulePercentage: WireWithdrawalSchedulePercentage, ): string { return JSON.stringify( WireWithdrawalSchedulePercentage$outboundSchema.parse( wireWithdrawalSchedulePercentage, ), ); } export function wireWithdrawalSchedulePercentageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalSchedulePercentage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalSchedulePercentage' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleFederalTaxWithholding$inboundSchema: z.ZodType< WireWithdrawalScheduleFederalTaxWithholding, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$inboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalSchedulePercentage$inboundSchema), ).optional(), }); /** @internal */ export type WireWithdrawalScheduleFederalTaxWithholding$Outbound = { amount?: | WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$Outbound | null | undefined; percentage?: WireWithdrawalSchedulePercentage$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalScheduleFederalTaxWithholding$outboundSchema: z.ZodType< WireWithdrawalScheduleFederalTaxWithholding$Outbound, z.ZodTypeDef, WireWithdrawalScheduleFederalTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionFederalTaxWithholdingAmount$outboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalSchedulePercentage$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 WireWithdrawalScheduleFederalTaxWithholding$ { /** @deprecated use `WireWithdrawalScheduleFederalTaxWithholding$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleFederalTaxWithholding$inboundSchema; /** @deprecated use `WireWithdrawalScheduleFederalTaxWithholding$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleFederalTaxWithholding$outboundSchema; /** @deprecated use `WireWithdrawalScheduleFederalTaxWithholding$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleFederalTaxWithholding$Outbound; } export function wireWithdrawalScheduleFederalTaxWithholdingToJSON( wireWithdrawalScheduleFederalTaxWithholding: WireWithdrawalScheduleFederalTaxWithholding, ): string { return JSON.stringify( WireWithdrawalScheduleFederalTaxWithholding$outboundSchema.parse( wireWithdrawalScheduleFederalTaxWithholding, ), ); } export function wireWithdrawalScheduleFederalTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleFederalTaxWithholding, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleFederalTaxWithholding$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleFederalTaxWithholding' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleRetirementDistributionAmount$inboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalScheduleRetirementDistributionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalScheduleRetirementDistributionAmount$outboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionAmount$Outbound, z.ZodTypeDef, WireWithdrawalScheduleRetirementDistributionAmount > = 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 WireWithdrawalScheduleRetirementDistributionAmount$ { /** @deprecated use `WireWithdrawalScheduleRetirementDistributionAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRetirementDistributionAmount$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRetirementDistributionAmount$outboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionAmount$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleRetirementDistributionAmount$Outbound; } export function wireWithdrawalScheduleRetirementDistributionAmountToJSON( wireWithdrawalScheduleRetirementDistributionAmount: WireWithdrawalScheduleRetirementDistributionAmount, ): string { return JSON.stringify( WireWithdrawalScheduleRetirementDistributionAmount$outboundSchema.parse( wireWithdrawalScheduleRetirementDistributionAmount, ), ); } export function wireWithdrawalScheduleRetirementDistributionAmountFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleRetirementDistributionAmount, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleRetirementDistributionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleRetirementDistributionAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleRetirementDistributionPercentage$inboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionPercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalScheduleRetirementDistributionPercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalScheduleRetirementDistributionPercentage$outboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistributionPercentage$Outbound, z.ZodTypeDef, WireWithdrawalScheduleRetirementDistributionPercentage > = 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 WireWithdrawalScheduleRetirementDistributionPercentage$ { /** @deprecated use `WireWithdrawalScheduleRetirementDistributionPercentage$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRetirementDistributionPercentage$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionPercentage$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRetirementDistributionPercentage$outboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistributionPercentage$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleRetirementDistributionPercentage$Outbound; } export function wireWithdrawalScheduleRetirementDistributionPercentageToJSON( wireWithdrawalScheduleRetirementDistributionPercentage: WireWithdrawalScheduleRetirementDistributionPercentage, ): string { return JSON.stringify( WireWithdrawalScheduleRetirementDistributionPercentage$outboundSchema.parse( wireWithdrawalScheduleRetirementDistributionPercentage, ), ); } export function wireWithdrawalScheduleRetirementDistributionPercentageFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleRetirementDistributionPercentage, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleRetirementDistributionPercentage$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleRetirementDistributionPercentage' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleStateTaxWithholding$inboundSchema: z.ZodType< WireWithdrawalScheduleStateTaxWithholding, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionAmount$inboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionPercentage$inboundSchema ), ).optional(), }); /** @internal */ export type WireWithdrawalScheduleStateTaxWithholding$Outbound = { amount?: | WireWithdrawalScheduleRetirementDistributionAmount$Outbound | null | undefined; percentage?: | WireWithdrawalScheduleRetirementDistributionPercentage$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalScheduleStateTaxWithholding$outboundSchema: z.ZodType< WireWithdrawalScheduleStateTaxWithholding$Outbound, z.ZodTypeDef, WireWithdrawalScheduleStateTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionAmount$outboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistributionPercentage$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 WireWithdrawalScheduleStateTaxWithholding$ { /** @deprecated use `WireWithdrawalScheduleStateTaxWithholding$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleStateTaxWithholding$inboundSchema; /** @deprecated use `WireWithdrawalScheduleStateTaxWithholding$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleStateTaxWithholding$outboundSchema; /** @deprecated use `WireWithdrawalScheduleStateTaxWithholding$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleStateTaxWithholding$Outbound; } export function wireWithdrawalScheduleStateTaxWithholdingToJSON( wireWithdrawalScheduleStateTaxWithholding: WireWithdrawalScheduleStateTaxWithholding, ): string { return JSON.stringify( WireWithdrawalScheduleStateTaxWithholding$outboundSchema.parse( wireWithdrawalScheduleStateTaxWithholding, ), ); } export function wireWithdrawalScheduleStateTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleStateTaxWithholding, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleStateTaxWithholding$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleStateTaxWithholding' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleType$inboundSchema: z.ZodType< WireWithdrawalScheduleTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalScheduleType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalScheduleType$outboundSchema: z.ZodType< WireWithdrawalScheduleTypeOpen, z.ZodTypeDef, WireWithdrawalScheduleTypeOpen > = z.union([ z.nativeEnum(WireWithdrawalScheduleType), 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 WireWithdrawalScheduleType$ { /** @deprecated use `WireWithdrawalScheduleType$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleType$inboundSchema; /** @deprecated use `WireWithdrawalScheduleType$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleType$outboundSchema; } /** @internal */ export const WireWithdrawalScheduleRetirementDistribution$inboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistribution, z.ZodTypeDef, unknown > = z.object({ federal_tax_withholding: z.nullable( z.lazy(() => WireWithdrawalScheduleFederalTaxWithholding$inboundSchema), ).optional(), receiving_institution: z.string().optional(), state_tax_withholding: z.nullable( z.lazy(() => WireWithdrawalScheduleStateTaxWithholding$inboundSchema), ).optional(), state_withholding_waiver: z.boolean().optional(), tax_year: z.number().int().optional(), type: WireWithdrawalScheduleType$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 WireWithdrawalScheduleRetirementDistribution$Outbound = { federal_tax_withholding?: | WireWithdrawalScheduleFederalTaxWithholding$Outbound | null | undefined; receiving_institution?: string | undefined; state_tax_withholding?: | WireWithdrawalScheduleStateTaxWithholding$Outbound | null | undefined; state_withholding_waiver?: boolean | undefined; tax_year?: number | undefined; type?: string | undefined; }; /** @internal */ export const WireWithdrawalScheduleRetirementDistribution$outboundSchema: z.ZodType< WireWithdrawalScheduleRetirementDistribution$Outbound, z.ZodTypeDef, WireWithdrawalScheduleRetirementDistribution > = z.object({ federalTaxWithholding: z.nullable( z.lazy(() => WireWithdrawalScheduleFederalTaxWithholding$outboundSchema), ).optional(), receivingInstitution: z.string().optional(), stateTaxWithholding: z.nullable( z.lazy(() => WireWithdrawalScheduleStateTaxWithholding$outboundSchema), ).optional(), stateWithholdingWaiver: z.boolean().optional(), taxYear: z.number().int().optional(), type: WireWithdrawalScheduleType$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 WireWithdrawalScheduleRetirementDistribution$ { /** @deprecated use `WireWithdrawalScheduleRetirementDistribution$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleRetirementDistribution$inboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistribution$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleRetirementDistribution$outboundSchema; /** @deprecated use `WireWithdrawalScheduleRetirementDistribution$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleRetirementDistribution$Outbound; } export function wireWithdrawalScheduleRetirementDistributionToJSON( wireWithdrawalScheduleRetirementDistribution: WireWithdrawalScheduleRetirementDistribution, ): string { return JSON.stringify( WireWithdrawalScheduleRetirementDistribution$outboundSchema.parse( wireWithdrawalScheduleRetirementDistribution, ), ); } export function wireWithdrawalScheduleRetirementDistributionFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleRetirementDistribution, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleRetirementDistribution$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleRetirementDistribution' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleAmount$inboundSchema: z.ZodType< WireWithdrawalScheduleAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalScheduleAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalScheduleAmount$outboundSchema: z.ZodType< WireWithdrawalScheduleAmount$Outbound, z.ZodTypeDef, WireWithdrawalScheduleAmount > = 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 WireWithdrawalScheduleAmount$ { /** @deprecated use `WireWithdrawalScheduleAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleAmount$inboundSchema; /** @deprecated use `WireWithdrawalScheduleAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleAmount$outboundSchema; /** @deprecated use `WireWithdrawalScheduleAmount$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleAmount$Outbound; } export function wireWithdrawalScheduleAmountToJSON( wireWithdrawalScheduleAmount: WireWithdrawalScheduleAmount, ): string { return JSON.stringify( WireWithdrawalScheduleAmount$outboundSchema.parse( wireWithdrawalScheduleAmount, ), ); } export function wireWithdrawalScheduleAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleEndDate$inboundSchema: z.ZodType< WireWithdrawalScheduleEndDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type WireWithdrawalScheduleEndDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const WireWithdrawalScheduleEndDate$outboundSchema: z.ZodType< WireWithdrawalScheduleEndDate$Outbound, z.ZodTypeDef, WireWithdrawalScheduleEndDate > = 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 WireWithdrawalScheduleEndDate$ { /** @deprecated use `WireWithdrawalScheduleEndDate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleEndDate$inboundSchema; /** @deprecated use `WireWithdrawalScheduleEndDate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleEndDate$outboundSchema; /** @deprecated use `WireWithdrawalScheduleEndDate$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleEndDate$Outbound; } export function wireWithdrawalScheduleEndDateToJSON( wireWithdrawalScheduleEndDate: WireWithdrawalScheduleEndDate, ): string { return JSON.stringify( WireWithdrawalScheduleEndDate$outboundSchema.parse( wireWithdrawalScheduleEndDate, ), ); } export function wireWithdrawalScheduleEndDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleEndDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleEndDate' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleStartDate$inboundSchema: z.ZodType< WireWithdrawalScheduleStartDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type WireWithdrawalScheduleStartDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const WireWithdrawalScheduleStartDate$outboundSchema: z.ZodType< WireWithdrawalScheduleStartDate$Outbound, z.ZodTypeDef, WireWithdrawalScheduleStartDate > = 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 WireWithdrawalScheduleStartDate$ { /** @deprecated use `WireWithdrawalScheduleStartDate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleStartDate$inboundSchema; /** @deprecated use `WireWithdrawalScheduleStartDate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleStartDate$outboundSchema; /** @deprecated use `WireWithdrawalScheduleStartDate$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleStartDate$Outbound; } export function wireWithdrawalScheduleStartDateToJSON( wireWithdrawalScheduleStartDate: WireWithdrawalScheduleStartDate, ): string { return JSON.stringify( WireWithdrawalScheduleStartDate$outboundSchema.parse( wireWithdrawalScheduleStartDate, ), ); } export function wireWithdrawalScheduleStartDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleStartDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleStartDate' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleState$inboundSchema: z.ZodType< WireWithdrawalScheduleStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalScheduleState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalScheduleState$outboundSchema: z.ZodType< WireWithdrawalScheduleStateOpen, z.ZodTypeDef, WireWithdrawalScheduleStateOpen > = z.union([ z.nativeEnum(WireWithdrawalScheduleState), 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 WireWithdrawalScheduleState$ { /** @deprecated use `WireWithdrawalScheduleState$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleState$inboundSchema; /** @deprecated use `WireWithdrawalScheduleState$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleState$outboundSchema; } /** @internal */ export const WireWithdrawalScheduleTimeUnit$inboundSchema: z.ZodType< WireWithdrawalScheduleTimeUnitOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalScheduleTimeUnit), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalScheduleTimeUnit$outboundSchema: z.ZodType< WireWithdrawalScheduleTimeUnitOpen, z.ZodTypeDef, WireWithdrawalScheduleTimeUnitOpen > = z.union([ z.nativeEnum(WireWithdrawalScheduleTimeUnit), 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 WireWithdrawalScheduleTimeUnit$ { /** @deprecated use `WireWithdrawalScheduleTimeUnit$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleTimeUnit$inboundSchema; /** @deprecated use `WireWithdrawalScheduleTimeUnit$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleTimeUnit$outboundSchema; } /** @internal */ export const WireWithdrawalScheduleScheduleProperties$inboundSchema: z.ZodType< WireWithdrawalScheduleScheduleProperties, z.ZodTypeDef, unknown > = z.object({ end_date: z.nullable( z.lazy(() => WireWithdrawalScheduleEndDate$inboundSchema), ).optional(), occurrences: z.number().int().optional(), start_date: z.nullable( z.lazy(() => WireWithdrawalScheduleStartDate$inboundSchema), ).optional(), state: WireWithdrawalScheduleState$inboundSchema.optional(), time_unit: WireWithdrawalScheduleTimeUnit$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 WireWithdrawalScheduleScheduleProperties$Outbound = { end_date?: WireWithdrawalScheduleEndDate$Outbound | null | undefined; occurrences?: number | undefined; start_date?: WireWithdrawalScheduleStartDate$Outbound | null | undefined; state?: string | undefined; time_unit?: string | undefined; unit_multiplier?: number | undefined; }; /** @internal */ export const WireWithdrawalScheduleScheduleProperties$outboundSchema: z.ZodType< WireWithdrawalScheduleScheduleProperties$Outbound, z.ZodTypeDef, WireWithdrawalScheduleScheduleProperties > = z.object({ endDate: z.nullable( z.lazy(() => WireWithdrawalScheduleEndDate$outboundSchema), ).optional(), occurrences: z.number().int().optional(), startDate: z.nullable( z.lazy(() => WireWithdrawalScheduleStartDate$outboundSchema), ).optional(), state: WireWithdrawalScheduleState$outboundSchema.optional(), timeUnit: WireWithdrawalScheduleTimeUnit$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 WireWithdrawalScheduleScheduleProperties$ { /** @deprecated use `WireWithdrawalScheduleScheduleProperties$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleScheduleProperties$inboundSchema; /** @deprecated use `WireWithdrawalScheduleScheduleProperties$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleScheduleProperties$outboundSchema; /** @deprecated use `WireWithdrawalScheduleScheduleProperties$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleScheduleProperties$Outbound; } export function wireWithdrawalScheduleSchedulePropertiesToJSON( wireWithdrawalScheduleScheduleProperties: WireWithdrawalScheduleScheduleProperties, ): string { return JSON.stringify( WireWithdrawalScheduleScheduleProperties$outboundSchema.parse( wireWithdrawalScheduleScheduleProperties, ), ); } export function wireWithdrawalScheduleSchedulePropertiesFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalScheduleScheduleProperties, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalScheduleScheduleProperties$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalScheduleScheduleProperties' from JSON`, ); } /** @internal */ export const WireWithdrawalScheduleScheduleDetails$inboundSchema: z.ZodType< WireWithdrawalScheduleScheduleDetails, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable(z.lazy(() => WireWithdrawalScheduleAmount$inboundSchema)) .optional(), client_schedule_id: z.string().optional(), full_disbursement: z.boolean().optional(), schedule_properties: z.nullable( z.lazy(() => WireWithdrawalScheduleScheduleProperties$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "client_schedule_id": "clientScheduleId", "full_disbursement": "fullDisbursement", "schedule_properties": "scheduleProperties", }); }); /** @internal */ export type WireWithdrawalScheduleScheduleDetails$Outbound = { amount?: WireWithdrawalScheduleAmount$Outbound | null | undefined; client_schedule_id?: string | undefined; full_disbursement?: boolean | undefined; schedule_properties?: | WireWithdrawalScheduleScheduleProperties$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalScheduleScheduleDetails$outboundSchema: z.ZodType< WireWithdrawalScheduleScheduleDetails$Outbound, z.ZodTypeDef, WireWithdrawalScheduleScheduleDetails > = z.object({ amount: z.nullable(z.lazy(() => WireWithdrawalScheduleAmount$outboundSchema)) .optional(), clientScheduleId: z.string().optional(), fullDisbursement: z.boolean().optional(), scheduleProperties: z.nullable( z.lazy(() => WireWithdrawalScheduleScheduleProperties$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 WireWithdrawalScheduleScheduleDetails$ { /** @deprecated use `WireWithdrawalScheduleScheduleDetails$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleScheduleDetails$inboundSchema; /** @deprecated use `WireWithdrawalScheduleScheduleDetails$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleScheduleDetails$outboundSchema; /** @deprecated use `WireWithdrawalScheduleScheduleDetails$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleScheduleDetails$Outbound; } export function wireWithdrawalScheduleScheduleDetailsToJSON( wireWithdrawalScheduleScheduleDetails: WireWithdrawalScheduleScheduleDetails, ): string { return JSON.stringify( WireWithdrawalScheduleScheduleDetails$outboundSchema.parse( wireWithdrawalScheduleScheduleDetails, ), ); } export function wireWithdrawalScheduleScheduleDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleScheduleDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleScheduleDetails' from JSON`, ); } /** @internal */ export const WireWithdrawalSchedule$inboundSchema: z.ZodType< WireWithdrawalSchedule, z.ZodTypeDef, unknown > = z.object({ beneficiary: z.nullable( z.lazy(() => WireWithdrawalScheduleBeneficiary$inboundSchema), ).optional(), intermediary: z.nullable(z.lazy(() => Intermediary$inboundSchema)).optional(), name: z.string().optional(), recipient_bank: z.nullable(z.lazy(() => RecipientBank$inboundSchema)) .optional(), retirement_distribution: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistribution$inboundSchema), ).optional(), schedule_details: z.nullable( z.lazy(() => WireWithdrawalScheduleScheduleDetails$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "recipient_bank": "recipientBank", "retirement_distribution": "retirementDistribution", "schedule_details": "scheduleDetails", }); }); /** @internal */ export type WireWithdrawalSchedule$Outbound = { beneficiary?: WireWithdrawalScheduleBeneficiary$Outbound | null | undefined; intermediary?: Intermediary$Outbound | null | undefined; name?: string | undefined; recipient_bank?: RecipientBank$Outbound | null | undefined; retirement_distribution?: | WireWithdrawalScheduleRetirementDistribution$Outbound | null | undefined; schedule_details?: | WireWithdrawalScheduleScheduleDetails$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalSchedule$outboundSchema: z.ZodType< WireWithdrawalSchedule$Outbound, z.ZodTypeDef, WireWithdrawalSchedule > = z.object({ beneficiary: z.nullable( z.lazy(() => WireWithdrawalScheduleBeneficiary$outboundSchema), ).optional(), intermediary: z.nullable(z.lazy(() => Intermediary$outboundSchema)) .optional(), name: z.string().optional(), recipientBank: z.nullable(z.lazy(() => RecipientBank$outboundSchema)) .optional(), retirementDistribution: z.nullable( z.lazy(() => WireWithdrawalScheduleRetirementDistribution$outboundSchema), ).optional(), scheduleDetails: z.nullable( z.lazy(() => WireWithdrawalScheduleScheduleDetails$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { recipientBank: "recipient_bank", retirementDistribution: "retirement_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 WireWithdrawalSchedule$ { /** @deprecated use `WireWithdrawalSchedule$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalSchedule$inboundSchema; /** @deprecated use `WireWithdrawalSchedule$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalSchedule$outboundSchema; /** @deprecated use `WireWithdrawalSchedule$Outbound` instead. */ export type Outbound = WireWithdrawalSchedule$Outbound; } export function wireWithdrawalScheduleToJSON( wireWithdrawalSchedule: WireWithdrawalSchedule, ): string { return JSON.stringify( WireWithdrawalSchedule$outboundSchema.parse(wireWithdrawalSchedule), ); } export function wireWithdrawalScheduleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalSchedule$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalSchedule' from JSON`, ); }