/* * 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 { ForeignNaturalPersonAccountEnrollmentMetadataCreate, ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema, ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound, ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema, } from "./foreignnaturalpersonaccountenrollmentmetadatacreate.js"; /** * Option to auto-enroll in Dividend Reinvestment; defaults to DIVIDEND_REINVESTMENT_ENROLL */ export enum ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan { 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 ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlanOpen = OpenEnum< typeof ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan >; /** * Option to auto-enroll in FDIC cash sweep; defaults to FDIC_CASH_SWEEP_ENROLL */ export enum ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep { 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 ForeignJointAccountEnrollmentMetadataCreateFdicCashSweepOpen = OpenEnum; /** * Enrollment metadata for the FOREIGN_JOINT_WROS enrollment type */ export type ForeignJointAccountEnrollmentMetadataCreate = { /** * Option to auto-enroll in Dividend Reinvestment; defaults to DIVIDEND_REINVESTMENT_ENROLL */ dividendReinvestmentPlan?: | ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlanOpen | undefined; /** * Option to auto-enroll in FDIC cash sweep; defaults to FDIC_CASH_SWEEP_ENROLL */ fdicCashSweep?: | ForeignJointAccountEnrollmentMetadataCreateFdicCashSweepOpen | undefined; /** * Enrollment metadata for Accounts that have a foreign Legal Natural Person owner. */ foreignNaturalPersonAccountEnrollmentMetadata: ForeignNaturalPersonAccountEnrollmentMetadataCreate; }; /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlanOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlanOpen, z.ZodTypeDef, ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlanOpen > = z.union([ z.nativeEnum( ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan, ), 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 ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$ { /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema` instead. */ export const inboundSchema = ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema; /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema` instead. */ export const outboundSchema = ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema; } /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$inboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreateFdicCashSweepOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$outboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreateFdicCashSweepOpen, z.ZodTypeDef, ForeignJointAccountEnrollmentMetadataCreateFdicCashSweepOpen > = z.union([ z.nativeEnum(ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep), 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 ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$ { /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$inboundSchema` instead. */ export const inboundSchema = ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$inboundSchema; /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$outboundSchema` instead. */ export const outboundSchema = ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$outboundSchema; } /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreate$inboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreate, z.ZodTypeDef, unknown > = z.object({ dividend_reinvestment_plan: ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$inboundSchema .optional(), fdic_cash_sweep: ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$inboundSchema .optional(), foreign_natural_person_account_enrollment_metadata: ForeignNaturalPersonAccountEnrollmentMetadataCreate$inboundSchema, }).transform((v) => { return remap$(v, { "dividend_reinvestment_plan": "dividendReinvestmentPlan", "fdic_cash_sweep": "fdicCashSweep", "foreign_natural_person_account_enrollment_metadata": "foreignNaturalPersonAccountEnrollmentMetadata", }); }); /** @internal */ export type ForeignJointAccountEnrollmentMetadataCreate$Outbound = { dividend_reinvestment_plan?: string | undefined; fdic_cash_sweep?: string | undefined; foreign_natural_person_account_enrollment_metadata: ForeignNaturalPersonAccountEnrollmentMetadataCreate$Outbound; }; /** @internal */ export const ForeignJointAccountEnrollmentMetadataCreate$outboundSchema: z.ZodType< ForeignJointAccountEnrollmentMetadataCreate$Outbound, z.ZodTypeDef, ForeignJointAccountEnrollmentMetadataCreate > = z.object({ dividendReinvestmentPlan: ForeignJointAccountEnrollmentMetadataCreateDividendReinvestmentPlan$outboundSchema .optional(), fdicCashSweep: ForeignJointAccountEnrollmentMetadataCreateFdicCashSweep$outboundSchema .optional(), foreignNaturalPersonAccountEnrollmentMetadata: ForeignNaturalPersonAccountEnrollmentMetadataCreate$outboundSchema, }).transform((v) => { return remap$(v, { dividendReinvestmentPlan: "dividend_reinvestment_plan", fdicCashSweep: "fdic_cash_sweep", foreignNaturalPersonAccountEnrollmentMetadata: "foreign_natural_person_account_enrollment_metadata", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ForeignJointAccountEnrollmentMetadataCreate$ { /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreate$inboundSchema` instead. */ export const inboundSchema = ForeignJointAccountEnrollmentMetadataCreate$inboundSchema; /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreate$outboundSchema` instead. */ export const outboundSchema = ForeignJointAccountEnrollmentMetadataCreate$outboundSchema; /** @deprecated use `ForeignJointAccountEnrollmentMetadataCreate$Outbound` instead. */ export type Outbound = ForeignJointAccountEnrollmentMetadataCreate$Outbound; } export function foreignJointAccountEnrollmentMetadataCreateToJSON( foreignJointAccountEnrollmentMetadataCreate: ForeignJointAccountEnrollmentMetadataCreate, ): string { return JSON.stringify( ForeignJointAccountEnrollmentMetadataCreate$outboundSchema.parse( foreignJointAccountEnrollmentMetadataCreate, ), ); } export function foreignJointAccountEnrollmentMetadataCreateFromJSON( jsonString: string, ): SafeParseResult< ForeignJointAccountEnrollmentMetadataCreate, SDKValidationError > { return safeParse( jsonString, (x) => ForeignJointAccountEnrollmentMetadataCreate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ForeignJointAccountEnrollmentMetadataCreate' from JSON`, ); }