/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { RetirementDistributionCreate, RetirementDistributionCreate$inboundSchema, RetirementDistributionCreate$Outbound, RetirementDistributionCreate$outboundSchema, } from "./retirementdistributioncreate.js"; import { WireWithdrawalBeneficiaryCreate, WireWithdrawalBeneficiaryCreate$inboundSchema, WireWithdrawalBeneficiaryCreate$Outbound, WireWithdrawalBeneficiaryCreate$outboundSchema, } from "./wirewithdrawalbeneficiarycreate.js"; import { WireWithdrawalIntermediaryCreate, WireWithdrawalIntermediaryCreate$inboundSchema, WireWithdrawalIntermediaryCreate$Outbound, WireWithdrawalIntermediaryCreate$outboundSchema, } from "./wirewithdrawalintermediarycreate.js"; import { WireWithdrawalRecipientBankCreate, WireWithdrawalRecipientBankCreate$inboundSchema, WireWithdrawalRecipientBankCreate$Outbound, WireWithdrawalRecipientBankCreate$outboundSchema, } from "./wirewithdrawalrecipientbankcreate.js"; import { WithdrawalScheduleDetailsCreate, WithdrawalScheduleDetailsCreate$inboundSchema, WithdrawalScheduleDetailsCreate$Outbound, WithdrawalScheduleDetailsCreate$outboundSchema, } from "./withdrawalscheduledetailscreate.js"; /** * A withdrawal transfer schedule using the Wire mechanism */ export type WireWithdrawalScheduleCreate = { /** * The person or entity taking receipt of the wired funds */ beneficiary: WireWithdrawalBeneficiaryCreate; /** * An intermediary party */ intermediary?: WireWithdrawalIntermediaryCreate | undefined; /** * A recipient bank / financial institution */ recipientBank: WireWithdrawalRecipientBankCreate; /** * A distribution from a retirement account. */ retirementDistribution?: RetirementDistributionCreate | undefined; /** * Details of withdrawal schedule transfers */ scheduleDetails: WithdrawalScheduleDetailsCreate; }; /** @internal */ export const WireWithdrawalScheduleCreate$inboundSchema: z.ZodType< WireWithdrawalScheduleCreate, z.ZodTypeDef, unknown > = z.object({ beneficiary: WireWithdrawalBeneficiaryCreate$inboundSchema, intermediary: WireWithdrawalIntermediaryCreate$inboundSchema.optional(), recipient_bank: WireWithdrawalRecipientBankCreate$inboundSchema, retirement_distribution: RetirementDistributionCreate$inboundSchema .optional(), schedule_details: WithdrawalScheduleDetailsCreate$inboundSchema, }).transform((v) => { return remap$(v, { "recipient_bank": "recipientBank", "retirement_distribution": "retirementDistribution", "schedule_details": "scheduleDetails", }); }); /** @internal */ export type WireWithdrawalScheduleCreate$Outbound = { beneficiary: WireWithdrawalBeneficiaryCreate$Outbound; intermediary?: WireWithdrawalIntermediaryCreate$Outbound | undefined; recipient_bank: WireWithdrawalRecipientBankCreate$Outbound; retirement_distribution?: RetirementDistributionCreate$Outbound | undefined; schedule_details: WithdrawalScheduleDetailsCreate$Outbound; }; /** @internal */ export const WireWithdrawalScheduleCreate$outboundSchema: z.ZodType< WireWithdrawalScheduleCreate$Outbound, z.ZodTypeDef, WireWithdrawalScheduleCreate > = z.object({ beneficiary: WireWithdrawalBeneficiaryCreate$outboundSchema, intermediary: WireWithdrawalIntermediaryCreate$outboundSchema.optional(), recipientBank: WireWithdrawalRecipientBankCreate$outboundSchema, retirementDistribution: RetirementDistributionCreate$outboundSchema .optional(), scheduleDetails: WithdrawalScheduleDetailsCreate$outboundSchema, }).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 WireWithdrawalScheduleCreate$ { /** @deprecated use `WireWithdrawalScheduleCreate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalScheduleCreate$inboundSchema; /** @deprecated use `WireWithdrawalScheduleCreate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalScheduleCreate$outboundSchema; /** @deprecated use `WireWithdrawalScheduleCreate$Outbound` instead. */ export type Outbound = WireWithdrawalScheduleCreate$Outbound; } export function wireWithdrawalScheduleCreateToJSON( wireWithdrawalScheduleCreate: WireWithdrawalScheduleCreate, ): string { return JSON.stringify( WireWithdrawalScheduleCreate$outboundSchema.parse( wireWithdrawalScheduleCreate, ), ); } export function wireWithdrawalScheduleCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalScheduleCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalScheduleCreate' from JSON`, ); }