/* * 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 { DepositedFundsCreate, DepositedFundsCreate$inboundSchema, DepositedFundsCreate$Outbound, DepositedFundsCreate$outboundSchema, } from "./depositedfundscreate.js"; import { FinancialProfileCreate, FinancialProfileCreate$inboundSchema, FinancialProfileCreate$Outbound, FinancialProfileCreate$outboundSchema, } from "./financialprofilecreate.js"; import { PlannedActivityCreate, PlannedActivityCreate$inboundSchema, PlannedActivityCreate$Outbound, PlannedActivityCreate$outboundSchema, } from "./plannedactivitycreate.js"; import { RelatedPepDetailsCreate, RelatedPepDetailsCreate$inboundSchema, RelatedPepDetailsCreate$Outbound, RelatedPepDetailsCreate$outboundSchema, } from "./relatedpepdetailscreate.js"; /** * Enrollment metadata for Accounts that have a foreign Legal Natural Person owner. */ export type ForeignNaturalPersonAccountEnrollmentMetadataCreate = { /** * The initial amount of money placed into the account by the entity upon or after the account's establishment. */ depositedFunds: DepositedFundsCreate; /** * Disclosure of the entity account owner's financial relationships and source of brokerage funds; facilitates the creation of the overall customer risk profile */ financialProfile: FinancialProfileCreate; /** * Details the customer's intended trading and banking-related activities at the time of account application; informs risk checks and forms a baseline for anomalous activity detection */ plannedActivity: PlannedActivityCreate; /** * Details surrounding the related politically exposed persons */ relatedPepDetails: RelatedPepDetailsCreate; }; /** @internal */ export const ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema: z.ZodType< ForeignNaturalPersonAccountEnrollmentMetadataCreate, z.ZodTypeDef, unknown > = z.object({ deposited_funds: DepositedFundsCreate$inboundSchema, financial_profile: FinancialProfileCreate$inboundSchema, planned_activity: PlannedActivityCreate$inboundSchema, related_pep_details: RelatedPepDetailsCreate$inboundSchema, }).transform((v) => { return remap$(v, { "deposited_funds": "depositedFunds", "financial_profile": "financialProfile", "planned_activity": "plannedActivity", "related_pep_details": "relatedPepDetails", }); }); /** @internal */ export type ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound = { deposited_funds: DepositedFundsCreate$Outbound; financial_profile: FinancialProfileCreate$Outbound; planned_activity: PlannedActivityCreate$Outbound; related_pep_details: RelatedPepDetailsCreate$Outbound; }; /** @internal */ export const ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema: z.ZodType< ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound, z.ZodTypeDef, ForeignNaturalPersonAccountEnrollmentMetadataCreate > = z.object({ depositedFunds: DepositedFundsCreate$outboundSchema, financialProfile: FinancialProfileCreate$outboundSchema, plannedActivity: PlannedActivityCreate$outboundSchema, relatedPepDetails: RelatedPepDetailsCreate$outboundSchema, }).transform((v) => { return remap$(v, { depositedFunds: "deposited_funds", financialProfile: "financial_profile", plannedActivity: "planned_activity", relatedPepDetails: "related_pep_details", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ForeignNaturalPersonAccountEnrollmentMetadataCreate$ { /** @deprecated use `ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema` instead. */ export const inboundSchema = ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema; /** @deprecated use `ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema` instead. */ export const outboundSchema = ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema; /** @deprecated use `ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound` instead. */ export type Outbound = ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound; } export function foreignNaturalPersonAccountEnrollmentMetadataCreateToJSON( foreignNaturalPersonAccountEnrollmentMetadataCreate: ForeignNaturalPersonAccountEnrollmentMetadataCreate, ): string { return JSON.stringify( ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema.parse( foreignNaturalPersonAccountEnrollmentMetadataCreate, ), ); } export function foreignNaturalPersonAccountEnrollmentMetadataCreateFromJSON( jsonString: string, ): SafeParseResult< ForeignNaturalPersonAccountEnrollmentMetadataCreate, SDKValidationError > { return safeParse( jsonString, (x) => ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ForeignNaturalPersonAccountEnrollmentMetadataCreate' from JSON`, ); }