/* * 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 { AddressCreate, AddressCreate$inboundSchema, AddressCreate$Outbound, AddressCreate$outboundSchema, } from "./addresscreate.js"; /** * The person or entity taking receipt of the wired funds */ export type WireWithdrawalBeneficiaryCreate = { /** * 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; /** * 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 data structure containing attributes describing the location of an underlying entity. */ address?: AddressCreate | 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; }; /** @internal */ export const WireWithdrawalBeneficiaryCreate$inboundSchema: z.ZodType< WireWithdrawalBeneficiaryCreate, z.ZodTypeDef, unknown > = z.object({ account: z.string(), account_title: z.string().optional(), address: AddressCreate$inboundSchema.optional(), third_party: z.boolean().optional(), }).transform((v) => { return remap$(v, { "account_title": "accountTitle", "third_party": "thirdParty", }); }); /** @internal */ export type WireWithdrawalBeneficiaryCreate$Outbound = { account: string; account_title?: string | undefined; address?: AddressCreate$Outbound | undefined; third_party?: boolean | undefined; }; /** @internal */ export const WireWithdrawalBeneficiaryCreate$outboundSchema: z.ZodType< WireWithdrawalBeneficiaryCreate$Outbound, z.ZodTypeDef, WireWithdrawalBeneficiaryCreate > = z.object({ account: z.string(), accountTitle: z.string().optional(), address: AddressCreate$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 WireWithdrawalBeneficiaryCreate$ { /** @deprecated use `WireWithdrawalBeneficiaryCreate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalBeneficiaryCreate$inboundSchema; /** @deprecated use `WireWithdrawalBeneficiaryCreate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalBeneficiaryCreate$outboundSchema; /** @deprecated use `WireWithdrawalBeneficiaryCreate$Outbound` instead. */ export type Outbound = WireWithdrawalBeneficiaryCreate$Outbound; } export function wireWithdrawalBeneficiaryCreateToJSON( wireWithdrawalBeneficiaryCreate: WireWithdrawalBeneficiaryCreate, ): string { return JSON.stringify( WireWithdrawalBeneficiaryCreate$outboundSchema.parse( wireWithdrawalBeneficiaryCreate, ), ); } export function wireWithdrawalBeneficiaryCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalBeneficiaryCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalBeneficiaryCreate' from JSON`, ); }