/* * 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 { AccountTaxProfileUpdate, AccountTaxProfileUpdate$inboundSchema, AccountTaxProfileUpdate$Outbound, AccountTaxProfileUpdate$outboundSchema, } from "./accounttaxprofileupdate.js"; import { CatReporterInformationUpdate, CatReporterInformationUpdate$inboundSchema, CatReporterInformationUpdate$Outbound, CatReporterInformationUpdate$outboundSchema, } from "./catreporterinformationupdate.js"; import { IdentifierUpdate, IdentifierUpdate$inboundSchema, IdentifierUpdate$Outbound, IdentifierUpdate$outboundSchema, } from "./identifierupdate.js"; import { InterestedPartyUpdate, InterestedPartyUpdate$inboundSchema, InterestedPartyUpdate$Outbound, InterestedPartyUpdate$outboundSchema, } from "./interestedpartyupdate.js"; import { InvestmentProfileUpdate, InvestmentProfileUpdate$inboundSchema, InvestmentProfileUpdate$Outbound, InvestmentProfileUpdate$outboundSchema, } from "./investmentprofileupdate.js"; import { PartyRequestUpdate, PartyRequestUpdate$inboundSchema, PartyRequestUpdate$Outbound, PartyRequestUpdate$outboundSchema, } from "./partyrequestupdate.js"; import { TrustedContactUpdate, TrustedContactUpdate$inboundSchema, TrustedContactUpdate$Outbound, TrustedContactUpdate$outboundSchema, } from "./trustedcontactupdate.js"; /** * The FINRA CAT classification for the Account Holder; Is set automatically based on attributes of the owners and account type */ export enum AccountRequestUpdateCatAccountHolderType { 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 AccountRequestUpdateCatAccountHolderTypeOpen = OpenEnum< typeof AccountRequestUpdateCatAccountHolderType >; /** * A single record representing an owner or manager of an Account. */ export type AccountRequestUpdate = { /** * 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; /** * 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?: | AccountRequestUpdateCatAccountHolderTypeOpen | undefined; /** * A single record representing the originating_fdid and originating_cat_reporter_crd */ catReporterInformation?: CatReporterInformationUpdate | undefined; /** * An external identifier for the account. This identifier does not have internal uniqueness constraints. */ clientAccountId?: string | undefined; /** * 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?: InvestmentProfileUpdate | 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 | undefined; /** * The primary registered representative for the account */ primaryRegisteredRepId?: string | undefined; /** * The account tax profile. */ taxProfile?: AccountTaxProfileUpdate | 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 AccountRequestUpdateCatAccountHolderType$inboundSchema: z.ZodType< AccountRequestUpdateCatAccountHolderTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AccountRequestUpdateCatAccountHolderType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AccountRequestUpdateCatAccountHolderType$outboundSchema: z.ZodType< AccountRequestUpdateCatAccountHolderTypeOpen, z.ZodTypeDef, AccountRequestUpdateCatAccountHolderTypeOpen > = z.union([ z.nativeEnum(AccountRequestUpdateCatAccountHolderType), 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 AccountRequestUpdateCatAccountHolderType$ { /** @deprecated use `AccountRequestUpdateCatAccountHolderType$inboundSchema` instead. */ export const inboundSchema = AccountRequestUpdateCatAccountHolderType$inboundSchema; /** @deprecated use `AccountRequestUpdateCatAccountHolderType$outboundSchema` instead. */ export const outboundSchema = AccountRequestUpdateCatAccountHolderType$outboundSchema; } /** @internal */ export const AccountRequestUpdate$inboundSchema: z.ZodType< AccountRequestUpdate, z.ZodTypeDef, unknown > = z.object({ accepts_issuer_direct_communication: z.boolean().optional(), advised: z.boolean().optional(), cat_account_holder_type: AccountRequestUpdateCatAccountHolderType$inboundSchema.optional(), cat_reporter_information: CatReporterInformationUpdate$inboundSchema .optional(), client_account_id: z.string().optional(), identifiers: z.array(IdentifierUpdate$inboundSchema).optional(), interested_parties: z.array(InterestedPartyUpdate$inboundSchema).optional(), investment_profile: InvestmentProfileUpdate$inboundSchema.optional(), managed: z.boolean().optional(), originating_account_id: z.string().optional(), parties: z.array(PartyRequestUpdate$inboundSchema).optional(), primary_registered_rep_id: z.string().optional(), tax_profile: AccountTaxProfileUpdate$inboundSchema.optional(), trusted_contacts: z.array(TrustedContactUpdate$inboundSchema).optional(), wrap_fee_billed: z.boolean().optional(), }).transform((v) => { return remap$(v, { "accepts_issuer_direct_communication": "acceptsIssuerDirectCommunication", "cat_account_holder_type": "catAccountHolderType", "cat_reporter_information": "catReporterInformation", "client_account_id": "clientAccountId", "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 AccountRequestUpdate$Outbound = { accepts_issuer_direct_communication?: boolean | undefined; advised?: boolean | undefined; cat_account_holder_type?: string | undefined; cat_reporter_information?: CatReporterInformationUpdate$Outbound | undefined; client_account_id?: string | undefined; identifiers?: Array | undefined; interested_parties?: Array | undefined; investment_profile?: InvestmentProfileUpdate$Outbound | undefined; managed?: boolean | undefined; originating_account_id?: string | undefined; parties?: Array | undefined; primary_registered_rep_id?: string | undefined; tax_profile?: AccountTaxProfileUpdate$Outbound | undefined; trusted_contacts?: Array | undefined; wrap_fee_billed?: boolean | undefined; }; /** @internal */ export const AccountRequestUpdate$outboundSchema: z.ZodType< AccountRequestUpdate$Outbound, z.ZodTypeDef, AccountRequestUpdate > = z.object({ acceptsIssuerDirectCommunication: z.boolean().optional(), advised: z.boolean().optional(), catAccountHolderType: AccountRequestUpdateCatAccountHolderType$outboundSchema .optional(), catReporterInformation: CatReporterInformationUpdate$outboundSchema .optional(), clientAccountId: z.string().optional(), identifiers: z.array(IdentifierUpdate$outboundSchema).optional(), interestedParties: z.array(InterestedPartyUpdate$outboundSchema).optional(), investmentProfile: InvestmentProfileUpdate$outboundSchema.optional(), managed: z.boolean().optional(), originatingAccountId: z.string().optional(), parties: z.array(PartyRequestUpdate$outboundSchema).optional(), primaryRegisteredRepId: z.string().optional(), taxProfile: AccountTaxProfileUpdate$outboundSchema.optional(), trustedContacts: z.array(TrustedContactUpdate$outboundSchema).optional(), wrapFeeBilled: z.boolean().optional(), }).transform((v) => { return remap$(v, { acceptsIssuerDirectCommunication: "accepts_issuer_direct_communication", catAccountHolderType: "cat_account_holder_type", catReporterInformation: "cat_reporter_information", clientAccountId: "client_account_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 AccountRequestUpdate$ { /** @deprecated use `AccountRequestUpdate$inboundSchema` instead. */ export const inboundSchema = AccountRequestUpdate$inboundSchema; /** @deprecated use `AccountRequestUpdate$outboundSchema` instead. */ export const outboundSchema = AccountRequestUpdate$outboundSchema; /** @deprecated use `AccountRequestUpdate$Outbound` instead. */ export type Outbound = AccountRequestUpdate$Outbound; } export function accountRequestUpdateToJSON( accountRequestUpdate: AccountRequestUpdate, ): string { return JSON.stringify( AccountRequestUpdate$outboundSchema.parse(accountRequestUpdate), ); } export function accountRequestUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountRequestUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountRequestUpdate' from JSON`, ); }