/* * 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 { DateCreate, DateCreate$inboundSchema, DateCreate$Outbound, DateCreate$outboundSchema, } from "./datecreate.js"; /** * Option to auto-enroll in Dividend Reinvestment; defaults to DIVIDEND_REINVESTMENT_ENROLL */ export enum IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan { AutoEnrollDividendReinvestmentUnspecified = "AUTO_ENROLL_DIVIDEND_REINVESTMENT_UNSPECIFIED", DividendReinvestmentEnroll = "DIVIDEND_REINVESTMENT_ENROLL", DividendReinvestmentDecline = "DIVIDEND_REINVESTMENT_DECLINE", } /** * Option to auto-enroll in Dividend Reinvestment; defaults to DIVIDEND_REINVESTMENT_ENROLL */ export type IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlanOpen = OpenEnum< typeof IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan >; /** * Option to auto-enroll in FDIC cash sweep; defaults to FDIC_CASH_SWEEP_ENROLL */ export enum IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep { AutoEnrollFdicCashSweepUnspecified = "AUTO_ENROLL_FDIC_CASH_SWEEP_UNSPECIFIED", FdicCashSweepEnroll = "FDIC_CASH_SWEEP_ENROLL", FdicCashSweepDecline = "FDIC_CASH_SWEEP_DECLINE", } /** * Option to auto-enroll in FDIC cash sweep; defaults to FDIC_CASH_SWEEP_ENROLL */ export type IRABeneficiaryEnrollmentMetadataCreateFdicCashSweepOpen = OpenEnum< typeof IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep >; /** * Enrollment metadata for beneficiary IRA accounts enrollment type */ export type IRABeneficiaryEnrollmentMetadataCreate = { /** * Option to auto-enroll in Dividend Reinvestment; defaults to DIVIDEND_REINVESTMENT_ENROLL */ dividendReinvestmentPlan?: | IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlanOpen | undefined; /** * Option to auto-enroll in FDIC cash sweep; defaults to FDIC_CASH_SWEEP_ENROLL */ fdicCashSweep?: | IRABeneficiaryEnrollmentMetadataCreateFdicCashSweepOpen | undefined; /** * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * * @remarks * * * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date * * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. */ inheritedFromOwnerBirthDate?: DateCreate | undefined; /** * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * * @remarks * * * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date * * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. */ inheritedFromOwnerDeathDate?: DateCreate | undefined; /** * The name of the owner from whom the account is inherited */ inheritedFromOwnerName: string; /** * Indicates if the customer is the spouse of the decedent */ inheritorIsDecedentsSpouse: boolean; }; /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlanOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlanOpen, z.ZodTypeDef, IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlanOpen > = z.union([ z.nativeEnum( IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan, ), 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 IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$ { /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema` instead. */ export const inboundSchema = IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema; /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema` instead. */ export const outboundSchema = IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema; } /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$inboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreateFdicCashSweepOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$outboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreateFdicCashSweepOpen, z.ZodTypeDef, IRABeneficiaryEnrollmentMetadataCreateFdicCashSweepOpen > = z.union([ z.nativeEnum(IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep), 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 IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$ { /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$inboundSchema` instead. */ export const inboundSchema = IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$inboundSchema; /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$outboundSchema` instead. */ export const outboundSchema = IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$outboundSchema; } /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreate$inboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreate, z.ZodTypeDef, unknown > = z.object({ dividend_reinvestment_plan: IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema .optional(), fdic_cash_sweep: IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$inboundSchema .optional(), inherited_from_owner_birth_date: DateCreate$inboundSchema.optional(), inherited_from_owner_death_date: DateCreate$inboundSchema.optional(), inherited_from_owner_name: z.string(), inheritor_is_decedents_spouse: z.boolean(), }).transform((v) => { return remap$(v, { "dividend_reinvestment_plan": "dividendReinvestmentPlan", "fdic_cash_sweep": "fdicCashSweep", "inherited_from_owner_birth_date": "inheritedFromOwnerBirthDate", "inherited_from_owner_death_date": "inheritedFromOwnerDeathDate", "inherited_from_owner_name": "inheritedFromOwnerName", "inheritor_is_decedents_spouse": "inheritorIsDecedentsSpouse", }); }); /** @internal */ export type IRABeneficiaryEnrollmentMetadataCreate$Outbound = { dividend_reinvestment_plan?: string | undefined; fdic_cash_sweep?: string | undefined; inherited_from_owner_birth_date?: DateCreate$Outbound | undefined; inherited_from_owner_death_date?: DateCreate$Outbound | undefined; inherited_from_owner_name: string; inheritor_is_decedents_spouse: boolean; }; /** @internal */ export const IRABeneficiaryEnrollmentMetadataCreate$outboundSchema: z.ZodType< IRABeneficiaryEnrollmentMetadataCreate$Outbound, z.ZodTypeDef, IRABeneficiaryEnrollmentMetadataCreate > = z.object({ dividendReinvestmentPlan: IRABeneficiaryEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema .optional(), fdicCashSweep: IRABeneficiaryEnrollmentMetadataCreateFdicCashSweep$outboundSchema .optional(), inheritedFromOwnerBirthDate: DateCreate$outboundSchema.optional(), inheritedFromOwnerDeathDate: DateCreate$outboundSchema.optional(), inheritedFromOwnerName: z.string(), inheritorIsDecedentsSpouse: z.boolean(), }).transform((v) => { return remap$(v, { dividendReinvestmentPlan: "dividend_reinvestment_plan", fdicCashSweep: "fdic_cash_sweep", inheritedFromOwnerBirthDate: "inherited_from_owner_birth_date", inheritedFromOwnerDeathDate: "inherited_from_owner_death_date", inheritedFromOwnerName: "inherited_from_owner_name", inheritorIsDecedentsSpouse: "inheritor_is_decedents_spouse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IRABeneficiaryEnrollmentMetadataCreate$ { /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreate$inboundSchema` instead. */ export const inboundSchema = IRABeneficiaryEnrollmentMetadataCreate$inboundSchema; /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreate$outboundSchema` instead. */ export const outboundSchema = IRABeneficiaryEnrollmentMetadataCreate$outboundSchema; /** @deprecated use `IRABeneficiaryEnrollmentMetadataCreate$Outbound` instead. */ export type Outbound = IRABeneficiaryEnrollmentMetadataCreate$Outbound; } export function iraBeneficiaryEnrollmentMetadataCreateToJSON( iraBeneficiaryEnrollmentMetadataCreate: IRABeneficiaryEnrollmentMetadataCreate, ): string { return JSON.stringify( IRABeneficiaryEnrollmentMetadataCreate$outboundSchema.parse( iraBeneficiaryEnrollmentMetadataCreate, ), ); } export function iraBeneficiaryEnrollmentMetadataCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IRABeneficiaryEnrollmentMetadataCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IRABeneficiaryEnrollmentMetadataCreate' from JSON`, ); }