/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.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"; /** * The client determined account risk rating of the entity customer */ export enum DeterminedAccountRiskRating { DeterminedAccountRiskRatingUnspecified = "DETERMINED_ACCOUNT_RISK_RATING_UNSPECIFIED", Low = "LOW", Medium = "MEDIUM", High = "HIGH", } /** * The client determined account risk rating of the entity customer */ export type DeterminedAccountRiskRatingOpen = OpenEnum< typeof DeterminedAccountRiskRating >; /** * Enrollment metadata for Entity Accounts */ export type EddAccountEnrollmentMetadataCreate = { /** * The initial amount of money placed into the account by the entity upon or after the account's establishment. */ depositedFunds: DepositedFundsCreate; /** * The client determined account risk rating of the entity customer */ determinedAccountRiskRating: DeterminedAccountRiskRatingOpen; /** * 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; /** * The scope of the business for the entity customer */ scopeOfBusiness: string; }; /** @internal */ export const DeterminedAccountRiskRating$inboundSchema: z.ZodType< DeterminedAccountRiskRatingOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(DeterminedAccountRiskRating), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const DeterminedAccountRiskRating$outboundSchema: z.ZodType< DeterminedAccountRiskRatingOpen, z.ZodTypeDef, DeterminedAccountRiskRatingOpen > = z.union([ z.nativeEnum(DeterminedAccountRiskRating), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DeterminedAccountRiskRating$ { /** @deprecated use `DeterminedAccountRiskRating$inboundSchema` instead. */ export const inboundSchema = DeterminedAccountRiskRating$inboundSchema; /** @deprecated use `DeterminedAccountRiskRating$outboundSchema` instead. */ export const outboundSchema = DeterminedAccountRiskRating$outboundSchema; } /** @internal */ export const EddAccountEnrollmentMetadataCreate$inboundSchema: z.ZodType< EddAccountEnrollmentMetadataCreate, z.ZodTypeDef, unknown > = z.object({ deposited_funds: DepositedFundsCreate$inboundSchema, determined_account_risk_rating: DeterminedAccountRiskRating$inboundSchema, financial_profile: FinancialProfileCreate$inboundSchema, planned_activity: PlannedActivityCreate$inboundSchema, related_pep_details: RelatedPepDetailsCreate$inboundSchema, scope_of_business: z.string(), }).transform((v) => { return remap$(v, { "deposited_funds": "depositedFunds", "determined_account_risk_rating": "determinedAccountRiskRating", "financial_profile": "financialProfile", "planned_activity": "plannedActivity", "related_pep_details": "relatedPepDetails", "scope_of_business": "scopeOfBusiness", }); }); /** @internal */ export type EddAccountEnrollmentMetadataCreate$Outbound = { deposited_funds: DepositedFundsCreate$Outbound; determined_account_risk_rating: string; financial_profile: FinancialProfileCreate$Outbound; planned_activity: PlannedActivityCreate$Outbound; related_pep_details: RelatedPepDetailsCreate$Outbound; scope_of_business: string; }; /** @internal */ export const EddAccountEnrollmentMetadataCreate$outboundSchema: z.ZodType< EddAccountEnrollmentMetadataCreate$Outbound, z.ZodTypeDef, EddAccountEnrollmentMetadataCreate > = z.object({ depositedFunds: DepositedFundsCreate$outboundSchema, determinedAccountRiskRating: DeterminedAccountRiskRating$outboundSchema, financialProfile: FinancialProfileCreate$outboundSchema, plannedActivity: PlannedActivityCreate$outboundSchema, relatedPepDetails: RelatedPepDetailsCreate$outboundSchema, scopeOfBusiness: z.string(), }).transform((v) => { return remap$(v, { depositedFunds: "deposited_funds", determinedAccountRiskRating: "determined_account_risk_rating", financialProfile: "financial_profile", plannedActivity: "planned_activity", relatedPepDetails: "related_pep_details", scopeOfBusiness: "scope_of_business", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EddAccountEnrollmentMetadataCreate$ { /** @deprecated use `EddAccountEnrollmentMetadataCreate$inboundSchema` instead. */ export const inboundSchema = EddAccountEnrollmentMetadataCreate$inboundSchema; /** @deprecated use `EddAccountEnrollmentMetadataCreate$outboundSchema` instead. */ export const outboundSchema = EddAccountEnrollmentMetadataCreate$outboundSchema; /** @deprecated use `EddAccountEnrollmentMetadataCreate$Outbound` instead. */ export type Outbound = EddAccountEnrollmentMetadataCreate$Outbound; } export function eddAccountEnrollmentMetadataCreateToJSON( eddAccountEnrollmentMetadataCreate: EddAccountEnrollmentMetadataCreate, ): string { return JSON.stringify( EddAccountEnrollmentMetadataCreate$outboundSchema.parse( eddAccountEnrollmentMetadataCreate, ), ); } export function eddAccountEnrollmentMetadataCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EddAccountEnrollmentMetadataCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EddAccountEnrollmentMetadataCreate' from JSON`, ); }