/* * 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"; /** * An intermediary party */ export type WireWithdrawalIntermediaryCreate = { /** * The account number of the intermediary party */ account: string; /** * The name of the intermediary party */ accountTitle: string; /** * The data structure containing attributes describing the location of an underlying entity. */ address: AddressCreate; }; /** @internal */ export const WireWithdrawalIntermediaryCreate$inboundSchema: z.ZodType< WireWithdrawalIntermediaryCreate, z.ZodTypeDef, unknown > = z.object({ account: z.string(), account_title: z.string(), address: AddressCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_title": "accountTitle", }); }); /** @internal */ export type WireWithdrawalIntermediaryCreate$Outbound = { account: string; account_title: string; address: AddressCreate$Outbound; }; /** @internal */ export const WireWithdrawalIntermediaryCreate$outboundSchema: z.ZodType< WireWithdrawalIntermediaryCreate$Outbound, z.ZodTypeDef, WireWithdrawalIntermediaryCreate > = z.object({ account: z.string(), accountTitle: z.string(), address: AddressCreate$outboundSchema, }).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 WireWithdrawalIntermediaryCreate$ { /** @deprecated use `WireWithdrawalIntermediaryCreate$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalIntermediaryCreate$inboundSchema; /** @deprecated use `WireWithdrawalIntermediaryCreate$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalIntermediaryCreate$outboundSchema; /** @deprecated use `WireWithdrawalIntermediaryCreate$Outbound` instead. */ export type Outbound = WireWithdrawalIntermediaryCreate$Outbound; } export function wireWithdrawalIntermediaryCreateToJSON( wireWithdrawalIntermediaryCreate: WireWithdrawalIntermediaryCreate, ): string { return JSON.stringify( WireWithdrawalIntermediaryCreate$outboundSchema.parse( wireWithdrawalIntermediaryCreate, ), ); } export function wireWithdrawalIntermediaryCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireWithdrawalIntermediaryCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalIntermediaryCreate' from JSON`, ); }