/* * 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 AccountGoalsUpdateInvestmentObjective { 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 AccountGoalsUpdateInvestmentObjectiveOpen = OpenEnum< typeof AccountGoalsUpdateInvestmentObjective >; /** * 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 AccountGoalsUpdateLiquidityNeeds { 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 AccountGoalsUpdateLiquidityNeedsOpen = OpenEnum< typeof AccountGoalsUpdateLiquidityNeeds >; /** * 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 AccountGoalsUpdateRiskTolerance { 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 AccountGoalsUpdateRiskToleranceOpen = OpenEnum< typeof AccountGoalsUpdateRiskTolerance >; /** * 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 AccountGoalsUpdateTimeHorizon { 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 AccountGoalsUpdateTimeHorizonOpen = OpenEnum< typeof AccountGoalsUpdateTimeHorizon >; /** * The account goals on an investor profile. */ export type AccountGoalsUpdate = { /** * 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?: AccountGoalsUpdateInvestmentObjectiveOpen | 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?: AccountGoalsUpdateLiquidityNeedsOpen | 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?: AccountGoalsUpdateRiskToleranceOpen | 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?: AccountGoalsUpdateTimeHorizonOpen | undefined; }; /** @internal */ export const AccountGoalsUpdateInvestmentObjective$inboundSchema: z.ZodType< AccountGoalsUpdateInvestmentObjectiveOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AccountGoalsUpdateInvestmentObjective), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AccountGoalsUpdateInvestmentObjective$outboundSchema: z.ZodType< AccountGoalsUpdateInvestmentObjectiveOpen, z.ZodTypeDef, AccountGoalsUpdateInvestmentObjectiveOpen > = z.union([ z.nativeEnum(AccountGoalsUpdateInvestmentObjective), 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 AccountGoalsUpdateInvestmentObjective$ { /** @deprecated use `AccountGoalsUpdateInvestmentObjective$inboundSchema` instead. */ export const inboundSchema = AccountGoalsUpdateInvestmentObjective$inboundSchema; /** @deprecated use `AccountGoalsUpdateInvestmentObjective$outboundSchema` instead. */ export const outboundSchema = AccountGoalsUpdateInvestmentObjective$outboundSchema; } /** @internal */ export const AccountGoalsUpdateLiquidityNeeds$inboundSchema: z.ZodType< AccountGoalsUpdateLiquidityNeedsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AccountGoalsUpdateLiquidityNeeds), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AccountGoalsUpdateLiquidityNeeds$outboundSchema: z.ZodType< AccountGoalsUpdateLiquidityNeedsOpen, z.ZodTypeDef, AccountGoalsUpdateLiquidityNeedsOpen > = z.union([ z.nativeEnum(AccountGoalsUpdateLiquidityNeeds), 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 AccountGoalsUpdateLiquidityNeeds$ { /** @deprecated use `AccountGoalsUpdateLiquidityNeeds$inboundSchema` instead. */ export const inboundSchema = AccountGoalsUpdateLiquidityNeeds$inboundSchema; /** @deprecated use `AccountGoalsUpdateLiquidityNeeds$outboundSchema` instead. */ export const outboundSchema = AccountGoalsUpdateLiquidityNeeds$outboundSchema; } /** @internal */ export const AccountGoalsUpdateRiskTolerance$inboundSchema: z.ZodType< AccountGoalsUpdateRiskToleranceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AccountGoalsUpdateRiskTolerance), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AccountGoalsUpdateRiskTolerance$outboundSchema: z.ZodType< AccountGoalsUpdateRiskToleranceOpen, z.ZodTypeDef, AccountGoalsUpdateRiskToleranceOpen > = z.union([ z.nativeEnum(AccountGoalsUpdateRiskTolerance), 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 AccountGoalsUpdateRiskTolerance$ { /** @deprecated use `AccountGoalsUpdateRiskTolerance$inboundSchema` instead. */ export const inboundSchema = AccountGoalsUpdateRiskTolerance$inboundSchema; /** @deprecated use `AccountGoalsUpdateRiskTolerance$outboundSchema` instead. */ export const outboundSchema = AccountGoalsUpdateRiskTolerance$outboundSchema; } /** @internal */ export const AccountGoalsUpdateTimeHorizon$inboundSchema: z.ZodType< AccountGoalsUpdateTimeHorizonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AccountGoalsUpdateTimeHorizon), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AccountGoalsUpdateTimeHorizon$outboundSchema: z.ZodType< AccountGoalsUpdateTimeHorizonOpen, z.ZodTypeDef, AccountGoalsUpdateTimeHorizonOpen > = z.union([ z.nativeEnum(AccountGoalsUpdateTimeHorizon), 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 AccountGoalsUpdateTimeHorizon$ { /** @deprecated use `AccountGoalsUpdateTimeHorizon$inboundSchema` instead. */ export const inboundSchema = AccountGoalsUpdateTimeHorizon$inboundSchema; /** @deprecated use `AccountGoalsUpdateTimeHorizon$outboundSchema` instead. */ export const outboundSchema = AccountGoalsUpdateTimeHorizon$outboundSchema; } /** @internal */ export const AccountGoalsUpdate$inboundSchema: z.ZodType< AccountGoalsUpdate, z.ZodTypeDef, unknown > = z.object({ investment_objective: AccountGoalsUpdateInvestmentObjective$inboundSchema .optional(), liquidity_needs: AccountGoalsUpdateLiquidityNeeds$inboundSchema.optional(), risk_tolerance: AccountGoalsUpdateRiskTolerance$inboundSchema.optional(), time_horizon: AccountGoalsUpdateTimeHorizon$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "investment_objective": "investmentObjective", "liquidity_needs": "liquidityNeeds", "risk_tolerance": "riskTolerance", "time_horizon": "timeHorizon", }); }); /** @internal */ export type AccountGoalsUpdate$Outbound = { investment_objective?: string | undefined; liquidity_needs?: string | undefined; risk_tolerance?: string | undefined; time_horizon?: string | undefined; }; /** @internal */ export const AccountGoalsUpdate$outboundSchema: z.ZodType< AccountGoalsUpdate$Outbound, z.ZodTypeDef, AccountGoalsUpdate > = z.object({ investmentObjective: AccountGoalsUpdateInvestmentObjective$outboundSchema .optional(), liquidityNeeds: AccountGoalsUpdateLiquidityNeeds$outboundSchema.optional(), riskTolerance: AccountGoalsUpdateRiskTolerance$outboundSchema.optional(), timeHorizon: AccountGoalsUpdateTimeHorizon$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 AccountGoalsUpdate$ { /** @deprecated use `AccountGoalsUpdate$inboundSchema` instead. */ export const inboundSchema = AccountGoalsUpdate$inboundSchema; /** @deprecated use `AccountGoalsUpdate$outboundSchema` instead. */ export const outboundSchema = AccountGoalsUpdate$outboundSchema; /** @deprecated use `AccountGoalsUpdate$Outbound` instead. */ export type Outbound = AccountGoalsUpdate$Outbound; } export function accountGoalsUpdateToJSON( accountGoalsUpdate: AccountGoalsUpdate, ): string { return JSON.stringify( AccountGoalsUpdate$outboundSchema.parse(accountGoalsUpdate), ); } export function accountGoalsUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountGoalsUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountGoalsUpdate' from JSON`, ); }