/* * 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 { OtherAccountsCreate, OtherAccountsCreate$inboundSchema, OtherAccountsCreate$Outbound, OtherAccountsCreate$outboundSchema, } from "./otheraccountscreate.js"; /** * Disclosure of the entity account owner's financial relationships and source of brokerage funds; facilitates the creation of the overall customer risk profile */ export type FinancialProfileCreate = { /** * Bank names with whom the entity maintains a relationship with (e.g., accounts held with the bank) */ bankingRelationships: Array; /** * A customer-disclosed list of other Apex-held accounts owned by the Entity applicant at the time of this account's application; expressed as zero, one, or many account numbers */ otherAccounts: OtherAccountsCreate; /** * The primary source of funds that will be deposited to this account */ primarySourceOfDepositedFunds?: string | undefined; }; /** @internal */ export const FinancialProfileCreate$inboundSchema: z.ZodType< FinancialProfileCreate, z.ZodTypeDef, unknown > = z.object({ banking_relationships: z.array(z.string()), other_accounts: OtherAccountsCreate$inboundSchema, primary_source_of_deposited_funds: z.string().optional(), }).transform((v) => { return remap$(v, { "banking_relationships": "bankingRelationships", "other_accounts": "otherAccounts", "primary_source_of_deposited_funds": "primarySourceOfDepositedFunds", }); }); /** @internal */ export type FinancialProfileCreate$Outbound = { banking_relationships: Array; other_accounts: OtherAccountsCreate$Outbound; primary_source_of_deposited_funds?: string | undefined; }; /** @internal */ export const FinancialProfileCreate$outboundSchema: z.ZodType< FinancialProfileCreate$Outbound, z.ZodTypeDef, FinancialProfileCreate > = z.object({ bankingRelationships: z.array(z.string()), otherAccounts: OtherAccountsCreate$outboundSchema, primarySourceOfDepositedFunds: z.string().optional(), }).transform((v) => { return remap$(v, { bankingRelationships: "banking_relationships", otherAccounts: "other_accounts", primarySourceOfDepositedFunds: "primary_source_of_deposited_funds", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FinancialProfileCreate$ { /** @deprecated use `FinancialProfileCreate$inboundSchema` instead. */ export const inboundSchema = FinancialProfileCreate$inboundSchema; /** @deprecated use `FinancialProfileCreate$outboundSchema` instead. */ export const outboundSchema = FinancialProfileCreate$outboundSchema; /** @deprecated use `FinancialProfileCreate$Outbound` instead. */ export type Outbound = FinancialProfileCreate$Outbound; } export function financialProfileCreateToJSON( financialProfileCreate: FinancialProfileCreate, ): string { return JSON.stringify( FinancialProfileCreate$outboundSchema.parse(financialProfileCreate), ); } export function financialProfileCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FinancialProfileCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FinancialProfileCreate' from JSON`, ); }