/* * 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 { ExternalAccountCreate, ExternalAccountCreate$inboundSchema, ExternalAccountCreate$Outbound, ExternalAccountCreate$outboundSchema, } from "./externalaccountcreate.js"; /** * The delivering/receiving party information */ export type TransferAccountCreate = { /** * The internal apex account id */ apexAccountId?: string | undefined; /** * The external account information */ externalAccount?: ExternalAccountCreate | undefined; }; /** @internal */ export const TransferAccountCreate$inboundSchema: z.ZodType< TransferAccountCreate, z.ZodTypeDef, unknown > = z.object({ apex_account_id: z.string().optional(), external_account: ExternalAccountCreate$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "apex_account_id": "apexAccountId", "external_account": "externalAccount", }); }); /** @internal */ export type TransferAccountCreate$Outbound = { apex_account_id?: string | undefined; external_account?: ExternalAccountCreate$Outbound | undefined; }; /** @internal */ export const TransferAccountCreate$outboundSchema: z.ZodType< TransferAccountCreate$Outbound, z.ZodTypeDef, TransferAccountCreate > = z.object({ apexAccountId: z.string().optional(), externalAccount: ExternalAccountCreate$outboundSchema.optional(), }).transform((v) => { return remap$(v, { apexAccountId: "apex_account_id", externalAccount: "external_account", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TransferAccountCreate$ { /** @deprecated use `TransferAccountCreate$inboundSchema` instead. */ export const inboundSchema = TransferAccountCreate$inboundSchema; /** @deprecated use `TransferAccountCreate$outboundSchema` instead. */ export const outboundSchema = TransferAccountCreate$outboundSchema; /** @deprecated use `TransferAccountCreate$Outbound` instead. */ export type Outbound = TransferAccountCreate$Outbound; } export function transferAccountCreateToJSON( transferAccountCreate: TransferAccountCreate, ): string { return JSON.stringify( TransferAccountCreate$outboundSchema.parse(transferAccountCreate), ); } export function transferAccountCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TransferAccountCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferAccountCreate' from JSON`, ); }