/* * 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 { AccountTaxProfileCreate, AccountTaxProfileCreate$inboundSchema, AccountTaxProfileCreate$Outbound, AccountTaxProfileCreate$outboundSchema, } from "./accounttaxprofilecreate.js"; import { CatReporterInformationCreate, CatReporterInformationCreate$inboundSchema, CatReporterInformationCreate$Outbound, CatReporterInformationCreate$outboundSchema, } from "./catreporterinformationcreate.js"; import { IdentifierCreate, IdentifierCreate$inboundSchema, IdentifierCreate$Outbound, IdentifierCreate$outboundSchema, } from "./identifiercreate.js"; import { InterestedPartyCreate, InterestedPartyCreate$inboundSchema, InterestedPartyCreate$Outbound, InterestedPartyCreate$outboundSchema, } from "./interestedpartycreate.js"; import { InvestmentProfileCreate, InvestmentProfileCreate$inboundSchema, InvestmentProfileCreate$Outbound, InvestmentProfileCreate$outboundSchema, } from "./investmentprofilecreate.js"; import { PartyRequestCreate, PartyRequestCreate$inboundSchema, PartyRequestCreate$Outbound, PartyRequestCreate$outboundSchema, } from "./partyrequestcreate.js"; import { TrustedContactCreate, TrustedContactCreate$inboundSchema, TrustedContactCreate$Outbound, TrustedContactCreate$outboundSchema, } from "./trustedcontactcreate.js"; /** * The FINRA CAT classification for the Account Holder; Is set automatically based on attributes of the owners and account type */ export enum CatAccountHolderType { CatAccountHolderTypeUnspecified = "CAT_ACCOUNT_HOLDER_TYPE_UNSPECIFIED", AInstitutionalCustomer = "A_INSTITUTIONAL_CUSTOMER", EEmployeeAccount = "E_EMPLOYEE_ACCOUNT", FForeign = "F_FOREIGN", IIndividual = "I_INDIVIDUAL", OMarketMaking = "O_MARKET_MAKING", VAgencyAveragePriceAccount = "V_AGENCY_AVERAGE_PRICE_ACCOUNT", POtherProprietary = "P_OTHER_PROPRIETARY", XErrorAccount = "X_ERROR_ACCOUNT", } /** * The FINRA CAT classification for the Account Holder; Is set automatically based on attributes of the owners and account type */ export type CatAccountHolderTypeOpen = OpenEnum; /** * A single record representing an owner or manager of an Account. */ export type AccountRequestCreate = { /** * Indicates if the issuer of a security held by the account is permitted to communicate directly with the shareholder versus through the brokerage firm; This can include sending proxy statements, annual reports, and other important information directly to the shareholder's address on file with the brokerage firm By default, this is set to `false`. */ acceptsIssuerDirectCommunication?: boolean | undefined; /** * An Account Group is a way of segmenting accounts within a Correspondent; It is up to the client to define what these groups are and AFS Operations is responsible for configuring them; If the client requests additional groups/codes, they can be added; Examples of Account Groups could hypothetically include HNW (High Net Worth), GOLD (Gold Status Customer), and NWC (Northwest Branch Customer) */ accountGroupId: string; /** * A boolean to indicate if an account is advised */ advised?: boolean | undefined; /** * The FINRA CAT classification for the Account Holder; Is set automatically based on attributes of the owners and account type */ catAccountHolderType?: CatAccountHolderTypeOpen | undefined; /** * A single record representing the originating_fdid and originating_cat_reporter_crd */ catReporterInformation?: CatReporterInformationCreate | undefined; /** * An external identifier for the account. This identifier does not have internal uniqueness constraints. */ clientAccountId?: string | undefined; /** * A unique identifier referencing a Correspondent; A Client may have several operating Correspondents within its purview. */ correspondentId: string; /** * A list of identifiers associated with the account * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ identifiers?: Array | undefined; /** * A list of natural persons indicated to receive selected account documents such as account statements */ interestedParties?: Array | undefined; /** * Investor profile. */ investmentProfile?: InvestmentProfileCreate | undefined; /** * A boolean to indicate if an account is managed */ managed?: boolean | undefined; /** * The previous account ID associated with the account; Must be unique */ originatingAccountId?: string | undefined; /** * Parties associated with the account (e.g. custodian). */ parties: Array; /** * The primary registered representative for the account */ primaryRegisteredRepId?: string | undefined; /** * The account tax profile. */ taxProfile?: AccountTaxProfileCreate | undefined; /** * A list of persons designated to verify the well being of the account holder. */ trustedContacts?: Array | undefined; /** * A boolean to indicate if an account is a wrap brokerage account */ wrapFeeBilled?: boolean | undefined; }; /** @internal */ export const CatAccountHolderType$inboundSchema: z.ZodType< CatAccountHolderTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CatAccountHolderType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CatAccountHolderType$outboundSchema: z.ZodType< CatAccountHolderTypeOpen, z.ZodTypeDef, CatAccountHolderTypeOpen > = z.union([ z.nativeEnum(CatAccountHolderType), 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 CatAccountHolderType$ { /** @deprecated use `CatAccountHolderType$inboundSchema` instead. */ export const inboundSchema = CatAccountHolderType$inboundSchema; /** @deprecated use `CatAccountHolderType$outboundSchema` instead. */ export const outboundSchema = CatAccountHolderType$outboundSchema; } /** @internal */ export const AccountRequestCreate$inboundSchema: z.ZodType< AccountRequestCreate, z.ZodTypeDef, unknown > = z.object({ accepts_issuer_direct_communication: z.boolean().optional(), account_group_id: z.string(), advised: z.boolean().optional(), cat_account_holder_type: CatAccountHolderType$inboundSchema.optional(), cat_reporter_information: CatReporterInformationCreate$inboundSchema .optional(), client_account_id: z.string().optional(), correspondent_id: z.string(), identifiers: z.array(IdentifierCreate$inboundSchema).optional(), interested_parties: z.array(InterestedPartyCreate$inboundSchema).optional(), investment_profile: InvestmentProfileCreate$inboundSchema.optional(), managed: z.boolean().optional(), originating_account_id: z.string().optional(), parties: z.array(PartyRequestCreate$inboundSchema), primary_registered_rep_id: z.string().optional(), tax_profile: AccountTaxProfileCreate$inboundSchema.optional(), trusted_contacts: z.array(TrustedContactCreate$inboundSchema).optional(), wrap_fee_billed: z.boolean().optional(), }).transform((v) => { return remap$(v, { "accepts_issuer_direct_communication": "acceptsIssuerDirectCommunication", "account_group_id": "accountGroupId", "cat_account_holder_type": "catAccountHolderType", "cat_reporter_information": "catReporterInformation", "client_account_id": "clientAccountId", "correspondent_id": "correspondentId", "interested_parties": "interestedParties", "investment_profile": "investmentProfile", "originating_account_id": "originatingAccountId", "primary_registered_rep_id": "primaryRegisteredRepId", "tax_profile": "taxProfile", "trusted_contacts": "trustedContacts", "wrap_fee_billed": "wrapFeeBilled", }); }); /** @internal */ export type AccountRequestCreate$Outbound = { accepts_issuer_direct_communication?: boolean | undefined; account_group_id: string; advised?: boolean | undefined; cat_account_holder_type?: string | undefined; cat_reporter_information?: CatReporterInformationCreate$Outbound | undefined; client_account_id?: string | undefined; correspondent_id: string; identifiers?: Array | undefined; interested_parties?: Array | undefined; investment_profile?: InvestmentProfileCreate$Outbound | undefined; managed?: boolean | undefined; originating_account_id?: string | undefined; parties: Array; primary_registered_rep_id?: string | undefined; tax_profile?: AccountTaxProfileCreate$Outbound | undefined; trusted_contacts?: Array | undefined; wrap_fee_billed?: boolean | undefined; }; /** @internal */ export const AccountRequestCreate$outboundSchema: z.ZodType< AccountRequestCreate$Outbound, z.ZodTypeDef, AccountRequestCreate > = z.object({ acceptsIssuerDirectCommunication: z.boolean().optional(), accountGroupId: z.string(), advised: z.boolean().optional(), catAccountHolderType: CatAccountHolderType$outboundSchema.optional(), catReporterInformation: CatReporterInformationCreate$outboundSchema .optional(), clientAccountId: z.string().optional(), correspondentId: z.string(), identifiers: z.array(IdentifierCreate$outboundSchema).optional(), interestedParties: z.array(InterestedPartyCreate$outboundSchema).optional(), investmentProfile: InvestmentProfileCreate$outboundSchema.optional(), managed: z.boolean().optional(), originatingAccountId: z.string().optional(), parties: z.array(PartyRequestCreate$outboundSchema), primaryRegisteredRepId: z.string().optional(), taxProfile: AccountTaxProfileCreate$outboundSchema.optional(), trustedContacts: z.array(TrustedContactCreate$outboundSchema).optional(), wrapFeeBilled: z.boolean().optional(), }).transform((v) => { return remap$(v, { acceptsIssuerDirectCommunication: "accepts_issuer_direct_communication", accountGroupId: "account_group_id", catAccountHolderType: "cat_account_holder_type", catReporterInformation: "cat_reporter_information", clientAccountId: "client_account_id", correspondentId: "correspondent_id", interestedParties: "interested_parties", investmentProfile: "investment_profile", originatingAccountId: "originating_account_id", primaryRegisteredRepId: "primary_registered_rep_id", taxProfile: "tax_profile", trustedContacts: "trusted_contacts", wrapFeeBilled: "wrap_fee_billed", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountRequestCreate$ { /** @deprecated use `AccountRequestCreate$inboundSchema` instead. */ export const inboundSchema = AccountRequestCreate$inboundSchema; /** @deprecated use `AccountRequestCreate$outboundSchema` instead. */ export const outboundSchema = AccountRequestCreate$outboundSchema; /** @deprecated use `AccountRequestCreate$Outbound` instead. */ export type Outbound = AccountRequestCreate$Outbound; } export function accountRequestCreateToJSON( accountRequestCreate: AccountRequestCreate, ): string { return JSON.stringify( AccountRequestCreate$outboundSchema.parse(accountRequestCreate), ); } export function accountRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountRequestCreate' from JSON`, ); }