/* * 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"; /** * Annual income range; the low number is exclusive, the high number is inclusive */ export enum CustomerProfileUpdateAnnualIncomeRangeUsd { UsdRangeUnspecified = "USD_RANGE_UNSPECIFIED", Under25K = "UNDER_25K", From25KTo50K = "FROM_25K_TO_50K", From50KTo100K = "FROM_50K_TO_100K", From100KTo200K = "FROM_100K_TO_200K", From200KTo300K = "FROM_200K_TO_300K", From300KTo500K = "FROM_300K_TO_500K", From500KTo1M = "FROM_500K_TO_1M", From1MTo5M = "FROM_1M_TO_5M", Over5M = "OVER_5M", } /** * Annual income range; the low number is exclusive, the high number is inclusive */ export type CustomerProfileUpdateAnnualIncomeRangeUsdOpen = OpenEnum< typeof CustomerProfileUpdateAnnualIncomeRangeUsd >; /** * Investment experience. */ export enum CustomerProfileUpdateInvestmentExperience { InvestmentExperienceUnspecified = "INVESTMENT_EXPERIENCE_UNSPECIFIED", None = "NONE", Limited = "LIMITED", Good = "GOOD", Extensive = "EXTENSIVE", } /** * Investment experience. */ export type CustomerProfileUpdateInvestmentExperienceOpen = OpenEnum< typeof CustomerProfileUpdateInvestmentExperience >; /** * Liquid net worth range; the low number is exclusive, the high number is inclusive */ export enum CustomerProfileUpdateLiquidNetWorthRangeUsd { UsdRangeUnspecified = "USD_RANGE_UNSPECIFIED", Under25K = "UNDER_25K", From25KTo50K = "FROM_25K_TO_50K", From50KTo100K = "FROM_50K_TO_100K", From100KTo200K = "FROM_100K_TO_200K", From200KTo300K = "FROM_200K_TO_300K", From300KTo500K = "FROM_300K_TO_500K", From500KTo1M = "FROM_500K_TO_1M", From1MTo5M = "FROM_1M_TO_5M", Over5M = "OVER_5M", } /** * Liquid net worth range; the low number is exclusive, the high number is inclusive */ export type CustomerProfileUpdateLiquidNetWorthRangeUsdOpen = OpenEnum< typeof CustomerProfileUpdateLiquidNetWorthRangeUsd >; /** * Total net worth range; the low number is exclusive, the high number is inclusive */ export enum CustomerProfileUpdateTotalNetWorthRangeUsd { UsdRangeUnspecified = "USD_RANGE_UNSPECIFIED", Under25K = "UNDER_25K", From25KTo50K = "FROM_25K_TO_50K", From50KTo100K = "FROM_50K_TO_100K", From100KTo200K = "FROM_100K_TO_200K", From200KTo300K = "FROM_200K_TO_300K", From300KTo500K = "FROM_300K_TO_500K", From500KTo1M = "FROM_500K_TO_1M", From1MTo5M = "FROM_1M_TO_5M", Over5M = "OVER_5M", } /** * Total net worth range; the low number is exclusive, the high number is inclusive */ export type CustomerProfileUpdateTotalNetWorthRangeUsdOpen = OpenEnum< typeof CustomerProfileUpdateTotalNetWorthRangeUsd >; /** * A detailed summary of financial and personal details of an investor, to help understand the investor's financial standing, investment experience and risk tolerance. */ export type CustomerProfileUpdate = { /** * Annual income range; the low number is exclusive, the high number is inclusive */ annualIncomeRangeUsd?: | CustomerProfileUpdateAnnualIncomeRangeUsdOpen | undefined; /** * Federal tax bracket percent. */ federalTaxBracket?: number | undefined; /** * Investment experience. */ investmentExperience?: | CustomerProfileUpdateInvestmentExperienceOpen | undefined; /** * Liquid net worth range; the low number is exclusive, the high number is inclusive */ liquidNetWorthRangeUsd?: | CustomerProfileUpdateLiquidNetWorthRangeUsdOpen | undefined; /** * Total net worth range; the low number is exclusive, the high number is inclusive */ totalNetWorthRangeUsd?: | CustomerProfileUpdateTotalNetWorthRangeUsdOpen | undefined; }; /** @internal */ export const CustomerProfileUpdateAnnualIncomeRangeUsd$inboundSchema: z.ZodType< CustomerProfileUpdateAnnualIncomeRangeUsdOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CustomerProfileUpdateAnnualIncomeRangeUsd), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CustomerProfileUpdateAnnualIncomeRangeUsd$outboundSchema: z.ZodType< CustomerProfileUpdateAnnualIncomeRangeUsdOpen, z.ZodTypeDef, CustomerProfileUpdateAnnualIncomeRangeUsdOpen > = z.union([ z.nativeEnum(CustomerProfileUpdateAnnualIncomeRangeUsd), 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 CustomerProfileUpdateAnnualIncomeRangeUsd$ { /** @deprecated use `CustomerProfileUpdateAnnualIncomeRangeUsd$inboundSchema` instead. */ export const inboundSchema = CustomerProfileUpdateAnnualIncomeRangeUsd$inboundSchema; /** @deprecated use `CustomerProfileUpdateAnnualIncomeRangeUsd$outboundSchema` instead. */ export const outboundSchema = CustomerProfileUpdateAnnualIncomeRangeUsd$outboundSchema; } /** @internal */ export const CustomerProfileUpdateInvestmentExperience$inboundSchema: z.ZodType< CustomerProfileUpdateInvestmentExperienceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CustomerProfileUpdateInvestmentExperience), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CustomerProfileUpdateInvestmentExperience$outboundSchema: z.ZodType< CustomerProfileUpdateInvestmentExperienceOpen, z.ZodTypeDef, CustomerProfileUpdateInvestmentExperienceOpen > = z.union([ z.nativeEnum(CustomerProfileUpdateInvestmentExperience), 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 CustomerProfileUpdateInvestmentExperience$ { /** @deprecated use `CustomerProfileUpdateInvestmentExperience$inboundSchema` instead. */ export const inboundSchema = CustomerProfileUpdateInvestmentExperience$inboundSchema; /** @deprecated use `CustomerProfileUpdateInvestmentExperience$outboundSchema` instead. */ export const outboundSchema = CustomerProfileUpdateInvestmentExperience$outboundSchema; } /** @internal */ export const CustomerProfileUpdateLiquidNetWorthRangeUsd$inboundSchema: z.ZodType< CustomerProfileUpdateLiquidNetWorthRangeUsdOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CustomerProfileUpdateLiquidNetWorthRangeUsd), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CustomerProfileUpdateLiquidNetWorthRangeUsd$outboundSchema: z.ZodType< CustomerProfileUpdateLiquidNetWorthRangeUsdOpen, z.ZodTypeDef, CustomerProfileUpdateLiquidNetWorthRangeUsdOpen > = z.union([ z.nativeEnum(CustomerProfileUpdateLiquidNetWorthRangeUsd), 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 CustomerProfileUpdateLiquidNetWorthRangeUsd$ { /** @deprecated use `CustomerProfileUpdateLiquidNetWorthRangeUsd$inboundSchema` instead. */ export const inboundSchema = CustomerProfileUpdateLiquidNetWorthRangeUsd$inboundSchema; /** @deprecated use `CustomerProfileUpdateLiquidNetWorthRangeUsd$outboundSchema` instead. */ export const outboundSchema = CustomerProfileUpdateLiquidNetWorthRangeUsd$outboundSchema; } /** @internal */ export const CustomerProfileUpdateTotalNetWorthRangeUsd$inboundSchema: z.ZodType< CustomerProfileUpdateTotalNetWorthRangeUsdOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CustomerProfileUpdateTotalNetWorthRangeUsd), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CustomerProfileUpdateTotalNetWorthRangeUsd$outboundSchema: z.ZodType< CustomerProfileUpdateTotalNetWorthRangeUsdOpen, z.ZodTypeDef, CustomerProfileUpdateTotalNetWorthRangeUsdOpen > = z.union([ z.nativeEnum(CustomerProfileUpdateTotalNetWorthRangeUsd), 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 CustomerProfileUpdateTotalNetWorthRangeUsd$ { /** @deprecated use `CustomerProfileUpdateTotalNetWorthRangeUsd$inboundSchema` instead. */ export const inboundSchema = CustomerProfileUpdateTotalNetWorthRangeUsd$inboundSchema; /** @deprecated use `CustomerProfileUpdateTotalNetWorthRangeUsd$outboundSchema` instead. */ export const outboundSchema = CustomerProfileUpdateTotalNetWorthRangeUsd$outboundSchema; } /** @internal */ export const CustomerProfileUpdate$inboundSchema: z.ZodType< CustomerProfileUpdate, z.ZodTypeDef, unknown > = z.object({ annual_income_range_usd: CustomerProfileUpdateAnnualIncomeRangeUsd$inboundSchema.optional(), federal_tax_bracket: z.number().optional(), investment_experience: CustomerProfileUpdateInvestmentExperience$inboundSchema .optional(), liquid_net_worth_range_usd: CustomerProfileUpdateLiquidNetWorthRangeUsd$inboundSchema.optional(), total_net_worth_range_usd: CustomerProfileUpdateTotalNetWorthRangeUsd$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "annual_income_range_usd": "annualIncomeRangeUsd", "federal_tax_bracket": "federalTaxBracket", "investment_experience": "investmentExperience", "liquid_net_worth_range_usd": "liquidNetWorthRangeUsd", "total_net_worth_range_usd": "totalNetWorthRangeUsd", }); }); /** @internal */ export type CustomerProfileUpdate$Outbound = { annual_income_range_usd?: string | undefined; federal_tax_bracket?: number | undefined; investment_experience?: string | undefined; liquid_net_worth_range_usd?: string | undefined; total_net_worth_range_usd?: string | undefined; }; /** @internal */ export const CustomerProfileUpdate$outboundSchema: z.ZodType< CustomerProfileUpdate$Outbound, z.ZodTypeDef, CustomerProfileUpdate > = z.object({ annualIncomeRangeUsd: CustomerProfileUpdateAnnualIncomeRangeUsd$outboundSchema .optional(), federalTaxBracket: z.number().optional(), investmentExperience: CustomerProfileUpdateInvestmentExperience$outboundSchema .optional(), liquidNetWorthRangeUsd: CustomerProfileUpdateLiquidNetWorthRangeUsd$outboundSchema.optional(), totalNetWorthRangeUsd: CustomerProfileUpdateTotalNetWorthRangeUsd$outboundSchema.optional(), }).transform((v) => { return remap$(v, { annualIncomeRangeUsd: "annual_income_range_usd", federalTaxBracket: "federal_tax_bracket", investmentExperience: "investment_experience", liquidNetWorthRangeUsd: "liquid_net_worth_range_usd", totalNetWorthRangeUsd: "total_net_worth_range_usd", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomerProfileUpdate$ { /** @deprecated use `CustomerProfileUpdate$inboundSchema` instead. */ export const inboundSchema = CustomerProfileUpdate$inboundSchema; /** @deprecated use `CustomerProfileUpdate$outboundSchema` instead. */ export const outboundSchema = CustomerProfileUpdate$outboundSchema; /** @deprecated use `CustomerProfileUpdate$Outbound` instead. */ export type Outbound = CustomerProfileUpdate$Outbound; } export function customerProfileUpdateToJSON( customerProfileUpdate: CustomerProfileUpdate, ): string { return JSON.stringify( CustomerProfileUpdate$outboundSchema.parse(customerProfileUpdate), ); } export function customerProfileUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomerProfileUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomerProfileUpdate' from JSON`, ); }