/* * 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"; /** * A cash amount in the format of decimal value */ export type WireWithdrawalAmount = { /** * 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 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 WireWithdrawalAddress = { /** * 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 WireWithdrawalBeneficiary = { /** * 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?: WireWithdrawalAddress | 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 WireWithdrawalIntermediaryAddress = { /** * 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 WireWithdrawalIntermediary = { /** * 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?: WireWithdrawalIntermediaryAddress | null | undefined; }; /** * Fixed USD amount to withhold for taxes. */ export type WireWithdrawalIraDistributionAmount = { /** * 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 WireWithdrawalPercentage = { /** * 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 WireWithdrawalFederalTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: WireWithdrawalIraDistributionAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: WireWithdrawalPercentage | null | undefined; }; /** * Fixed USD amount to withhold for taxes. */ export type WireWithdrawalIraDistributionStateTaxWithholdingAmount = { /** * 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 WireWithdrawalIraDistributionPercentage = { /** * 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 WireWithdrawalStateTaxWithholding = { /** * Fixed USD amount to withhold for taxes. */ amount?: | WireWithdrawalIraDistributionStateTaxWithholdingAmount | null | undefined; /** * Percentage of total disbursement amount to withhold for taxes. */ percentage?: WireWithdrawalIraDistributionPercentage | null | undefined; }; /** * The type of retirement distribution. */ export enum WireWithdrawalType { 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 WireWithdrawalTypeOpen = OpenEnum; /** * IRA distribution details for withdrawal from retirement account */ export type WireWithdrawalIraDistribution = { /** * The federal tax withholding. */ federalTaxWithholding?: | WireWithdrawalFederalTaxWithholding | 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?: WireWithdrawalStateTaxWithholding | 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?: WireWithdrawalTypeOpen | undefined; }; /** * The type of bank identifier specified */ export enum WireWithdrawalRecipientBankType { TypeUnspecified = "TYPE_UNSPECIFIED", Aba = "ABA", Bic = "BIC", } /** * The type of bank identifier specified */ export type WireWithdrawalRecipientBankTypeOpen = OpenEnum< typeof WireWithdrawalRecipientBankType >; /** * An identifier that represents ABA routing number for domestic wire or BIC for foreign wire */ export type WireWithdrawalBankId = { /** * The bank identifier */ id?: string | undefined; /** * The type of bank identifier specified */ type?: WireWithdrawalRecipientBankTypeOpen | undefined; }; /** * The address of the recipient bank / financial institution */ export type WireWithdrawalRecipientBankAddress = { /** * 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 WireWithdrawalInternationalBankDetails = { /** * 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?: WireWithdrawalRecipientBankAddress | null | undefined; /** * The name of the recipient bank / financial institution */ bankName?: string | undefined; }; /** * The recipient bank / financial institution */ export type WireWithdrawalRecipientBank = { /** * An identifier that represents ABA routing number for domestic wire or BIC for foreign wire */ bankId?: WireWithdrawalBankId | null | undefined; /** * Bank details required in the case of an international wire transfer */ internationalBankDetails?: | WireWithdrawalInternationalBankDetails | null | undefined; }; /** * The high level state of a transfer, one of: * * @remarks * - `PROCESSING` - The transfer is being processed and will be posted if successful. * - `PENDING_REVIEW` - The transfer is pending review and will continue processing if approved. * - `POSTED` - The transfer has been posted to the ledger and will be completed at the end of the processing window if not canceled first. * - `COMPLETED` - The transfer has been batched and completed. * - `REJECTED` - The transfer was rejected. * - `CANCELED` - The transfer was canceled. * - `RETURNED` - The transfer was returned. * - `POSTPONED` - The transfer is postponed and will resume processing during the next processing window. */ export enum WireWithdrawalStateState { StateUnspecified = "STATE_UNSPECIFIED", Processing = "PROCESSING", PendingReview = "PENDING_REVIEW", Posted = "POSTED", Completed = "COMPLETED", Rejected = "REJECTED", Canceled = "CANCELED", Returned = "RETURNED", Postponed = "POSTPONED", } /** * The high level state of a transfer, one of: * * @remarks * - `PROCESSING` - The transfer is being processed and will be posted if successful. * - `PENDING_REVIEW` - The transfer is pending review and will continue processing if approved. * - `POSTED` - The transfer has been posted to the ledger and will be completed at the end of the processing window if not canceled first. * - `COMPLETED` - The transfer has been batched and completed. * - `REJECTED` - The transfer was rejected. * - `CANCELED` - The transfer was canceled. * - `RETURNED` - The transfer was returned. * - `POSTPONED` - The transfer is postponed and will resume processing during the next processing window. */ export type WireWithdrawalStateStateOpen = OpenEnum< typeof WireWithdrawalStateState >; /** * The current state of the wire withdrawal */ export type WireWithdrawalState = { /** * The user or service that triggered the state update. */ actor?: string | undefined; /** * Additional description of the transfer state. */ message?: string | undefined; /** * Additional metadata relating to the transfer state. Included data depends on the state, e.g.: * * @remarks * - Rejection reasons are included when the `state` is `REJECTED` * - Reason and comment are included when `state` is `CANCELED` */ metadata?: { [k: string]: any } | null | undefined; /** * The high level state of a transfer, one of: * * @remarks * - `PROCESSING` - The transfer is being processed and will be posted if successful. * - `PENDING_REVIEW` - The transfer is pending review and will continue processing if approved. * - `POSTED` - The transfer has been posted to the ledger and will be completed at the end of the processing window if not canceled first. * - `COMPLETED` - The transfer has been batched and completed. * - `REJECTED` - The transfer was rejected. * - `CANCELED` - The transfer was canceled. * - `RETURNED` - The transfer was returned. * - `POSTPONED` - The transfer is postponed and will resume processing during the next processing window. */ state?: WireWithdrawalStateStateOpen | undefined; /** * The time of the state update. */ updateTime?: Date | null | undefined; }; /** * A withdrawal transfer using the wire mechanism */ export type WireWithdrawal = { /** * A cash amount in the format of decimal value */ amount?: WireWithdrawalAmount | null | undefined; /** * The beneficiary of the wire withdrawal */ beneficiary?: WireWithdrawalBeneficiary | null | undefined; /** * External identifier supplied by the API caller. Each request must have a unique pairing of client_transfer_id and account */ clientTransferId?: string | undefined; /** * The FedWire reference number for the withdrawal. Only set after the transfer is completed. */ fedReferenceNumber?: string | undefined; /** * The intermediary party */ intermediary?: WireWithdrawalIntermediary | null | undefined; /** * IRA distribution details for withdrawal from retirement account */ iraDistribution?: WireWithdrawalIraDistribution | null | undefined; /** * The service generated name of the wire withdrawal */ name?: string | undefined; /** * The recipient bank / financial institution */ recipientBank?: WireWithdrawalRecipientBank | null | undefined; /** * The current state of the wire withdrawal */ state?: WireWithdrawalState | null | undefined; }; /** @internal */ export const WireWithdrawalAmount$inboundSchema: z.ZodType< WireWithdrawalAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalAmount$outboundSchema: z.ZodType< WireWithdrawalAmount$Outbound, z.ZodTypeDef, WireWithdrawalAmount > = 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 WireWithdrawalAmount$ { /** @deprecated use `WireWithdrawalAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalAmount$inboundSchema; /** @deprecated use `WireWithdrawalAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalAmount$outboundSchema; /** @deprecated use `WireWithdrawalAmount$Outbound` instead. */ export type Outbound = WireWithdrawalAmount$Outbound; } export function wireWithdrawalAmountToJSON( wireWithdrawalAmount: WireWithdrawalAmount, ): string { return JSON.stringify( WireWithdrawalAmount$outboundSchema.parse(wireWithdrawalAmount), ); } export function wireWithdrawalAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalAddress$inboundSchema: z.ZodType< WireWithdrawalAddress, 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 WireWithdrawalAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalAddress$outboundSchema: z.ZodType< WireWithdrawalAddress$Outbound, z.ZodTypeDef, WireWithdrawalAddress > = 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 WireWithdrawalAddress$ { /** @deprecated use `WireWithdrawalAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalAddress$inboundSchema; /** @deprecated use `WireWithdrawalAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalAddress$outboundSchema; /** @deprecated use `WireWithdrawalAddress$Outbound` instead. */ export type Outbound = WireWithdrawalAddress$Outbound; } export function wireWithdrawalAddressToJSON( wireWithdrawalAddress: WireWithdrawalAddress, ): string { return JSON.stringify( WireWithdrawalAddress$outboundSchema.parse(wireWithdrawalAddress), ); } export function wireWithdrawalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalAddress' from JSON`, ); } /** @internal */ export const WireWithdrawalBeneficiary$inboundSchema: z.ZodType< WireWithdrawalBeneficiary, z.ZodTypeDef, unknown > = z.object({ account: z.string().optional(), account_title: z.string().optional(), address: z.nullable(z.lazy(() => WireWithdrawalAddress$inboundSchema)) .optional(), third_party: z.boolean().optional(), }).transform((v) => { return remap$(v, { "account_title": "accountTitle", "third_party": "thirdParty", }); }); /** @internal */ export type WireWithdrawalBeneficiary$Outbound = { account?: string | undefined; account_title?: string | undefined; address?: WireWithdrawalAddress$Outbound | null | undefined; third_party?: boolean | undefined; }; /** @internal */ export const WireWithdrawalBeneficiary$outboundSchema: z.ZodType< WireWithdrawalBeneficiary$Outbound, z.ZodTypeDef, WireWithdrawalBeneficiary > = z.object({ account: z.string().optional(), accountTitle: z.string().optional(), address: z.nullable(z.lazy(() => WireWithdrawalAddress$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 WireWithdrawalBeneficiary$ { /** @deprecated use `WireWithdrawalBeneficiary$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalBeneficiary$inboundSchema; /** @deprecated use `WireWithdrawalBeneficiary$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalBeneficiary$outboundSchema; /** @deprecated use `WireWithdrawalBeneficiary$Outbound` instead. */ export type Outbound = WireWithdrawalBeneficiary$Outbound; } export function wireWithdrawalBeneficiaryToJSON( wireWithdrawalBeneficiary: WireWithdrawalBeneficiary, ): string { return JSON.stringify( WireWithdrawalBeneficiary$outboundSchema.parse(wireWithdrawalBeneficiary), ); } export function wireWithdrawalBeneficiaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalBeneficiary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalBeneficiary' from JSON`, ); } /** @internal */ export const WireWithdrawalIntermediaryAddress$inboundSchema: z.ZodType< WireWithdrawalIntermediaryAddress, 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 WireWithdrawalIntermediaryAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalIntermediaryAddress$outboundSchema: z.ZodType< WireWithdrawalIntermediaryAddress$Outbound, z.ZodTypeDef, WireWithdrawalIntermediaryAddress > = 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 WireWithdrawalIntermediaryAddress$ { /** @deprecated use `WireWithdrawalIntermediaryAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIntermediaryAddress$inboundSchema; /** @deprecated use `WireWithdrawalIntermediaryAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIntermediaryAddress$outboundSchema; /** @deprecated use `WireWithdrawalIntermediaryAddress$Outbound` instead. */ export type Outbound = WireWithdrawalIntermediaryAddress$Outbound; } export function wireWithdrawalIntermediaryAddressToJSON( wireWithdrawalIntermediaryAddress: WireWithdrawalIntermediaryAddress, ): string { return JSON.stringify( WireWithdrawalIntermediaryAddress$outboundSchema.parse( wireWithdrawalIntermediaryAddress, ), ); } export function wireWithdrawalIntermediaryAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalIntermediaryAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIntermediaryAddress' from JSON`, ); } /** @internal */ export const WireWithdrawalIntermediary$inboundSchema: z.ZodType< WireWithdrawalIntermediary, z.ZodTypeDef, unknown > = z.object({ account: z.string().optional(), account_title: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalIntermediaryAddress$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "account_title": "accountTitle", }); }); /** @internal */ export type WireWithdrawalIntermediary$Outbound = { account?: string | undefined; account_title?: string | undefined; address?: WireWithdrawalIntermediaryAddress$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalIntermediary$outboundSchema: z.ZodType< WireWithdrawalIntermediary$Outbound, z.ZodTypeDef, WireWithdrawalIntermediary > = z.object({ account: z.string().optional(), accountTitle: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalIntermediaryAddress$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 WireWithdrawalIntermediary$ { /** @deprecated use `WireWithdrawalIntermediary$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIntermediary$inboundSchema; /** @deprecated use `WireWithdrawalIntermediary$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIntermediary$outboundSchema; /** @deprecated use `WireWithdrawalIntermediary$Outbound` instead. */ export type Outbound = WireWithdrawalIntermediary$Outbound; } export function wireWithdrawalIntermediaryToJSON( wireWithdrawalIntermediary: WireWithdrawalIntermediary, ): string { return JSON.stringify( WireWithdrawalIntermediary$outboundSchema.parse(wireWithdrawalIntermediary), ); } export function wireWithdrawalIntermediaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalIntermediary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIntermediary' from JSON`, ); } /** @internal */ export const WireWithdrawalIraDistributionAmount$inboundSchema: z.ZodType< WireWithdrawalIraDistributionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalIraDistributionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalIraDistributionAmount$outboundSchema: z.ZodType< WireWithdrawalIraDistributionAmount$Outbound, z.ZodTypeDef, WireWithdrawalIraDistributionAmount > = 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 WireWithdrawalIraDistributionAmount$ { /** @deprecated use `WireWithdrawalIraDistributionAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIraDistributionAmount$inboundSchema; /** @deprecated use `WireWithdrawalIraDistributionAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIraDistributionAmount$outboundSchema; /** @deprecated use `WireWithdrawalIraDistributionAmount$Outbound` instead. */ export type Outbound = WireWithdrawalIraDistributionAmount$Outbound; } export function wireWithdrawalIraDistributionAmountToJSON( wireWithdrawalIraDistributionAmount: WireWithdrawalIraDistributionAmount, ): string { return JSON.stringify( WireWithdrawalIraDistributionAmount$outboundSchema.parse( wireWithdrawalIraDistributionAmount, ), ); } export function wireWithdrawalIraDistributionAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalIraDistributionAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIraDistributionAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalPercentage$inboundSchema: z.ZodType< WireWithdrawalPercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalPercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalPercentage$outboundSchema: z.ZodType< WireWithdrawalPercentage$Outbound, z.ZodTypeDef, WireWithdrawalPercentage > = 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 WireWithdrawalPercentage$ { /** @deprecated use `WireWithdrawalPercentage$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalPercentage$inboundSchema; /** @deprecated use `WireWithdrawalPercentage$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalPercentage$outboundSchema; /** @deprecated use `WireWithdrawalPercentage$Outbound` instead. */ export type Outbound = WireWithdrawalPercentage$Outbound; } export function wireWithdrawalPercentageToJSON( wireWithdrawalPercentage: WireWithdrawalPercentage, ): string { return JSON.stringify( WireWithdrawalPercentage$outboundSchema.parse(wireWithdrawalPercentage), ); } export function wireWithdrawalPercentageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalPercentage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalPercentage' from JSON`, ); } /** @internal */ export const WireWithdrawalFederalTaxWithholding$inboundSchema: z.ZodType< WireWithdrawalFederalTaxWithholding, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalIraDistributionAmount$inboundSchema), ).optional(), percentage: z.nullable(z.lazy(() => WireWithdrawalPercentage$inboundSchema)) .optional(), }); /** @internal */ export type WireWithdrawalFederalTaxWithholding$Outbound = { amount?: WireWithdrawalIraDistributionAmount$Outbound | null | undefined; percentage?: WireWithdrawalPercentage$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalFederalTaxWithholding$outboundSchema: z.ZodType< WireWithdrawalFederalTaxWithholding$Outbound, z.ZodTypeDef, WireWithdrawalFederalTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalIraDistributionAmount$outboundSchema), ).optional(), percentage: z.nullable(z.lazy(() => WireWithdrawalPercentage$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 WireWithdrawalFederalTaxWithholding$ { /** @deprecated use `WireWithdrawalFederalTaxWithholding$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalFederalTaxWithholding$inboundSchema; /** @deprecated use `WireWithdrawalFederalTaxWithholding$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalFederalTaxWithholding$outboundSchema; /** @deprecated use `WireWithdrawalFederalTaxWithholding$Outbound` instead. */ export type Outbound = WireWithdrawalFederalTaxWithholding$Outbound; } export function wireWithdrawalFederalTaxWithholdingToJSON( wireWithdrawalFederalTaxWithholding: WireWithdrawalFederalTaxWithholding, ): string { return JSON.stringify( WireWithdrawalFederalTaxWithholding$outboundSchema.parse( wireWithdrawalFederalTaxWithholding, ), ); } export function wireWithdrawalFederalTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalFederalTaxWithholding$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalFederalTaxWithholding' from JSON`, ); } /** @internal */ export const WireWithdrawalIraDistributionStateTaxWithholdingAmount$inboundSchema: z.ZodType< WireWithdrawalIraDistributionStateTaxWithholdingAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalIraDistributionStateTaxWithholdingAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalIraDistributionStateTaxWithholdingAmount$outboundSchema: z.ZodType< WireWithdrawalIraDistributionStateTaxWithholdingAmount$Outbound, z.ZodTypeDef, WireWithdrawalIraDistributionStateTaxWithholdingAmount > = 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 WireWithdrawalIraDistributionStateTaxWithholdingAmount$ { /** @deprecated use `WireWithdrawalIraDistributionStateTaxWithholdingAmount$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIraDistributionStateTaxWithholdingAmount$inboundSchema; /** @deprecated use `WireWithdrawalIraDistributionStateTaxWithholdingAmount$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIraDistributionStateTaxWithholdingAmount$outboundSchema; /** @deprecated use `WireWithdrawalIraDistributionStateTaxWithholdingAmount$Outbound` instead. */ export type Outbound = WireWithdrawalIraDistributionStateTaxWithholdingAmount$Outbound; } export function wireWithdrawalIraDistributionStateTaxWithholdingAmountToJSON( wireWithdrawalIraDistributionStateTaxWithholdingAmount: WireWithdrawalIraDistributionStateTaxWithholdingAmount, ): string { return JSON.stringify( WireWithdrawalIraDistributionStateTaxWithholdingAmount$outboundSchema.parse( wireWithdrawalIraDistributionStateTaxWithholdingAmount, ), ); } export function wireWithdrawalIraDistributionStateTaxWithholdingAmountFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalIraDistributionStateTaxWithholdingAmount, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalIraDistributionStateTaxWithholdingAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIraDistributionStateTaxWithholdingAmount' from JSON`, ); } /** @internal */ export const WireWithdrawalIraDistributionPercentage$inboundSchema: z.ZodType< WireWithdrawalIraDistributionPercentage, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type WireWithdrawalIraDistributionPercentage$Outbound = { value?: string | undefined; }; /** @internal */ export const WireWithdrawalIraDistributionPercentage$outboundSchema: z.ZodType< WireWithdrawalIraDistributionPercentage$Outbound, z.ZodTypeDef, WireWithdrawalIraDistributionPercentage > = 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 WireWithdrawalIraDistributionPercentage$ { /** @deprecated use `WireWithdrawalIraDistributionPercentage$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIraDistributionPercentage$inboundSchema; /** @deprecated use `WireWithdrawalIraDistributionPercentage$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIraDistributionPercentage$outboundSchema; /** @deprecated use `WireWithdrawalIraDistributionPercentage$Outbound` instead. */ export type Outbound = WireWithdrawalIraDistributionPercentage$Outbound; } export function wireWithdrawalIraDistributionPercentageToJSON( wireWithdrawalIraDistributionPercentage: WireWithdrawalIraDistributionPercentage, ): string { return JSON.stringify( WireWithdrawalIraDistributionPercentage$outboundSchema.parse( wireWithdrawalIraDistributionPercentage, ), ); } export function wireWithdrawalIraDistributionPercentageFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalIraDistributionPercentage, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalIraDistributionPercentage$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalIraDistributionPercentage' from JSON`, ); } /** @internal */ export const WireWithdrawalStateTaxWithholding$inboundSchema: z.ZodType< WireWithdrawalStateTaxWithholding, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalIraDistributionStateTaxWithholdingAmount$inboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalIraDistributionPercentage$inboundSchema), ).optional(), }); /** @internal */ export type WireWithdrawalStateTaxWithholding$Outbound = { amount?: | WireWithdrawalIraDistributionStateTaxWithholdingAmount$Outbound | null | undefined; percentage?: | WireWithdrawalIraDistributionPercentage$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalStateTaxWithholding$outboundSchema: z.ZodType< WireWithdrawalStateTaxWithholding$Outbound, z.ZodTypeDef, WireWithdrawalStateTaxWithholding > = z.object({ amount: z.nullable( z.lazy(() => WireWithdrawalIraDistributionStateTaxWithholdingAmount$outboundSchema ), ).optional(), percentage: z.nullable( z.lazy(() => WireWithdrawalIraDistributionPercentage$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 WireWithdrawalStateTaxWithholding$ { /** @deprecated use `WireWithdrawalStateTaxWithholding$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalStateTaxWithholding$inboundSchema; /** @deprecated use `WireWithdrawalStateTaxWithholding$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalStateTaxWithholding$outboundSchema; /** @deprecated use `WireWithdrawalStateTaxWithholding$Outbound` instead. */ export type Outbound = WireWithdrawalStateTaxWithholding$Outbound; } export function wireWithdrawalStateTaxWithholdingToJSON( wireWithdrawalStateTaxWithholding: WireWithdrawalStateTaxWithholding, ): string { return JSON.stringify( WireWithdrawalStateTaxWithholding$outboundSchema.parse( wireWithdrawalStateTaxWithholding, ), ); } export function wireWithdrawalStateTaxWithholdingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalStateTaxWithholding$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalStateTaxWithholding' from JSON`, ); } /** @internal */ export const WireWithdrawalType$inboundSchema: z.ZodType< WireWithdrawalTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalType$outboundSchema: z.ZodType< WireWithdrawalTypeOpen, z.ZodTypeDef, WireWithdrawalTypeOpen > = z.union([ z.nativeEnum(WireWithdrawalType), 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 WireWithdrawalType$ { /** @deprecated use `WireWithdrawalType$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalType$inboundSchema; /** @deprecated use `WireWithdrawalType$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalType$outboundSchema; } /** @internal */ export const WireWithdrawalIraDistribution$inboundSchema: z.ZodType< WireWithdrawalIraDistribution, z.ZodTypeDef, unknown > = z.object({ federal_tax_withholding: z.nullable( z.lazy(() => WireWithdrawalFederalTaxWithholding$inboundSchema), ).optional(), receiving_institution: z.string().optional(), state_tax_withholding: z.nullable( z.lazy(() => WireWithdrawalStateTaxWithholding$inboundSchema), ).optional(), state_withholding_waiver: z.boolean().optional(), tax_year: z.number().int().optional(), type: WireWithdrawalType$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 WireWithdrawalIraDistribution$Outbound = { federal_tax_withholding?: | WireWithdrawalFederalTaxWithholding$Outbound | null | undefined; receiving_institution?: string | undefined; state_tax_withholding?: | WireWithdrawalStateTaxWithholding$Outbound | null | undefined; state_withholding_waiver?: boolean | undefined; tax_year?: number | undefined; type?: string | undefined; }; /** @internal */ export const WireWithdrawalIraDistribution$outboundSchema: z.ZodType< WireWithdrawalIraDistribution$Outbound, z.ZodTypeDef, WireWithdrawalIraDistribution > = z.object({ federalTaxWithholding: z.nullable( z.lazy(() => WireWithdrawalFederalTaxWithholding$outboundSchema), ).optional(), receivingInstitution: z.string().optional(), stateTaxWithholding: z.nullable( z.lazy(() => WireWithdrawalStateTaxWithholding$outboundSchema), ).optional(), stateWithholdingWaiver: z.boolean().optional(), taxYear: z.number().int().optional(), type: WireWithdrawalType$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 WireWithdrawalIraDistribution$ { /** @deprecated use `WireWithdrawalIraDistribution$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIraDistribution$inboundSchema; /** @deprecated use `WireWithdrawalIraDistribution$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIraDistribution$outboundSchema; /** @deprecated use `WireWithdrawalIraDistribution$Outbound` instead. */ export type Outbound = WireWithdrawalIraDistribution$Outbound; } export function wireWithdrawalIraDistributionToJSON( wireWithdrawalIraDistribution: WireWithdrawalIraDistribution, ): string { return JSON.stringify( WireWithdrawalIraDistribution$outboundSchema.parse( wireWithdrawalIraDistribution, ), ); } export function wireWithdrawalIraDistributionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalIraDistribution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIraDistribution' from JSON`, ); } /** @internal */ export const WireWithdrawalRecipientBankType$inboundSchema: z.ZodType< WireWithdrawalRecipientBankTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalRecipientBankType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalRecipientBankType$outboundSchema: z.ZodType< WireWithdrawalRecipientBankTypeOpen, z.ZodTypeDef, WireWithdrawalRecipientBankTypeOpen > = z.union([ z.nativeEnum(WireWithdrawalRecipientBankType), 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 WireWithdrawalRecipientBankType$ { /** @deprecated use `WireWithdrawalRecipientBankType$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalRecipientBankType$inboundSchema; /** @deprecated use `WireWithdrawalRecipientBankType$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalRecipientBankType$outboundSchema; } /** @internal */ export const WireWithdrawalBankId$inboundSchema: z.ZodType< WireWithdrawalBankId, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), type: WireWithdrawalRecipientBankType$inboundSchema.optional(), }); /** @internal */ export type WireWithdrawalBankId$Outbound = { id?: string | undefined; type?: string | undefined; }; /** @internal */ export const WireWithdrawalBankId$outboundSchema: z.ZodType< WireWithdrawalBankId$Outbound, z.ZodTypeDef, WireWithdrawalBankId > = z.object({ id: z.string().optional(), type: WireWithdrawalRecipientBankType$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 WireWithdrawalBankId$ { /** @deprecated use `WireWithdrawalBankId$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalBankId$inboundSchema; /** @deprecated use `WireWithdrawalBankId$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalBankId$outboundSchema; /** @deprecated use `WireWithdrawalBankId$Outbound` instead. */ export type Outbound = WireWithdrawalBankId$Outbound; } export function wireWithdrawalBankIdToJSON( wireWithdrawalBankId: WireWithdrawalBankId, ): string { return JSON.stringify( WireWithdrawalBankId$outboundSchema.parse(wireWithdrawalBankId), ); } export function wireWithdrawalBankIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalBankId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalBankId' from JSON`, ); } /** @internal */ export const WireWithdrawalRecipientBankAddress$inboundSchema: z.ZodType< WireWithdrawalRecipientBankAddress, 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 WireWithdrawalRecipientBankAddress$Outbound = { city?: string | undefined; country?: string | undefined; postal_code?: string | undefined; state?: string | undefined; streetAddress?: Array | undefined; }; /** @internal */ export const WireWithdrawalRecipientBankAddress$outboundSchema: z.ZodType< WireWithdrawalRecipientBankAddress$Outbound, z.ZodTypeDef, WireWithdrawalRecipientBankAddress > = 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 WireWithdrawalRecipientBankAddress$ { /** @deprecated use `WireWithdrawalRecipientBankAddress$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalRecipientBankAddress$inboundSchema; /** @deprecated use `WireWithdrawalRecipientBankAddress$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalRecipientBankAddress$outboundSchema; /** @deprecated use `WireWithdrawalRecipientBankAddress$Outbound` instead. */ export type Outbound = WireWithdrawalRecipientBankAddress$Outbound; } export function wireWithdrawalRecipientBankAddressToJSON( wireWithdrawalRecipientBankAddress: WireWithdrawalRecipientBankAddress, ): string { return JSON.stringify( WireWithdrawalRecipientBankAddress$outboundSchema.parse( wireWithdrawalRecipientBankAddress, ), ); } export function wireWithdrawalRecipientBankAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalRecipientBankAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalRecipientBankAddress' from JSON`, ); } /** @internal */ export const WireWithdrawalInternationalBankDetails$inboundSchema: z.ZodType< WireWithdrawalInternationalBankDetails, z.ZodTypeDef, unknown > = z.object({ additional_info: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalRecipientBankAddress$inboundSchema), ).optional(), bank_name: z.string().optional(), }).transform((v) => { return remap$(v, { "additional_info": "additionalInfo", "bank_name": "bankName", }); }); /** @internal */ export type WireWithdrawalInternationalBankDetails$Outbound = { additional_info?: string | undefined; address?: WireWithdrawalRecipientBankAddress$Outbound | null | undefined; bank_name?: string | undefined; }; /** @internal */ export const WireWithdrawalInternationalBankDetails$outboundSchema: z.ZodType< WireWithdrawalInternationalBankDetails$Outbound, z.ZodTypeDef, WireWithdrawalInternationalBankDetails > = z.object({ additionalInfo: z.string().optional(), address: z.nullable( z.lazy(() => WireWithdrawalRecipientBankAddress$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 WireWithdrawalInternationalBankDetails$ { /** @deprecated use `WireWithdrawalInternationalBankDetails$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalInternationalBankDetails$inboundSchema; /** @deprecated use `WireWithdrawalInternationalBankDetails$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalInternationalBankDetails$outboundSchema; /** @deprecated use `WireWithdrawalInternationalBankDetails$Outbound` instead. */ export type Outbound = WireWithdrawalInternationalBankDetails$Outbound; } export function wireWithdrawalInternationalBankDetailsToJSON( wireWithdrawalInternationalBankDetails: WireWithdrawalInternationalBankDetails, ): string { return JSON.stringify( WireWithdrawalInternationalBankDetails$outboundSchema.parse( wireWithdrawalInternationalBankDetails, ), ); } export function wireWithdrawalInternationalBankDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalInternationalBankDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalInternationalBankDetails' from JSON`, ); } /** @internal */ export const WireWithdrawalRecipientBank$inboundSchema: z.ZodType< WireWithdrawalRecipientBank, z.ZodTypeDef, unknown > = z.object({ bank_id: z.nullable(z.lazy(() => WireWithdrawalBankId$inboundSchema)) .optional(), international_bank_details: z.nullable( z.lazy(() => WireWithdrawalInternationalBankDetails$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "bank_id": "bankId", "international_bank_details": "internationalBankDetails", }); }); /** @internal */ export type WireWithdrawalRecipientBank$Outbound = { bank_id?: WireWithdrawalBankId$Outbound | null | undefined; international_bank_details?: | WireWithdrawalInternationalBankDetails$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawalRecipientBank$outboundSchema: z.ZodType< WireWithdrawalRecipientBank$Outbound, z.ZodTypeDef, WireWithdrawalRecipientBank > = z.object({ bankId: z.nullable(z.lazy(() => WireWithdrawalBankId$outboundSchema)) .optional(), internationalBankDetails: z.nullable( z.lazy(() => WireWithdrawalInternationalBankDetails$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 WireWithdrawalRecipientBank$ { /** @deprecated use `WireWithdrawalRecipientBank$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalRecipientBank$inboundSchema; /** @deprecated use `WireWithdrawalRecipientBank$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalRecipientBank$outboundSchema; /** @deprecated use `WireWithdrawalRecipientBank$Outbound` instead. */ export type Outbound = WireWithdrawalRecipientBank$Outbound; } export function wireWithdrawalRecipientBankToJSON( wireWithdrawalRecipientBank: WireWithdrawalRecipientBank, ): string { return JSON.stringify( WireWithdrawalRecipientBank$outboundSchema.parse( wireWithdrawalRecipientBank, ), ); } export function wireWithdrawalRecipientBankFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalRecipientBank$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalRecipientBank' from JSON`, ); } /** @internal */ export const WireWithdrawalStateState$inboundSchema: z.ZodType< WireWithdrawalStateStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WireWithdrawalStateState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WireWithdrawalStateState$outboundSchema: z.ZodType< WireWithdrawalStateStateOpen, z.ZodTypeDef, WireWithdrawalStateStateOpen > = z.union([ z.nativeEnum(WireWithdrawalStateState), 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 WireWithdrawalStateState$ { /** @deprecated use `WireWithdrawalStateState$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalStateState$inboundSchema; /** @deprecated use `WireWithdrawalStateState$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalStateState$outboundSchema; } /** @internal */ export const WireWithdrawalState$inboundSchema: z.ZodType< WireWithdrawalState, z.ZodTypeDef, unknown > = z.object({ actor: z.string().optional(), message: z.string().optional(), metadata: z.nullable(z.record(z.any())).optional(), state: WireWithdrawalStateState$inboundSchema.optional(), update_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "update_time": "updateTime", }); }); /** @internal */ export type WireWithdrawalState$Outbound = { actor?: string | undefined; message?: string | undefined; metadata?: { [k: string]: any } | null | undefined; state?: string | undefined; update_time?: string | null | undefined; }; /** @internal */ export const WireWithdrawalState$outboundSchema: z.ZodType< WireWithdrawalState$Outbound, z.ZodTypeDef, WireWithdrawalState > = z.object({ actor: z.string().optional(), message: z.string().optional(), metadata: z.nullable(z.record(z.any())).optional(), state: WireWithdrawalStateState$outboundSchema.optional(), updateTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { updateTime: "update_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalState$ { /** @deprecated use `WireWithdrawalState$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalState$inboundSchema; /** @deprecated use `WireWithdrawalState$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalState$outboundSchema; /** @deprecated use `WireWithdrawalState$Outbound` instead. */ export type Outbound = WireWithdrawalState$Outbound; } export function wireWithdrawalStateToJSON( wireWithdrawalState: WireWithdrawalState, ): string { return JSON.stringify( WireWithdrawalState$outboundSchema.parse(wireWithdrawalState), ); } export function wireWithdrawalStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalState' from JSON`, ); } /** @internal */ export const WireWithdrawal$inboundSchema: z.ZodType< WireWithdrawal, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable(z.lazy(() => WireWithdrawalAmount$inboundSchema)) .optional(), beneficiary: z.nullable(z.lazy(() => WireWithdrawalBeneficiary$inboundSchema)) .optional(), client_transfer_id: z.string().optional(), fed_reference_number: z.string().optional(), intermediary: z.nullable( z.lazy(() => WireWithdrawalIntermediary$inboundSchema), ).optional(), ira_distribution: z.nullable( z.lazy(() => WireWithdrawalIraDistribution$inboundSchema), ).optional(), name: z.string().optional(), recipient_bank: z.nullable( z.lazy(() => WireWithdrawalRecipientBank$inboundSchema), ).optional(), state: z.nullable(z.lazy(() => WireWithdrawalState$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "client_transfer_id": "clientTransferId", "fed_reference_number": "fedReferenceNumber", "ira_distribution": "iraDistribution", "recipient_bank": "recipientBank", }); }); /** @internal */ export type WireWithdrawal$Outbound = { amount?: WireWithdrawalAmount$Outbound | null | undefined; beneficiary?: WireWithdrawalBeneficiary$Outbound | null | undefined; client_transfer_id?: string | undefined; fed_reference_number?: string | undefined; intermediary?: WireWithdrawalIntermediary$Outbound | null | undefined; ira_distribution?: WireWithdrawalIraDistribution$Outbound | null | undefined; name?: string | undefined; recipient_bank?: WireWithdrawalRecipientBank$Outbound | null | undefined; state?: WireWithdrawalState$Outbound | null | undefined; }; /** @internal */ export const WireWithdrawal$outboundSchema: z.ZodType< WireWithdrawal$Outbound, z.ZodTypeDef, WireWithdrawal > = z.object({ amount: z.nullable(z.lazy(() => WireWithdrawalAmount$outboundSchema)) .optional(), beneficiary: z.nullable( z.lazy(() => WireWithdrawalBeneficiary$outboundSchema), ).optional(), clientTransferId: z.string().optional(), fedReferenceNumber: z.string().optional(), intermediary: z.nullable( z.lazy(() => WireWithdrawalIntermediary$outboundSchema), ).optional(), iraDistribution: z.nullable( z.lazy(() => WireWithdrawalIraDistribution$outboundSchema), ).optional(), name: z.string().optional(), recipientBank: z.nullable( z.lazy(() => WireWithdrawalRecipientBank$outboundSchema), ).optional(), state: z.nullable(z.lazy(() => WireWithdrawalState$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { clientTransferId: "client_transfer_id", fedReferenceNumber: "fed_reference_number", iraDistribution: "ira_distribution", recipientBank: "recipient_bank", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawal$ { /** @deprecated use `WireWithdrawal$inboundSchema` instead. */ export const inboundSchema = WireWithdrawal$inboundSchema; /** @deprecated use `WireWithdrawal$outboundSchema` instead. */ export const outboundSchema = WireWithdrawal$outboundSchema; /** @deprecated use `WireWithdrawal$Outbound` instead. */ export type Outbound = WireWithdrawal$Outbound; } export function wireWithdrawalToJSON(wireWithdrawal: WireWithdrawal): string { return JSON.stringify(WireWithdrawal$outboundSchema.parse(wireWithdrawal)); } export function wireWithdrawalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawal' from JSON`, ); }