/* * 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"; export enum LegalEntityBusinessIndustrialClassification { BusinessIndustrialClassificationUnspecified = "BUSINESS_INDUSTRIAL_CLASSIFICATION_UNSPECIFIED", AgricultureForestryAndFishing = "AGRICULTURE_FORESTRY_AND_FISHING", Mining = "MINING", Construction = "CONSTRUCTION", Manufacturing = "MANUFACTURING", TransportationCommunicationsElectricGasAndSanitaryServices = "TRANSPORTATION_COMMUNICATIONS_ELECTRIC_GAS_AND_SANITARY_SERVICES", WholesaleTrade = "WHOLESALE_TRADE", RetailTrade = "RETAIL_TRADE", FinanceInsuranceAndRealEstate = "FINANCE_INSURANCE_AND_REAL_ESTATE", Services = "SERVICES", PublicAdministration = "PUBLIC_ADMINISTRATION", } export type LegalEntityBusinessIndustrialClassificationOpen = OpenEnum< typeof LegalEntityBusinessIndustrialClassification >; /** * Corporate structure of the entity. */ export enum LegalEntityCorporateStructure { EntityCorporateStructureUnspecified = "ENTITY_CORPORATE_STRUCTURE_UNSPECIFIED", CorporationCCorp = "CORPORATION_C_CORP", CorporationSCorp = "CORPORATION_S_CORP", CorporationBCorp = "CORPORATION_B_CORP", CorporationNonprofit = "CORPORATION_NONPROFIT", } /** * Corporate structure of the entity. */ export type LegalEntityCorporateStructureOpen = OpenEnum< typeof LegalEntityCorporateStructure >; /** * Information about any negative news against related parties and entities */ export type LegalEntityNegativeNews = { /** * Indicates whether there is negative news against related parties */ negativeNewsAgainstRelatedParties?: boolean | undefined; /** * Description of the negative news against related parties */ negativeNewsAgainstRelatedPartiesDescription?: string | undefined; }; /** * Due Diligence for Legal Entities */ export type EntityDueDiligence = { /** * Indicates whether the entity issues bearer shares */ entityIssuesBearerShares?: boolean | undefined; /** * Information about any negative news against related parties and entities */ negativeNews?: LegalEntityNegativeNews | null | undefined; }; /** * The entity type. */ export enum LegalEntityEntityType { EntityTypeUnspecified = "ENTITY_TYPE_UNSPECIFIED", Corporation = "CORPORATION", LimitedLiabilityCompany = "LIMITED_LIABILITY_COMPANY", Trust = "TRUST", Estate = "ESTATE", } /** * The entity type. */ export type LegalEntityEntityTypeOpen = OpenEnum; /** * **Field Dependencies:** * * @remarks * * Exempt entities must set `exempt_verifying_beneficial_owners` to `true` and provide an `exempt_customer_reason` on the owner record. * * Required if `exempt_verifying_beneficial_owners` is `true`. * * Otherwise, must be empty. */ export enum LegalEntityExemptCustomerReason { ExemptReasonUnspecified = "EXEMPT_REASON_UNSPECIFIED", RegulatedFinancialInstitution = "REGULATED_FINANCIAL_INSTITUTION", DepartmentOrAgencyOfFederalStateOrSubdivision = "DEPARTMENT_OR_AGENCY_OF_FEDERAL_STATE_OR_SUBDIVISION", NonBankListedEntity = "NON_BANK_LISTED_ENTITY", Section12SecuritiesExchangeAct1934Or15D = "SECTION_12_SECURITIES_EXCHANGE_ACT_1934_OR_15D", Section3InvestmentCompanyAct1940 = "SECTION_3_INVESTMENT_COMPANY_ACT_1940", Section202AInvestmentAdvisorsAct1940 = "SECTION_202A_INVESTMENT_ADVISORS_ACT_1940", Section3SecuritiesExchangeAct1934Section6Or17A = "SECTION_3_SECURITIES_EXCHANGE_ACT_1934_SECTION_6_OR_17A", AnyOtherSecuritiesExchangeAct1934 = "ANY_OTHER_SECURITIES_EXCHANGE_ACT_1934", CommodityFuturesTradingCommissionRegistered = "COMMODITY_FUTURES_TRADING_COMMISSION_REGISTERED", PublicAccountingFirmSection102SarbanesOxley = "PUBLIC_ACCOUNTING_FIRM_SECTION_102_SARBANES_OXLEY", StateRegulatedInsuranceCompany = "STATE_REGULATED_INSURANCE_COMPANY", } /** * **Field Dependencies:** * * @remarks * * Exempt entities must set `exempt_verifying_beneficial_owners` to `true` and provide an `exempt_customer_reason` on the owner record. * * Required if `exempt_verifying_beneficial_owners` is `true`. * * Otherwise, must be empty. */ export type LegalEntityExemptCustomerReasonOpen = OpenEnum< typeof LegalEntityExemptCustomerReason >; /** * If the legal entity is a trust, the formation date is required. */ export type FormationDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * The date on which the trader meets or exceeds the large trader reporting threshold, which is defined by the U.S. Securities and Exchange Commission (SEC) as trades of 2 million shares or $20 million in a single day or 20 million shares or $200 million during a calendar month */ export type LegalEntityEffectiveDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * Large trader for the legal entity. */ export type LegalEntityLargeTrader = { /** * The date on which the trader meets or exceeds the large trader reporting threshold, which is defined by the U.S. Securities and Exchange Commission (SEC) as trades of 2 million shares or $20 million in a single day or 20 million shares or $200 million during a calendar month */ effectiveDate?: LegalEntityEffectiveDate | null | undefined; /** * SEC-issued ID signifying the person/entity as a large trader; Required for CAIS regulatory reporting. */ largeTraderId?: string | undefined; }; /** * The mailing address of the legal entity. Required fields within the `legal_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ export type LegalAddress = { /** * Unstructured address lines describing the lower levels of an address. * * @remarks * * Because values in address_lines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the most specific line of an address can be selected based on the language. * * The minimum permitted structural representation of an address consists of a region_code with all remaining information placed in the address_lines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. * * Creating an address only containing a region_code and address_lines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas). */ addressLines?: Array | undefined; /** * Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated. */ administrativeArea?: string | undefined; /** * Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. * * @remarks * * If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). * * Examples: "zh-Hant", "ja", "ja-Latn", "en". */ languageCode?: string | undefined; /** * Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use address_lines. */ locality?: string | undefined; /** * Optional. The name of the organization at the address. */ organization?: string | undefined; /** * Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.). */ postalCode?: string | undefined; /** * Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information. */ recipients?: Array | undefined; /** * Required. CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland. */ regionCode?: string | undefined; /** * The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision. * * @remarks * * All new revisions **must** be backward compatible with old revisions. */ revision?: number | undefined; /** * Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). */ sortingCode?: string | undefined; /** * Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts. */ sublocality?: string | undefined; }; /** * The nature of the U.S. Tax ID indicated in the related tax_id field; Examples include ITIN, SSN, EIN. */ export enum LegalEntityTaxIdType { TaxIdTypeUnspecified = "TAX_ID_TYPE_UNSPECIFIED", TaxIdTypeSsn = "TAX_ID_TYPE_SSN", TaxIdTypeItin = "TAX_ID_TYPE_ITIN", TaxIdTypeEin = "TAX_ID_TYPE_EIN", } /** * The nature of the U.S. Tax ID indicated in the related tax_id field; Examples include ITIN, SSN, EIN. */ export type LegalEntityTaxIdTypeOpen = OpenEnum; /** * C Notice date. */ export type LegalEntityCNoticeDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * Federal tax classification. */ export enum LegalEntityFederalTaxClassification { FederalTaxClassificationUnspecified = "FEDERAL_TAX_CLASSIFICATION_UNSPECIFIED", IndivSolepropOrSinglememberllc = "INDIV_SOLEPROP_OR_SINGLEMEMBERLLC", CCorporation = "C_CORPORATION", SCorporation = "S_CORPORATION", TrustEstate = "TRUST_ESTATE", LlcTaxedAsCCorp = "LLC_TAXED_AS_C_CORP", LlcTaxedAsSCorp = "LLC_TAXED_AS_S_CORP", LlcTaxedAsPartnership = "LLC_TAXED_AS_PARTNERSHIP", Other = "OTHER", } /** * Federal tax classification. */ export type LegalEntityFederalTaxClassificationOpen = OpenEnum< typeof LegalEntityFederalTaxClassification >; /** * Initial B Notice date. */ export type LegalEntityFirstBNoticeDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * IRS form type. */ export enum LegalEntityIrsFormType { IrsFormTypeUnspecified = "IRS_FORM_TYPE_UNSPECIFIED", W9 = "W_9", W8Ben = "W_8BEN", } /** * IRS form type. */ export type LegalEntityIrsFormTypeOpen = OpenEnum< typeof LegalEntityIrsFormType >; /** * Tax reporting eligibility. */ export enum LegalEntityReportingEligibility { TaxReportingEligibilityUnspecified = "TAX_REPORTING_ELIGIBILITY_UNSPECIFIED", Eligible = "ELIGIBLE", Ineligible = "INELIGIBLE", } /** * Tax reporting eligibility. */ export type LegalEntityReportingEligibilityOpen = OpenEnum< typeof LegalEntityReportingEligibility >; /** * Tax Certification date. */ export type LegalEntityTaxCertificationDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * Taxpayer certification status. */ export enum LegalEntityTaxpayerCertificationState { TaxpayerCertificationStateUnspecified = "TAXPAYER_CERTIFICATION_STATE_UNSPECIFIED", Certified = "CERTIFIED", Uncertified = "UNCERTIFIED", PendingCertification = "PENDING_CERTIFICATION", } /** * Taxpayer certification status. */ export type LegalEntityTaxpayerCertificationStateOpen = OpenEnum< typeof LegalEntityTaxpayerCertificationState >; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export enum LegalEntityUsTinStatus { UsTinStatusUnspecified = "US_TIN_STATUS_UNSPECIFIED", Passing = "PASSING", Failing = "FAILING", } /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export type LegalEntityUsTinStatusOpen = OpenEnum< typeof LegalEntityUsTinStatus >; /** * B/C Notice status. */ export enum LegalEntityWithholdingState { WithholdingStateUnspecified = "WITHHOLDING_STATE_UNSPECIFIED", FirstBNoticeReceived = "FIRST_B_NOTICE_RECEIVED", SecondBNoticeReceived = "SECOND_B_NOTICE_RECEIVED", CNoticeReceived = "C_NOTICE_RECEIVED", CNoticeIndicatedByCustomer = "C_NOTICE_INDICATED_BY_CUSTOMER", } /** * B/C Notice status. */ export type LegalEntityWithholdingStateOpen = OpenEnum< typeof LegalEntityWithholdingState >; /** * The tax profile for the legal entity. */ export type LegalEntityTaxProfile = { /** * C Notice date. */ cNoticeDate?: LegalEntityCNoticeDate | null | undefined; /** * Federal tax classification. */ federalTaxClassification?: | LegalEntityFederalTaxClassificationOpen | undefined; /** * Initial B Notice date. */ firstBNoticeDate?: LegalEntityFirstBNoticeDate | null | undefined; /** * IRS form type. */ irsFormType?: LegalEntityIrsFormTypeOpen | undefined; /** * Legal tax region must be "US" if provided W-9, otherwise must be a non-US country. */ legalTaxRegionCode?: string | undefined; /** * Tax reporting eligibility. */ reportingEligibility?: LegalEntityReportingEligibilityOpen | undefined; /** * Tax Certification date. */ taxCertificationDate?: LegalEntityTaxCertificationDate | null | undefined; /** * Taxpayer certification status. */ taxpayerCertificationState?: | LegalEntityTaxpayerCertificationStateOpen | undefined; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ usTinStatus?: LegalEntityUsTinStatusOpen | undefined; /** * B/C Notice status. */ withholdingState?: LegalEntityWithholdingStateOpen | undefined; }; /** * A legal entity. Legal entities are organizations, such as companies, that participate in financial transactions */ export type LegalEntity = { /** * Indicates whether the entity is an accredited investor. By default, this is set to `false`. */ accreditedInvestor?: boolean | undefined; /** * Indicates whether the entity is an adviser. By default, this is set to `false`. */ adviser?: boolean | undefined; /** * Indicates whether the entity is a broker dealer. By default, this is set to `false`. */ brokerDealer?: boolean | undefined; businessIndustrialClassification?: | LegalEntityBusinessIndustrialClassificationOpen | undefined; /** * An external identifier for the legal entity. This identifier does not have internal uniqueness constraints. */ clientEntityId?: string | undefined; /** * Corporate structure of the entity. */ corporateStructure?: LegalEntityCorporateStructureOpen | undefined; /** * The correspondent id associated with the legal entity. */ correspondentId?: string | undefined; /** * DBA (Doing Business As) names. Can list up to 5 associated with the Legal Entity */ doingBusinessAs?: Array | undefined; /** * Due Diligence for Legal Entities */ entityDueDiligence?: EntityDueDiligence | null | undefined; /** * The legal entity name. */ entityName?: string | undefined; /** * The entity type. */ entityType?: LegalEntityEntityTypeOpen | undefined; /** * **Field Dependencies:** * * @remarks * * Exempt entities must set `exempt_verifying_beneficial_owners` to `true` and provide an `exempt_customer_reason` on the owner record. * * Required if `exempt_verifying_beneficial_owners` is `true`. * * Otherwise, must be empty. */ exemptCustomerReason?: LegalEntityExemptCustomerReasonOpen | undefined; /** * Indicates whether the entity is exempt from verifying beneficial owners and Enhanced Due Diligence. By default, this is set to `false` */ exemptVerifyingBeneficialOwners?: boolean | undefined; /** * If the legal entity is a trust, they may set this field to convey ownership and value to a trustee. */ forTheBenefitOf?: string | undefined; /** * Indicates whether the entity is a foreign entity. By default, this is set to `false`. */ foreignEntity?: boolean | undefined; /** * Indicates whether the entity is a foreign financial institution. By default, this is set to `false`. */ foreignFinancialInstitution?: boolean | undefined; /** * If the legal entity is a trust, the formation date is required. */ formationDate?: FormationDate | null | undefined; /** * Globally Unique identifier for a legal natural person */ globalPersonId?: string | undefined; /** * Indicates whether the entity is an institutional customer. By default, this is set to `false`. */ institutionalCustomer?: boolean | undefined; /** * Investigation id relating to the Customer Identification Program (CIP) and Customer Due Diligence (CDD). */ investigationId?: string | undefined; /** * Large trader for the legal entity. */ largeTrader?: LegalEntityLargeTrader | null | undefined; /** * The mailing address of the legal entity. Required fields within the `legal_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ legalAddress?: LegalAddress | null | undefined; /** * A system-generated unique identifier referencing a single juridical (non-natural) person (e.g., a corporation); Used to access the record after creation */ legalEntityId?: string | undefined; /** * The Legal Entity Identifier (LEI) is the financial industry term for a unique global identifier for legal entities participating in financial transactions */ leiCode?: string | undefined; /** * The name field Format: legalEntities/{legalEntity} */ name?: string | undefined; /** * The operational footprint of an entity. Operating regions encompass all countries and regions where a company has a significant business presence This includes locations with physical offices, manufacturing plants, service centers, and sales and marketing activities Regions must be provided as two-character CLDR country codes */ operatingRegions?: Array | undefined; /** * The legal home of an entity. A region of registration, in the context of a corporation, refers to the specific geographic area where the corporation is legally registered and incorporated Defines the legal jurisdiction and framework under which the corporation operates, including legal regulations, tax obligations, and compliance requirements Region must be provided as a two-character CLDR country code */ registrationRegion?: string | undefined; /** * Indicates whether the entity is a regulated investment company. By default, this is set to `false`. */ regulatedInvestmentCompany?: boolean | undefined; /** * Document ids related to the legal entity. At least one is required for RIA correspondents when creating Estate or Trust accounts. */ relatedDocumentIds?: Array | undefined; /** * Indicates whether the trust is a revocable trust. By default, this is set to `false`. */ revocableTrust?: boolean | undefined; /** * The full U.S. tax ID for a related entity; Must be provided with `EIN` tax ID type */ taxId?: string | undefined; /** * The last four characters of the related person's tax identifier; Masked/truncated to "last four" in most usage contexts to preserve data privacy. */ taxIdLastFour?: string | undefined; /** * The nature of the U.S. Tax ID indicated in the related tax_id field; Examples include ITIN, SSN, EIN. */ taxIdType?: LegalEntityTaxIdTypeOpen | undefined; /** * The tax profile for the legal entity. */ taxProfile?: LegalEntityTaxProfile | null | undefined; }; /** @internal */ export const LegalEntityBusinessIndustrialClassification$inboundSchema: z.ZodType< LegalEntityBusinessIndustrialClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityBusinessIndustrialClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityBusinessIndustrialClassification$outboundSchema: z.ZodType< LegalEntityBusinessIndustrialClassificationOpen, z.ZodTypeDef, LegalEntityBusinessIndustrialClassificationOpen > = z.union([ z.nativeEnum(LegalEntityBusinessIndustrialClassification), 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 LegalEntityBusinessIndustrialClassification$ { /** @deprecated use `LegalEntityBusinessIndustrialClassification$inboundSchema` instead. */ export const inboundSchema = LegalEntityBusinessIndustrialClassification$inboundSchema; /** @deprecated use `LegalEntityBusinessIndustrialClassification$outboundSchema` instead. */ export const outboundSchema = LegalEntityBusinessIndustrialClassification$outboundSchema; } /** @internal */ export const LegalEntityCorporateStructure$inboundSchema: z.ZodType< LegalEntityCorporateStructureOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityCorporateStructure), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityCorporateStructure$outboundSchema: z.ZodType< LegalEntityCorporateStructureOpen, z.ZodTypeDef, LegalEntityCorporateStructureOpen > = z.union([ z.nativeEnum(LegalEntityCorporateStructure), 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 LegalEntityCorporateStructure$ { /** @deprecated use `LegalEntityCorporateStructure$inboundSchema` instead. */ export const inboundSchema = LegalEntityCorporateStructure$inboundSchema; /** @deprecated use `LegalEntityCorporateStructure$outboundSchema` instead. */ export const outboundSchema = LegalEntityCorporateStructure$outboundSchema; } /** @internal */ export const LegalEntityNegativeNews$inboundSchema: z.ZodType< LegalEntityNegativeNews, z.ZodTypeDef, unknown > = z.object({ negative_news_against_related_parties: z.boolean().optional(), negative_news_against_related_parties_description: z.string().optional(), }).transform((v) => { return remap$(v, { "negative_news_against_related_parties": "negativeNewsAgainstRelatedParties", "negative_news_against_related_parties_description": "negativeNewsAgainstRelatedPartiesDescription", }); }); /** @internal */ export type LegalEntityNegativeNews$Outbound = { negative_news_against_related_parties?: boolean | undefined; negative_news_against_related_parties_description?: string | undefined; }; /** @internal */ export const LegalEntityNegativeNews$outboundSchema: z.ZodType< LegalEntityNegativeNews$Outbound, z.ZodTypeDef, LegalEntityNegativeNews > = z.object({ negativeNewsAgainstRelatedParties: z.boolean().optional(), negativeNewsAgainstRelatedPartiesDescription: z.string().optional(), }).transform((v) => { return remap$(v, { negativeNewsAgainstRelatedParties: "negative_news_against_related_parties", negativeNewsAgainstRelatedPartiesDescription: "negative_news_against_related_parties_description", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityNegativeNews$ { /** @deprecated use `LegalEntityNegativeNews$inboundSchema` instead. */ export const inboundSchema = LegalEntityNegativeNews$inboundSchema; /** @deprecated use `LegalEntityNegativeNews$outboundSchema` instead. */ export const outboundSchema = LegalEntityNegativeNews$outboundSchema; /** @deprecated use `LegalEntityNegativeNews$Outbound` instead. */ export type Outbound = LegalEntityNegativeNews$Outbound; } export function legalEntityNegativeNewsToJSON( legalEntityNegativeNews: LegalEntityNegativeNews, ): string { return JSON.stringify( LegalEntityNegativeNews$outboundSchema.parse(legalEntityNegativeNews), ); } export function legalEntityNegativeNewsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityNegativeNews$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityNegativeNews' from JSON`, ); } /** @internal */ export const EntityDueDiligence$inboundSchema: z.ZodType< EntityDueDiligence, z.ZodTypeDef, unknown > = z.object({ entity_issues_bearer_shares: z.boolean().optional(), negative_news: z.nullable(z.lazy(() => LegalEntityNegativeNews$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "entity_issues_bearer_shares": "entityIssuesBearerShares", "negative_news": "negativeNews", }); }); /** @internal */ export type EntityDueDiligence$Outbound = { entity_issues_bearer_shares?: boolean | undefined; negative_news?: LegalEntityNegativeNews$Outbound | null | undefined; }; /** @internal */ export const EntityDueDiligence$outboundSchema: z.ZodType< EntityDueDiligence$Outbound, z.ZodTypeDef, EntityDueDiligence > = z.object({ entityIssuesBearerShares: z.boolean().optional(), negativeNews: z.nullable(z.lazy(() => LegalEntityNegativeNews$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { entityIssuesBearerShares: "entity_issues_bearer_shares", negativeNews: "negative_news", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EntityDueDiligence$ { /** @deprecated use `EntityDueDiligence$inboundSchema` instead. */ export const inboundSchema = EntityDueDiligence$inboundSchema; /** @deprecated use `EntityDueDiligence$outboundSchema` instead. */ export const outboundSchema = EntityDueDiligence$outboundSchema; /** @deprecated use `EntityDueDiligence$Outbound` instead. */ export type Outbound = EntityDueDiligence$Outbound; } export function entityDueDiligenceToJSON( entityDueDiligence: EntityDueDiligence, ): string { return JSON.stringify( EntityDueDiligence$outboundSchema.parse(entityDueDiligence), ); } export function entityDueDiligenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EntityDueDiligence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntityDueDiligence' from JSON`, ); } /** @internal */ export const LegalEntityEntityType$inboundSchema: z.ZodType< LegalEntityEntityTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityEntityType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityEntityType$outboundSchema: z.ZodType< LegalEntityEntityTypeOpen, z.ZodTypeDef, LegalEntityEntityTypeOpen > = z.union([ z.nativeEnum(LegalEntityEntityType), 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 LegalEntityEntityType$ { /** @deprecated use `LegalEntityEntityType$inboundSchema` instead. */ export const inboundSchema = LegalEntityEntityType$inboundSchema; /** @deprecated use `LegalEntityEntityType$outboundSchema` instead. */ export const outboundSchema = LegalEntityEntityType$outboundSchema; } /** @internal */ export const LegalEntityExemptCustomerReason$inboundSchema: z.ZodType< LegalEntityExemptCustomerReasonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityExemptCustomerReason), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityExemptCustomerReason$outboundSchema: z.ZodType< LegalEntityExemptCustomerReasonOpen, z.ZodTypeDef, LegalEntityExemptCustomerReasonOpen > = z.union([ z.nativeEnum(LegalEntityExemptCustomerReason), 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 LegalEntityExemptCustomerReason$ { /** @deprecated use `LegalEntityExemptCustomerReason$inboundSchema` instead. */ export const inboundSchema = LegalEntityExemptCustomerReason$inboundSchema; /** @deprecated use `LegalEntityExemptCustomerReason$outboundSchema` instead. */ export const outboundSchema = LegalEntityExemptCustomerReason$outboundSchema; } /** @internal */ export const FormationDate$inboundSchema: z.ZodType< FormationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type FormationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const FormationDate$outboundSchema: z.ZodType< FormationDate$Outbound, z.ZodTypeDef, FormationDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FormationDate$ { /** @deprecated use `FormationDate$inboundSchema` instead. */ export const inboundSchema = FormationDate$inboundSchema; /** @deprecated use `FormationDate$outboundSchema` instead. */ export const outboundSchema = FormationDate$outboundSchema; /** @deprecated use `FormationDate$Outbound` instead. */ export type Outbound = FormationDate$Outbound; } export function formationDateToJSON(formationDate: FormationDate): string { return JSON.stringify(FormationDate$outboundSchema.parse(formationDate)); } export function formationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FormationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FormationDate' from JSON`, ); } /** @internal */ export const LegalEntityEffectiveDate$inboundSchema: z.ZodType< LegalEntityEffectiveDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type LegalEntityEffectiveDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const LegalEntityEffectiveDate$outboundSchema: z.ZodType< LegalEntityEffectiveDate$Outbound, z.ZodTypeDef, LegalEntityEffectiveDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityEffectiveDate$ { /** @deprecated use `LegalEntityEffectiveDate$inboundSchema` instead. */ export const inboundSchema = LegalEntityEffectiveDate$inboundSchema; /** @deprecated use `LegalEntityEffectiveDate$outboundSchema` instead. */ export const outboundSchema = LegalEntityEffectiveDate$outboundSchema; /** @deprecated use `LegalEntityEffectiveDate$Outbound` instead. */ export type Outbound = LegalEntityEffectiveDate$Outbound; } export function legalEntityEffectiveDateToJSON( legalEntityEffectiveDate: LegalEntityEffectiveDate, ): string { return JSON.stringify( LegalEntityEffectiveDate$outboundSchema.parse(legalEntityEffectiveDate), ); } export function legalEntityEffectiveDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityEffectiveDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityEffectiveDate' from JSON`, ); } /** @internal */ export const LegalEntityLargeTrader$inboundSchema: z.ZodType< LegalEntityLargeTrader, z.ZodTypeDef, unknown > = z.object({ effective_date: z.nullable( z.lazy(() => LegalEntityEffectiveDate$inboundSchema), ).optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type LegalEntityLargeTrader$Outbound = { effective_date?: LegalEntityEffectiveDate$Outbound | null | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const LegalEntityLargeTrader$outboundSchema: z.ZodType< LegalEntityLargeTrader$Outbound, z.ZodTypeDef, LegalEntityLargeTrader > = z.object({ effectiveDate: z.nullable( z.lazy(() => LegalEntityEffectiveDate$outboundSchema), ).optional(), largeTraderId: z.string().optional(), }).transform((v) => { return remap$(v, { effectiveDate: "effective_date", largeTraderId: "large_trader_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityLargeTrader$ { /** @deprecated use `LegalEntityLargeTrader$inboundSchema` instead. */ export const inboundSchema = LegalEntityLargeTrader$inboundSchema; /** @deprecated use `LegalEntityLargeTrader$outboundSchema` instead. */ export const outboundSchema = LegalEntityLargeTrader$outboundSchema; /** @deprecated use `LegalEntityLargeTrader$Outbound` instead. */ export type Outbound = LegalEntityLargeTrader$Outbound; } export function legalEntityLargeTraderToJSON( legalEntityLargeTrader: LegalEntityLargeTrader, ): string { return JSON.stringify( LegalEntityLargeTrader$outboundSchema.parse(legalEntityLargeTrader), ); } export function legalEntityLargeTraderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityLargeTrader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityLargeTrader' from JSON`, ); } /** @internal */ export const LegalAddress$inboundSchema: z.ZodType< LegalAddress, z.ZodTypeDef, unknown > = z.object({ address_lines: z.array(z.string()).optional(), administrative_area: z.string().optional(), language_code: z.string().optional(), locality: z.string().optional(), organization: z.string().optional(), postal_code: z.string().optional(), recipients: z.array(z.string()).optional(), region_code: z.string().optional(), revision: z.number().int().optional(), sorting_code: z.string().optional(), sublocality: z.string().optional(), }).transform((v) => { return remap$(v, { "address_lines": "addressLines", "administrative_area": "administrativeArea", "language_code": "languageCode", "postal_code": "postalCode", "region_code": "regionCode", "sorting_code": "sortingCode", }); }); /** @internal */ export type LegalAddress$Outbound = { address_lines?: Array | undefined; administrative_area?: string | undefined; language_code?: string | undefined; locality?: string | undefined; organization?: string | undefined; postal_code?: string | undefined; recipients?: Array | undefined; region_code?: string | undefined; revision?: number | undefined; sorting_code?: string | undefined; sublocality?: string | undefined; }; /** @internal */ export const LegalAddress$outboundSchema: z.ZodType< LegalAddress$Outbound, z.ZodTypeDef, LegalAddress > = z.object({ addressLines: z.array(z.string()).optional(), administrativeArea: z.string().optional(), languageCode: z.string().optional(), locality: z.string().optional(), organization: z.string().optional(), postalCode: z.string().optional(), recipients: z.array(z.string()).optional(), regionCode: z.string().optional(), revision: z.number().int().optional(), sortingCode: z.string().optional(), sublocality: z.string().optional(), }).transform((v) => { return remap$(v, { addressLines: "address_lines", administrativeArea: "administrative_area", languageCode: "language_code", postalCode: "postal_code", regionCode: "region_code", sortingCode: "sorting_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalAddress$ { /** @deprecated use `LegalAddress$inboundSchema` instead. */ export const inboundSchema = LegalAddress$inboundSchema; /** @deprecated use `LegalAddress$outboundSchema` instead. */ export const outboundSchema = LegalAddress$outboundSchema; /** @deprecated use `LegalAddress$Outbound` instead. */ export type Outbound = LegalAddress$Outbound; } export function legalAddressToJSON(legalAddress: LegalAddress): string { return JSON.stringify(LegalAddress$outboundSchema.parse(legalAddress)); } export function legalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalAddress' from JSON`, ); } /** @internal */ export const LegalEntityTaxIdType$inboundSchema: z.ZodType< LegalEntityTaxIdTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityTaxIdType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityTaxIdType$outboundSchema: z.ZodType< LegalEntityTaxIdTypeOpen, z.ZodTypeDef, LegalEntityTaxIdTypeOpen > = z.union([ z.nativeEnum(LegalEntityTaxIdType), 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 LegalEntityTaxIdType$ { /** @deprecated use `LegalEntityTaxIdType$inboundSchema` instead. */ export const inboundSchema = LegalEntityTaxIdType$inboundSchema; /** @deprecated use `LegalEntityTaxIdType$outboundSchema` instead. */ export const outboundSchema = LegalEntityTaxIdType$outboundSchema; } /** @internal */ export const LegalEntityCNoticeDate$inboundSchema: z.ZodType< LegalEntityCNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type LegalEntityCNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const LegalEntityCNoticeDate$outboundSchema: z.ZodType< LegalEntityCNoticeDate$Outbound, z.ZodTypeDef, LegalEntityCNoticeDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityCNoticeDate$ { /** @deprecated use `LegalEntityCNoticeDate$inboundSchema` instead. */ export const inboundSchema = LegalEntityCNoticeDate$inboundSchema; /** @deprecated use `LegalEntityCNoticeDate$outboundSchema` instead. */ export const outboundSchema = LegalEntityCNoticeDate$outboundSchema; /** @deprecated use `LegalEntityCNoticeDate$Outbound` instead. */ export type Outbound = LegalEntityCNoticeDate$Outbound; } export function legalEntityCNoticeDateToJSON( legalEntityCNoticeDate: LegalEntityCNoticeDate, ): string { return JSON.stringify( LegalEntityCNoticeDate$outboundSchema.parse(legalEntityCNoticeDate), ); } export function legalEntityCNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityCNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityCNoticeDate' from JSON`, ); } /** @internal */ export const LegalEntityFederalTaxClassification$inboundSchema: z.ZodType< LegalEntityFederalTaxClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityFederalTaxClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityFederalTaxClassification$outboundSchema: z.ZodType< LegalEntityFederalTaxClassificationOpen, z.ZodTypeDef, LegalEntityFederalTaxClassificationOpen > = z.union([ z.nativeEnum(LegalEntityFederalTaxClassification), 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 LegalEntityFederalTaxClassification$ { /** @deprecated use `LegalEntityFederalTaxClassification$inboundSchema` instead. */ export const inboundSchema = LegalEntityFederalTaxClassification$inboundSchema; /** @deprecated use `LegalEntityFederalTaxClassification$outboundSchema` instead. */ export const outboundSchema = LegalEntityFederalTaxClassification$outboundSchema; } /** @internal */ export const LegalEntityFirstBNoticeDate$inboundSchema: z.ZodType< LegalEntityFirstBNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type LegalEntityFirstBNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const LegalEntityFirstBNoticeDate$outboundSchema: z.ZodType< LegalEntityFirstBNoticeDate$Outbound, z.ZodTypeDef, LegalEntityFirstBNoticeDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityFirstBNoticeDate$ { /** @deprecated use `LegalEntityFirstBNoticeDate$inboundSchema` instead. */ export const inboundSchema = LegalEntityFirstBNoticeDate$inboundSchema; /** @deprecated use `LegalEntityFirstBNoticeDate$outboundSchema` instead. */ export const outboundSchema = LegalEntityFirstBNoticeDate$outboundSchema; /** @deprecated use `LegalEntityFirstBNoticeDate$Outbound` instead. */ export type Outbound = LegalEntityFirstBNoticeDate$Outbound; } export function legalEntityFirstBNoticeDateToJSON( legalEntityFirstBNoticeDate: LegalEntityFirstBNoticeDate, ): string { return JSON.stringify( LegalEntityFirstBNoticeDate$outboundSchema.parse( legalEntityFirstBNoticeDate, ), ); } export function legalEntityFirstBNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityFirstBNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityFirstBNoticeDate' from JSON`, ); } /** @internal */ export const LegalEntityIrsFormType$inboundSchema: z.ZodType< LegalEntityIrsFormTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityIrsFormType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityIrsFormType$outboundSchema: z.ZodType< LegalEntityIrsFormTypeOpen, z.ZodTypeDef, LegalEntityIrsFormTypeOpen > = z.union([ z.nativeEnum(LegalEntityIrsFormType), 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 LegalEntityIrsFormType$ { /** @deprecated use `LegalEntityIrsFormType$inboundSchema` instead. */ export const inboundSchema = LegalEntityIrsFormType$inboundSchema; /** @deprecated use `LegalEntityIrsFormType$outboundSchema` instead. */ export const outboundSchema = LegalEntityIrsFormType$outboundSchema; } /** @internal */ export const LegalEntityReportingEligibility$inboundSchema: z.ZodType< LegalEntityReportingEligibilityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityReportingEligibility), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityReportingEligibility$outboundSchema: z.ZodType< LegalEntityReportingEligibilityOpen, z.ZodTypeDef, LegalEntityReportingEligibilityOpen > = z.union([ z.nativeEnum(LegalEntityReportingEligibility), 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 LegalEntityReportingEligibility$ { /** @deprecated use `LegalEntityReportingEligibility$inboundSchema` instead. */ export const inboundSchema = LegalEntityReportingEligibility$inboundSchema; /** @deprecated use `LegalEntityReportingEligibility$outboundSchema` instead. */ export const outboundSchema = LegalEntityReportingEligibility$outboundSchema; } /** @internal */ export const LegalEntityTaxCertificationDate$inboundSchema: z.ZodType< LegalEntityTaxCertificationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type LegalEntityTaxCertificationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const LegalEntityTaxCertificationDate$outboundSchema: z.ZodType< LegalEntityTaxCertificationDate$Outbound, z.ZodTypeDef, LegalEntityTaxCertificationDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityTaxCertificationDate$ { /** @deprecated use `LegalEntityTaxCertificationDate$inboundSchema` instead. */ export const inboundSchema = LegalEntityTaxCertificationDate$inboundSchema; /** @deprecated use `LegalEntityTaxCertificationDate$outboundSchema` instead. */ export const outboundSchema = LegalEntityTaxCertificationDate$outboundSchema; /** @deprecated use `LegalEntityTaxCertificationDate$Outbound` instead. */ export type Outbound = LegalEntityTaxCertificationDate$Outbound; } export function legalEntityTaxCertificationDateToJSON( legalEntityTaxCertificationDate: LegalEntityTaxCertificationDate, ): string { return JSON.stringify( LegalEntityTaxCertificationDate$outboundSchema.parse( legalEntityTaxCertificationDate, ), ); } export function legalEntityTaxCertificationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityTaxCertificationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityTaxCertificationDate' from JSON`, ); } /** @internal */ export const LegalEntityTaxpayerCertificationState$inboundSchema: z.ZodType< LegalEntityTaxpayerCertificationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityTaxpayerCertificationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityTaxpayerCertificationState$outboundSchema: z.ZodType< LegalEntityTaxpayerCertificationStateOpen, z.ZodTypeDef, LegalEntityTaxpayerCertificationStateOpen > = z.union([ z.nativeEnum(LegalEntityTaxpayerCertificationState), 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 LegalEntityTaxpayerCertificationState$ { /** @deprecated use `LegalEntityTaxpayerCertificationState$inboundSchema` instead. */ export const inboundSchema = LegalEntityTaxpayerCertificationState$inboundSchema; /** @deprecated use `LegalEntityTaxpayerCertificationState$outboundSchema` instead. */ export const outboundSchema = LegalEntityTaxpayerCertificationState$outboundSchema; } /** @internal */ export const LegalEntityUsTinStatus$inboundSchema: z.ZodType< LegalEntityUsTinStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityUsTinStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityUsTinStatus$outboundSchema: z.ZodType< LegalEntityUsTinStatusOpen, z.ZodTypeDef, LegalEntityUsTinStatusOpen > = z.union([ z.nativeEnum(LegalEntityUsTinStatus), 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 LegalEntityUsTinStatus$ { /** @deprecated use `LegalEntityUsTinStatus$inboundSchema` instead. */ export const inboundSchema = LegalEntityUsTinStatus$inboundSchema; /** @deprecated use `LegalEntityUsTinStatus$outboundSchema` instead. */ export const outboundSchema = LegalEntityUsTinStatus$outboundSchema; } /** @internal */ export const LegalEntityWithholdingState$inboundSchema: z.ZodType< LegalEntityWithholdingStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalEntityWithholdingState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalEntityWithholdingState$outboundSchema: z.ZodType< LegalEntityWithholdingStateOpen, z.ZodTypeDef, LegalEntityWithholdingStateOpen > = z.union([ z.nativeEnum(LegalEntityWithholdingState), 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 LegalEntityWithholdingState$ { /** @deprecated use `LegalEntityWithholdingState$inboundSchema` instead. */ export const inboundSchema = LegalEntityWithholdingState$inboundSchema; /** @deprecated use `LegalEntityWithholdingState$outboundSchema` instead. */ export const outboundSchema = LegalEntityWithholdingState$outboundSchema; } /** @internal */ export const LegalEntityTaxProfile$inboundSchema: z.ZodType< LegalEntityTaxProfile, z.ZodTypeDef, unknown > = z.object({ c_notice_date: z.nullable(z.lazy(() => LegalEntityCNoticeDate$inboundSchema)) .optional(), federal_tax_classification: LegalEntityFederalTaxClassification$inboundSchema .optional(), first_b_notice_date: z.nullable( z.lazy(() => LegalEntityFirstBNoticeDate$inboundSchema), ).optional(), irs_form_type: LegalEntityIrsFormType$inboundSchema.optional(), legal_tax_region_code: z.string().optional(), reporting_eligibility: LegalEntityReportingEligibility$inboundSchema .optional(), tax_certification_date: z.nullable( z.lazy(() => LegalEntityTaxCertificationDate$inboundSchema), ).optional(), taxpayer_certification_state: LegalEntityTaxpayerCertificationState$inboundSchema.optional(), us_tin_status: LegalEntityUsTinStatus$inboundSchema.optional(), withholding_state: LegalEntityWithholdingState$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "c_notice_date": "cNoticeDate", "federal_tax_classification": "federalTaxClassification", "first_b_notice_date": "firstBNoticeDate", "irs_form_type": "irsFormType", "legal_tax_region_code": "legalTaxRegionCode", "reporting_eligibility": "reportingEligibility", "tax_certification_date": "taxCertificationDate", "taxpayer_certification_state": "taxpayerCertificationState", "us_tin_status": "usTinStatus", "withholding_state": "withholdingState", }); }); /** @internal */ export type LegalEntityTaxProfile$Outbound = { c_notice_date?: LegalEntityCNoticeDate$Outbound | null | undefined; federal_tax_classification?: string | undefined; first_b_notice_date?: LegalEntityFirstBNoticeDate$Outbound | null | undefined; irs_form_type?: string | undefined; legal_tax_region_code?: string | undefined; reporting_eligibility?: string | undefined; tax_certification_date?: | LegalEntityTaxCertificationDate$Outbound | null | undefined; taxpayer_certification_state?: string | undefined; us_tin_status?: string | undefined; withholding_state?: string | undefined; }; /** @internal */ export const LegalEntityTaxProfile$outboundSchema: z.ZodType< LegalEntityTaxProfile$Outbound, z.ZodTypeDef, LegalEntityTaxProfile > = z.object({ cNoticeDate: z.nullable(z.lazy(() => LegalEntityCNoticeDate$outboundSchema)) .optional(), federalTaxClassification: LegalEntityFederalTaxClassification$outboundSchema .optional(), firstBNoticeDate: z.nullable( z.lazy(() => LegalEntityFirstBNoticeDate$outboundSchema), ).optional(), irsFormType: LegalEntityIrsFormType$outboundSchema.optional(), legalTaxRegionCode: z.string().optional(), reportingEligibility: LegalEntityReportingEligibility$outboundSchema .optional(), taxCertificationDate: z.nullable( z.lazy(() => LegalEntityTaxCertificationDate$outboundSchema), ).optional(), taxpayerCertificationState: LegalEntityTaxpayerCertificationState$outboundSchema.optional(), usTinStatus: LegalEntityUsTinStatus$outboundSchema.optional(), withholdingState: LegalEntityWithholdingState$outboundSchema.optional(), }).transform((v) => { return remap$(v, { cNoticeDate: "c_notice_date", federalTaxClassification: "federal_tax_classification", firstBNoticeDate: "first_b_notice_date", irsFormType: "irs_form_type", legalTaxRegionCode: "legal_tax_region_code", reportingEligibility: "reporting_eligibility", taxCertificationDate: "tax_certification_date", taxpayerCertificationState: "taxpayer_certification_state", usTinStatus: "us_tin_status", withholdingState: "withholding_state", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntityTaxProfile$ { /** @deprecated use `LegalEntityTaxProfile$inboundSchema` instead. */ export const inboundSchema = LegalEntityTaxProfile$inboundSchema; /** @deprecated use `LegalEntityTaxProfile$outboundSchema` instead. */ export const outboundSchema = LegalEntityTaxProfile$outboundSchema; /** @deprecated use `LegalEntityTaxProfile$Outbound` instead. */ export type Outbound = LegalEntityTaxProfile$Outbound; } export function legalEntityTaxProfileToJSON( legalEntityTaxProfile: LegalEntityTaxProfile, ): string { return JSON.stringify( LegalEntityTaxProfile$outboundSchema.parse(legalEntityTaxProfile), ); } export function legalEntityTaxProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntityTaxProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntityTaxProfile' from JSON`, ); } /** @internal */ export const LegalEntity$inboundSchema: z.ZodType< LegalEntity, z.ZodTypeDef, unknown > = z.object({ accredited_investor: z.boolean().optional(), adviser: z.boolean().optional(), broker_dealer: z.boolean().optional(), business_industrial_classification: LegalEntityBusinessIndustrialClassification$inboundSchema.optional(), client_entity_id: z.string().optional(), corporate_structure: LegalEntityCorporateStructure$inboundSchema.optional(), correspondent_id: z.string().optional(), doing_business_as: z.array(z.string()).optional(), entity_due_diligence: z.nullable( z.lazy(() => EntityDueDiligence$inboundSchema), ).optional(), entity_name: z.string().optional(), entity_type: LegalEntityEntityType$inboundSchema.optional(), exempt_customer_reason: LegalEntityExemptCustomerReason$inboundSchema .optional(), exempt_verifying_beneficial_owners: z.boolean().optional(), for_the_benefit_of: z.string().optional(), foreign_entity: z.boolean().optional(), foreign_financial_institution: z.boolean().optional(), formation_date: z.nullable(z.lazy(() => FormationDate$inboundSchema)) .optional(), global_person_id: z.string().optional(), institutional_customer: z.boolean().optional(), investigation_id: z.string().optional(), large_trader: z.nullable(z.lazy(() => LegalEntityLargeTrader$inboundSchema)) .optional(), legal_address: z.nullable(z.lazy(() => LegalAddress$inboundSchema)) .optional(), legal_entity_id: z.string().optional(), lei_code: z.string().optional(), name: z.string().optional(), operating_regions: z.array(z.string()).optional(), registration_region: z.string().optional(), regulated_investment_company: z.boolean().optional(), related_document_ids: z.array(z.string()).optional(), revocable_trust: z.boolean().optional(), tax_id: z.string().optional(), tax_id_last_four: z.string().optional(), tax_id_type: LegalEntityTaxIdType$inboundSchema.optional(), tax_profile: z.nullable(z.lazy(() => LegalEntityTaxProfile$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "accredited_investor": "accreditedInvestor", "broker_dealer": "brokerDealer", "business_industrial_classification": "businessIndustrialClassification", "client_entity_id": "clientEntityId", "corporate_structure": "corporateStructure", "correspondent_id": "correspondentId", "doing_business_as": "doingBusinessAs", "entity_due_diligence": "entityDueDiligence", "entity_name": "entityName", "entity_type": "entityType", "exempt_customer_reason": "exemptCustomerReason", "exempt_verifying_beneficial_owners": "exemptVerifyingBeneficialOwners", "for_the_benefit_of": "forTheBenefitOf", "foreign_entity": "foreignEntity", "foreign_financial_institution": "foreignFinancialInstitution", "formation_date": "formationDate", "global_person_id": "globalPersonId", "institutional_customer": "institutionalCustomer", "investigation_id": "investigationId", "large_trader": "largeTrader", "legal_address": "legalAddress", "legal_entity_id": "legalEntityId", "lei_code": "leiCode", "operating_regions": "operatingRegions", "registration_region": "registrationRegion", "regulated_investment_company": "regulatedInvestmentCompany", "related_document_ids": "relatedDocumentIds", "revocable_trust": "revocableTrust", "tax_id": "taxId", "tax_id_last_four": "taxIdLastFour", "tax_id_type": "taxIdType", "tax_profile": "taxProfile", }); }); /** @internal */ export type LegalEntity$Outbound = { accredited_investor?: boolean | undefined; adviser?: boolean | undefined; broker_dealer?: boolean | undefined; business_industrial_classification?: string | undefined; client_entity_id?: string | undefined; corporate_structure?: string | undefined; correspondent_id?: string | undefined; doing_business_as?: Array | undefined; entity_due_diligence?: EntityDueDiligence$Outbound | null | undefined; entity_name?: string | undefined; entity_type?: string | undefined; exempt_customer_reason?: string | undefined; exempt_verifying_beneficial_owners?: boolean | undefined; for_the_benefit_of?: string | undefined; foreign_entity?: boolean | undefined; foreign_financial_institution?: boolean | undefined; formation_date?: FormationDate$Outbound | null | undefined; global_person_id?: string | undefined; institutional_customer?: boolean | undefined; investigation_id?: string | undefined; large_trader?: LegalEntityLargeTrader$Outbound | null | undefined; legal_address?: LegalAddress$Outbound | null | undefined; legal_entity_id?: string | undefined; lei_code?: string | undefined; name?: string | undefined; operating_regions?: Array | undefined; registration_region?: string | undefined; regulated_investment_company?: boolean | undefined; related_document_ids?: Array | undefined; revocable_trust?: boolean | undefined; tax_id?: string | undefined; tax_id_last_four?: string | undefined; tax_id_type?: string | undefined; tax_profile?: LegalEntityTaxProfile$Outbound | null | undefined; }; /** @internal */ export const LegalEntity$outboundSchema: z.ZodType< LegalEntity$Outbound, z.ZodTypeDef, LegalEntity > = z.object({ accreditedInvestor: z.boolean().optional(), adviser: z.boolean().optional(), brokerDealer: z.boolean().optional(), businessIndustrialClassification: LegalEntityBusinessIndustrialClassification$outboundSchema.optional(), clientEntityId: z.string().optional(), corporateStructure: LegalEntityCorporateStructure$outboundSchema.optional(), correspondentId: z.string().optional(), doingBusinessAs: z.array(z.string()).optional(), entityDueDiligence: z.nullable( z.lazy(() => EntityDueDiligence$outboundSchema), ).optional(), entityName: z.string().optional(), entityType: LegalEntityEntityType$outboundSchema.optional(), exemptCustomerReason: LegalEntityExemptCustomerReason$outboundSchema .optional(), exemptVerifyingBeneficialOwners: z.boolean().optional(), forTheBenefitOf: z.string().optional(), foreignEntity: z.boolean().optional(), foreignFinancialInstitution: z.boolean().optional(), formationDate: z.nullable(z.lazy(() => FormationDate$outboundSchema)) .optional(), globalPersonId: z.string().optional(), institutionalCustomer: z.boolean().optional(), investigationId: z.string().optional(), largeTrader: z.nullable(z.lazy(() => LegalEntityLargeTrader$outboundSchema)) .optional(), legalAddress: z.nullable(z.lazy(() => LegalAddress$outboundSchema)) .optional(), legalEntityId: z.string().optional(), leiCode: z.string().optional(), name: z.string().optional(), operatingRegions: z.array(z.string()).optional(), registrationRegion: z.string().optional(), regulatedInvestmentCompany: z.boolean().optional(), relatedDocumentIds: z.array(z.string()).optional(), revocableTrust: z.boolean().optional(), taxId: z.string().optional(), taxIdLastFour: z.string().optional(), taxIdType: LegalEntityTaxIdType$outboundSchema.optional(), taxProfile: z.nullable(z.lazy(() => LegalEntityTaxProfile$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { accreditedInvestor: "accredited_investor", brokerDealer: "broker_dealer", businessIndustrialClassification: "business_industrial_classification", clientEntityId: "client_entity_id", corporateStructure: "corporate_structure", correspondentId: "correspondent_id", doingBusinessAs: "doing_business_as", entityDueDiligence: "entity_due_diligence", entityName: "entity_name", entityType: "entity_type", exemptCustomerReason: "exempt_customer_reason", exemptVerifyingBeneficialOwners: "exempt_verifying_beneficial_owners", forTheBenefitOf: "for_the_benefit_of", foreignEntity: "foreign_entity", foreignFinancialInstitution: "foreign_financial_institution", formationDate: "formation_date", globalPersonId: "global_person_id", institutionalCustomer: "institutional_customer", investigationId: "investigation_id", largeTrader: "large_trader", legalAddress: "legal_address", legalEntityId: "legal_entity_id", leiCode: "lei_code", operatingRegions: "operating_regions", registrationRegion: "registration_region", regulatedInvestmentCompany: "regulated_investment_company", relatedDocumentIds: "related_document_ids", revocableTrust: "revocable_trust", taxId: "tax_id", taxIdLastFour: "tax_id_last_four", taxIdType: "tax_id_type", taxProfile: "tax_profile", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LegalEntity$ { /** @deprecated use `LegalEntity$inboundSchema` instead. */ export const inboundSchema = LegalEntity$inboundSchema; /** @deprecated use `LegalEntity$outboundSchema` instead. */ export const outboundSchema = LegalEntity$outboundSchema; /** @deprecated use `LegalEntity$Outbound` instead. */ export type Outbound = LegalEntity$Outbound; } export function legalEntityToJSON(legalEntity: LegalEntity): string { return JSON.stringify(LegalEntity$outboundSchema.parse(legalEntity)); } export function legalEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalEntity' from JSON`, ); }