/* * 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 { RecipientBankBankDetailsCreate, RecipientBankBankDetailsCreate$inboundSchema, RecipientBankBankDetailsCreate$Outbound, RecipientBankBankDetailsCreate$outboundSchema, } from "./recipientbankbankdetailscreate.js"; import { RecipientBankBankIdCreate, RecipientBankBankIdCreate$inboundSchema, RecipientBankBankIdCreate$Outbound, RecipientBankBankIdCreate$outboundSchema, } from "./recipientbankbankidcreate.js"; /** * A recipient bank / financial institution */ export type WireWithdrawalRecipientBankCreate = { /** * A bank identifier */ bankId: RecipientBankBankIdCreate; /** * Bank details */ internationalBankDetails?: RecipientBankBankDetailsCreate | undefined; }; /** @internal */ export const WireWithdrawalRecipientBankCreate$inboundSchema: z.ZodType< WireWithdrawalRecipientBankCreate, z.ZodTypeDef, unknown > = z.object({ bank_id: RecipientBankBankIdCreate$inboundSchema, international_bank_details: RecipientBankBankDetailsCreate$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "bank_id": "bankId", "international_bank_details": "internationalBankDetails", }); }); /** @internal */ export type WireWithdrawalRecipientBankCreate$Outbound = { bank_id: RecipientBankBankIdCreate$Outbound; international_bank_details?: | RecipientBankBankDetailsCreate$Outbound | undefined; }; /** @internal */ export const WireWithdrawalRecipientBankCreate$outboundSchema: z.ZodType< WireWithdrawalRecipientBankCreate$Outbound, z.ZodTypeDef, WireWithdrawalRecipientBankCreate > = z.object({ bankId: RecipientBankBankIdCreate$outboundSchema, internationalBankDetails: RecipientBankBankDetailsCreate$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 WireWithdrawalRecipientBankCreate$ { /** @deprecated use `WireWithdrawalRecipientBankCreate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalRecipientBankCreate$inboundSchema; /** @deprecated use `WireWithdrawalRecipientBankCreate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalRecipientBankCreate$outboundSchema; /** @deprecated use `WireWithdrawalRecipientBankCreate$Outbound` instead. */ export type Outbound = WireWithdrawalRecipientBankCreate$Outbound; } export function wireWithdrawalRecipientBankCreateToJSON( wireWithdrawalRecipientBankCreate: WireWithdrawalRecipientBankCreate, ): string { return JSON.stringify( WireWithdrawalRecipientBankCreate$outboundSchema.parse( wireWithdrawalRecipientBankCreate, ), ); } export function wireWithdrawalRecipientBankCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalRecipientBankCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalRecipientBankCreate' from JSON`, ); }