/* * 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"; /** * Bank details */ export type RecipientBankBankDetailsCreate = { /** * Any additional information to be communicated to the recipient bank, such as intermediary banks to be used. */ additionalInfo?: string | undefined; /** * The data structure containing attributes describing the location of an underlying entity. */ address: AddressCreate; /** * The name of the recipient bank / financial institution */ bankName: string; }; /** @internal */ export const RecipientBankBankDetailsCreate$inboundSchema: z.ZodType< RecipientBankBankDetailsCreate, z.ZodTypeDef, unknown > = z.object({ additional_info: z.string().optional(), address: AddressCreate$inboundSchema, bank_name: z.string(), }).transform((v) => { return remap$(v, { "additional_info": "additionalInfo", "bank_name": "bankName", }); }); /** @internal */ export type RecipientBankBankDetailsCreate$Outbound = { additional_info?: string | undefined; address: AddressCreate$Outbound; bank_name: string; }; /** @internal */ export const RecipientBankBankDetailsCreate$outboundSchema: z.ZodType< RecipientBankBankDetailsCreate$Outbound, z.ZodTypeDef, RecipientBankBankDetailsCreate > = z.object({ additionalInfo: z.string().optional(), address: AddressCreate$outboundSchema, bankName: z.string(), }).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 RecipientBankBankDetailsCreate$ { /** @deprecated use `RecipientBankBankDetailsCreate$inboundSchema` instead. */ export const inboundSchema = RecipientBankBankDetailsCreate$inboundSchema; /** @deprecated use `RecipientBankBankDetailsCreate$outboundSchema` instead. */ export const outboundSchema = RecipientBankBankDetailsCreate$outboundSchema; /** @deprecated use `RecipientBankBankDetailsCreate$Outbound` instead. */ export type Outbound = RecipientBankBankDetailsCreate$Outbound; } export function recipientBankBankDetailsCreateToJSON( recipientBankBankDetailsCreate: RecipientBankBankDetailsCreate, ): string { return JSON.stringify( RecipientBankBankDetailsCreate$outboundSchema.parse( recipientBankBankDetailsCreate, ), ); } export function recipientBankBankDetailsCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RecipientBankBankDetailsCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RecipientBankBankDetailsCreate' from JSON`, ); }