/* * 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"; /** * The financial goal or purpose that an investor has in mind when making investment decisions; firms often ask investors to specify their investment objectives when opening an account, in order to provide appropriate investment recommendations and manage risk appropriately */ export enum InvestmentObjective { InvestmentObjectiveUnspecified = "INVESTMENT_OBJECTIVE_UNSPECIFIED", Balanced = "BALANCED", CapitalAppreciation = "CAPITAL_APPRECIATION", CapitalPreservation = "CAPITAL_PRESERVATION", Growth = "GROWTH", GrowthAndIncome = "GROWTH_AND_INCOME", GrowthIncome = "GROWTH_INCOME", Income = "INCOME", LongTermGrowthWithGreaterRisk = "LONG_TERM_GROWTH_WITH_GREATER_RISK", LongTermGrowthWithSafety = "LONG_TERM_GROWTH_WITH_SAFETY", MaximumGrowth = "MAXIMUM_GROWTH", ShortTermGrowthWithRisk = "SHORT_TERM_GROWTH_WITH_RISK", Speculation = "SPECULATION", Other = "OTHER", } /** * The financial goal or purpose that an investor has in mind when making investment decisions; firms often ask investors to specify their investment objectives when opening an account, in order to provide appropriate investment recommendations and manage risk appropriately */ export type InvestmentObjectiveOpen = OpenEnum; /** * An investor’s short-term cash requirements or the need to access funds quickly; it is important to consider an investor’s liquidity needs to ensure that they have sufficient cash or easily liquidated assets available to meet their financial obligations - this may include holding cash or cash equivalents */ export enum LiquidityNeeds { LiquidityNeedsUnspecified = "LIQUIDITY_NEEDS_UNSPECIFIED", VeryImportant = "VERY_IMPORTANT", SomewhatImportant = "SOMEWHAT_IMPORTANT", NotImportant = "NOT_IMPORTANT", } /** * An investor’s short-term cash requirements or the need to access funds quickly; it is important to consider an investor’s liquidity needs to ensure that they have sufficient cash or easily liquidated assets available to meet their financial obligations - this may include holding cash or cash equivalents */ export type LiquidityNeedsOpen = OpenEnum; /** * An investor’s willingness and ability to tolerate risk when making investment decisions; reflects the investor’s comfort level with the potential ups and downs of the market and their ability to withstand potential losses */ export enum RiskTolerance { RiskToleranceUnspecified = "RISK_TOLERANCE_UNSPECIFIED", Low = "LOW", Medium = "MEDIUM", High = "HIGH", } /** * An investor’s willingness and ability to tolerate risk when making investment decisions; reflects the investor’s comfort level with the potential ups and downs of the market and their ability to withstand potential losses */ export type RiskToleranceOpen = OpenEnum; /** * TThe length of time an investor expects to hold an investment before selling it; this can affect the appropriate asset allocation and risk level for the portfolio */ export enum TimeHorizon { TimeHorizonUnspecified = "TIME_HORIZON_UNSPECIFIED", Short = "SHORT", Average = "AVERAGE", Long = "LONG", } /** * TThe length of time an investor expects to hold an investment before selling it; this can affect the appropriate asset allocation and risk level for the portfolio */ export type TimeHorizonOpen = OpenEnum; /** * The account goals on an investor profile. */ export type AccountGoalsCreate = { /** * The financial goal or purpose that an investor has in mind when making investment decisions; firms often ask investors to specify their investment objectives when opening an account, in order to provide appropriate investment recommendations and manage risk appropriately */ investmentObjective?: InvestmentObjectiveOpen | undefined; /** * An investor’s short-term cash requirements or the need to access funds quickly; it is important to consider an investor’s liquidity needs to ensure that they have sufficient cash or easily liquidated assets available to meet their financial obligations - this may include holding cash or cash equivalents */ liquidityNeeds?: LiquidityNeedsOpen | undefined; /** * An investor’s willingness and ability to tolerate risk when making investment decisions; reflects the investor’s comfort level with the potential ups and downs of the market and their ability to withstand potential losses */ riskTolerance?: RiskToleranceOpen | undefined; /** * TThe length of time an investor expects to hold an investment before selling it; this can affect the appropriate asset allocation and risk level for the portfolio */ timeHorizon?: TimeHorizonOpen | undefined; }; /** @internal */ export const InvestmentObjective$inboundSchema: z.ZodType< InvestmentObjectiveOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(InvestmentObjective), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const InvestmentObjective$outboundSchema: z.ZodType< InvestmentObjectiveOpen, z.ZodTypeDef, InvestmentObjectiveOpen > = z.union([ z.nativeEnum(InvestmentObjective), 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 InvestmentObjective$ { /** @deprecated use `InvestmentObjective$inboundSchema` instead. */ export const inboundSchema = InvestmentObjective$inboundSchema; /** @deprecated use `InvestmentObjective$outboundSchema` instead. */ export const outboundSchema = InvestmentObjective$outboundSchema; } /** @internal */ export const LiquidityNeeds$inboundSchema: z.ZodType< LiquidityNeedsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LiquidityNeeds), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LiquidityNeeds$outboundSchema: z.ZodType< LiquidityNeedsOpen, z.ZodTypeDef, LiquidityNeedsOpen > = z.union([ z.nativeEnum(LiquidityNeeds), 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 LiquidityNeeds$ { /** @deprecated use `LiquidityNeeds$inboundSchema` instead. */ export const inboundSchema = LiquidityNeeds$inboundSchema; /** @deprecated use `LiquidityNeeds$outboundSchema` instead. */ export const outboundSchema = LiquidityNeeds$outboundSchema; } /** @internal */ export const RiskTolerance$inboundSchema: z.ZodType< RiskToleranceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RiskTolerance), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RiskTolerance$outboundSchema: z.ZodType< RiskToleranceOpen, z.ZodTypeDef, RiskToleranceOpen > = z.union([ z.nativeEnum(RiskTolerance), 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 RiskTolerance$ { /** @deprecated use `RiskTolerance$inboundSchema` instead. */ export const inboundSchema = RiskTolerance$inboundSchema; /** @deprecated use `RiskTolerance$outboundSchema` instead. */ export const outboundSchema = RiskTolerance$outboundSchema; } /** @internal */ export const TimeHorizon$inboundSchema: z.ZodType< TimeHorizonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TimeHorizon), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TimeHorizon$outboundSchema: z.ZodType< TimeHorizonOpen, z.ZodTypeDef, TimeHorizonOpen > = z.union([ z.nativeEnum(TimeHorizon), 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 TimeHorizon$ { /** @deprecated use `TimeHorizon$inboundSchema` instead. */ export const inboundSchema = TimeHorizon$inboundSchema; /** @deprecated use `TimeHorizon$outboundSchema` instead. */ export const outboundSchema = TimeHorizon$outboundSchema; } /** @internal */ export const AccountGoalsCreate$inboundSchema: z.ZodType< AccountGoalsCreate, z.ZodTypeDef, unknown > = z.object({ investment_objective: InvestmentObjective$inboundSchema.optional(), liquidity_needs: LiquidityNeeds$inboundSchema.optional(), risk_tolerance: RiskTolerance$inboundSchema.optional(), time_horizon: TimeHorizon$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "investment_objective": "investmentObjective", "liquidity_needs": "liquidityNeeds", "risk_tolerance": "riskTolerance", "time_horizon": "timeHorizon", }); }); /** @internal */ export type AccountGoalsCreate$Outbound = { investment_objective?: string | undefined; liquidity_needs?: string | undefined; risk_tolerance?: string | undefined; time_horizon?: string | undefined; }; /** @internal */ export const AccountGoalsCreate$outboundSchema: z.ZodType< AccountGoalsCreate$Outbound, z.ZodTypeDef, AccountGoalsCreate > = z.object({ investmentObjective: InvestmentObjective$outboundSchema.optional(), liquidityNeeds: LiquidityNeeds$outboundSchema.optional(), riskTolerance: RiskTolerance$outboundSchema.optional(), timeHorizon: TimeHorizon$outboundSchema.optional(), }).transform((v) => { return remap$(v, { investmentObjective: "investment_objective", liquidityNeeds: "liquidity_needs", riskTolerance: "risk_tolerance", timeHorizon: "time_horizon", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountGoalsCreate$ { /** @deprecated use `AccountGoalsCreate$inboundSchema` instead. */ export const inboundSchema = AccountGoalsCreate$inboundSchema; /** @deprecated use `AccountGoalsCreate$outboundSchema` instead. */ export const outboundSchema = AccountGoalsCreate$outboundSchema; /** @deprecated use `AccountGoalsCreate$Outbound` instead. */ export type Outbound = AccountGoalsCreate$Outbound; } export function accountGoalsCreateToJSON( accountGoalsCreate: AccountGoalsCreate, ): string { return JSON.stringify( AccountGoalsCreate$outboundSchema.parse(accountGoalsCreate), ); } export function accountGoalsCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountGoalsCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountGoalsCreate' from JSON`, ); }