/* * 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"; /** * Delivery method instruction for CFTC documents for a given Party record; Defaults to `DIGITAL` on futures account creation Only applies to CFTC regulated accounts */ export enum PartyCftcDocumentDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for CFTC documents for a given Party record; Defaults to `DIGITAL` on futures account creation Only applies to CFTC regulated accounts */ export type PartyCftcDocumentDeliveryPreferenceOpen = OpenEnum< typeof PartyCftcDocumentDeliveryPreference >; export enum PartyBusinessIndustrialClassification { 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 PartyBusinessIndustrialClassificationOpen = OpenEnum< typeof PartyBusinessIndustrialClassification >; /** * Corporate structure of the entity. */ export enum PartyCorporateStructure { 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 PartyCorporateStructureOpen = OpenEnum< typeof PartyCorporateStructure >; /** * Information about any negative news against related parties and entities */ export type PartyNegativeNews = { /** * 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 PartyEntityDueDiligence = { /** * Indicates whether the entity issues bearer shares */ entityIssuesBearerShares?: boolean | undefined; /** * Information about any negative news against related parties and entities */ negativeNews?: PartyNegativeNews | null | undefined; }; /** * The entity type. */ export enum PartyEntityType { EntityTypeUnspecified = "ENTITY_TYPE_UNSPECIFIED", Corporation = "CORPORATION", LimitedLiabilityCompany = "LIMITED_LIABILITY_COMPANY", Trust = "TRUST", Estate = "ESTATE", } /** * The entity type. */ export type PartyEntityTypeOpen = 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 PartyExemptCustomerReason { 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 PartyExemptCustomerReasonOpen = OpenEnum< typeof PartyExemptCustomerReason >; /** * If the legal entity is a trust, the formation date is required. */ export type PartyFormationDate = { /** * 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 PartyEffectiveDate = { /** * 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 PartyLargeTrader = { /** * 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?: PartyEffectiveDate | 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 PartyLegalAddress = { /** * 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 PartyTaxIdType { 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 PartyTaxIdTypeOpen = OpenEnum; /** * C Notice date. */ export type PartyCNoticeDate = { /** * 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 PartyFederalTaxClassification { 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 PartyFederalTaxClassificationOpen = OpenEnum< typeof PartyFederalTaxClassification >; /** * Initial B Notice date. */ export type PartyFirstBNoticeDate = { /** * 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 PartyIrsFormType { IrsFormTypeUnspecified = "IRS_FORM_TYPE_UNSPECIFIED", W9 = "W_9", W8Ben = "W_8BEN", } /** * IRS form type. */ export type PartyIrsFormTypeOpen = OpenEnum; /** * Tax reporting eligibility. */ export enum PartyReportingEligibility { TaxReportingEligibilityUnspecified = "TAX_REPORTING_ELIGIBILITY_UNSPECIFIED", Eligible = "ELIGIBLE", Ineligible = "INELIGIBLE", } /** * Tax reporting eligibility. */ export type PartyReportingEligibilityOpen = OpenEnum< typeof PartyReportingEligibility >; /** * Tax Certification date. */ export type PartyTaxCertificationDate = { /** * 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 PartyTaxpayerCertificationState { TaxpayerCertificationStateUnspecified = "TAXPAYER_CERTIFICATION_STATE_UNSPECIFIED", Certified = "CERTIFIED", Uncertified = "UNCERTIFIED", PendingCertification = "PENDING_CERTIFICATION", } /** * Taxpayer certification status. */ export type PartyTaxpayerCertificationStateOpen = OpenEnum< typeof PartyTaxpayerCertificationState >; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export enum PartyUsTinStatus { UsTinStatusUnspecified = "US_TIN_STATUS_UNSPECIFIED", Passing = "PASSING", Failing = "FAILING", } /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export type PartyUsTinStatusOpen = OpenEnum; /** * B/C Notice status. */ export enum PartyWithholdingState { 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 PartyWithholdingStateOpen = OpenEnum; /** * The tax profile for the legal entity. */ export type PartyTaxProfile = { /** * C Notice date. */ cNoticeDate?: PartyCNoticeDate | null | undefined; /** * Federal tax classification. */ federalTaxClassification?: PartyFederalTaxClassificationOpen | undefined; /** * Initial B Notice date. */ firstBNoticeDate?: PartyFirstBNoticeDate | null | undefined; /** * IRS form type. */ irsFormType?: PartyIrsFormTypeOpen | 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?: PartyReportingEligibilityOpen | undefined; /** * Tax Certification date. */ taxCertificationDate?: PartyTaxCertificationDate | null | undefined; /** * Taxpayer certification status. */ taxpayerCertificationState?: PartyTaxpayerCertificationStateOpen | undefined; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ usTinStatus?: PartyUsTinStatusOpen | undefined; /** * B/C Notice status. */ withholdingState?: PartyWithholdingStateOpen | undefined; }; /** * Legal entity. */ export type PartyLegalEntity = { /** * 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?: | PartyBusinessIndustrialClassificationOpen | 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?: PartyCorporateStructureOpen | 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?: PartyEntityDueDiligence | null | undefined; /** * The legal entity name. */ entityName?: string | undefined; /** * The entity type. */ entityType?: PartyEntityTypeOpen | 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?: PartyExemptCustomerReasonOpen | 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?: PartyFormationDate | 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?: PartyLargeTrader | 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?: PartyLegalAddress | 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?: PartyTaxIdTypeOpen | undefined; /** * The tax profile for the legal entity. */ taxProfile?: PartyTaxProfile | null | undefined; }; /** * The legal day, month, and year of birth for a natural person. */ export type PartyBirthDate = { /** * 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 day, month, and year of death of a legal natural person */ export type PartyDeathDate = { /** * 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 data structure containing attributes describing the location of an investor's employer. If input, the required fields within the `employer_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ export type PartyEmployerAddress = { /** * 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; }; /** * Classifies in what capacity (or if) the underlying natural person holds a job */ export enum PartyEmploymentStatus { StatusUnspecified = "STATUS_UNSPECIFIED", Employed = "EMPLOYED", SelfEmployed = "SELF_EMPLOYED", Unemployed = "UNEMPLOYED", Retired = "RETIRED", Student = "STUDENT", } /** * Classifies in what capacity (or if) the underlying natural person holds a job */ export type PartyEmploymentStatusOpen = OpenEnum; /** * Object containing information pertaining to a investor's current employer including the name, address, and duration of employment. */ export type PartyEmployment = { /** * The business name of an investor's employer. */ employer?: string | undefined; /** * The data structure containing attributes describing the location of an investor's employer. If input, the required fields within the `employer_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ employerAddress?: PartyEmployerAddress | null | undefined; /** * System-generated GUID representing the employment record of a natural person */ employmentId?: string | undefined; /** * Classifies in what capacity (or if) the underlying natural person holds a job */ employmentStatus?: PartyEmploymentStatusOpen | undefined; /** * **Field Dependencies:** * * @remarks * * Required if `employment_status` is one of: * - `EMPLOYED` * - `SELF_EMPLOYED` */ occupation?: string | undefined; /** * **Field Dependencies:** * * @remarks * * Must be empty if `employment_status` is ___not___ one of: * - `EMPLOYED` * - `SELF_EMPLOYED` */ startYear?: number | undefined; }; /** * Identification expiration date */ export type PartyExpirationDate = { /** * 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; }; /** * Identification issue date */ export type PartyIssueDate = { /** * 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; }; /** * Identification type */ export enum PartyLegalNaturalPersonType { IdentificationTypeUnspecified = "IDENTIFICATION_TYPE_UNSPECIFIED", Passport = "PASSPORT", NationalId = "NATIONAL_ID", DriversLicense = "DRIVERS_LICENSE", } /** * Identification type */ export type PartyLegalNaturalPersonTypeOpen = OpenEnum< typeof PartyLegalNaturalPersonType >; /** * **Field Dependencies:** * * @remarks * * Required if `irs_form_type` is `W_8BEN`. * * Otherwise, must be empty. */ export type PartyForeignIdentification = { /** * Identification expiration date */ expirationDate?: PartyExpirationDate | null | undefined; /** * Denotes if the identification is a tax id or other */ ftin?: boolean | undefined; /** * Identification number */ identificationNumber?: string | undefined; /** * Identification issue date */ issueDate?: PartyIssueDate | null | undefined; /** * Region of issuance must be provided as a two-character CLDR country code */ issuingRegionCode?: string | undefined; /** * Identification type */ type?: PartyLegalNaturalPersonTypeOpen | undefined; }; /** * The datetime external identity verification results were run on a natural person */ export type PartyExecutionDate = { /** * 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; }; /** * Third-party data result used to verify the identity of an introduced investor. If the client identity_verification_model is PROVIDED_BY_CLIENT, this field is required */ export type PartyIdentityVerificationResult = { /** * Attestation that external result and review have verified the supplied investor's address has been verified in conjunction with other PII */ addressVerified?: boolean | undefined; /** * Attestation that external result and review have verified the supplied investor's date of birth has been verified in conjunction with other PII */ birthDateVerified?: boolean | undefined; /** * The datetime external identity verification results were run on a natural person */ executionDate?: PartyExecutionDate | null | undefined; /** * Client-generated identifier associated with the KYC results for the appropriate case */ externalCaseId?: string | undefined; /** * System generated document IDs returned after uploading identity documents to the Documents API */ identityVerificationDocumentIds?: Array | undefined; /** * System-generated GUID used to uniquely identify the verification_result */ identityVerificationResultId?: string | undefined; /** * Attestation that external result and review have verified the supplied investor's name has been verified in conjunction with other PII */ nameVerified?: boolean | undefined; /** * A system-generated document ID assigned when raw vendor results are uploaded to the Documents API; This field is optional for person record creation, but required for account creation if the Correspondent provides IDV results */ rawVendorDataDocumentId?: string | undefined; /** * Attestation that external result and review have verified the supplied investor's Tax ID has been verified in conjunction with other PII */ taxIdVerified?: boolean | undefined; /** * The name(s) of the vendor(s) used to externally verify and screen a natural person; relates to the identity_verification_result */ vendor?: string | 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 PartyLegalNaturalPersonEffectiveDate = { /** * 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; }; /** * Indicates if the person is recognized as a "Large Trader" by the SEC. */ export type PartyLegalNaturalPersonLargeTrader = { /** * 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?: PartyLegalNaturalPersonEffectiveDate | null | undefined; /** * SEC-issued ID signifying the person/entity as a large trader; Required for CAIS regulatory reporting. */ largeTraderId?: string | undefined; }; /** * The legal marital status of an account-holder; Used in combination with state of domicile to determine qualification for account types and beneficiary exclusion rules. */ export enum PartyMaritalStatus { MaritalStatusUnspecified = "MARITAL_STATUS_UNSPECIFIED", Single = "SINGLE", Married = "MARRIED", Divorced = "DIVORCED", Widowed = "WIDOWED", } /** * The legal marital status of an account-holder; Used in combination with state of domicile to determine qualification for account types and beneficiary exclusion rules. */ export type PartyMaritalStatusOpen = OpenEnum; /** * The suffix of a natural person; A suffix in a name is any part of the name that comes after the last name */ export enum PartyNameSuffix { NameSuffixUnspecified = "NAME_SUFFIX_UNSPECIFIED", Sr = "SR", Jr = "JR", Iii = "III", Iv = "IV", V = "V", } /** * The suffix of a natural person; A suffix in a name is any part of the name that comes after the last name */ export type PartyNameSuffixOpen = OpenEnum; /** * Customer Referral Source */ export type PartyCustomerReferralSource = { /** * The name of the referrer */ name?: string | undefined; /** * The relationship of the referrer to the applicant */ relationshipToApplicant?: string | undefined; /** * The years the referrer has known the applicant If the referrer has known the applicant for less than a year, they must specify 1 */ relationshipYearsWithApplicant?: number | undefined; /** * The years the referrer has known the broker If the referrer has known the broker for less than a year, they must specify 1 */ relationshipYearsWithBroker?: number | undefined; }; /** * Information about any negative news against the client, or any immediate family members, close associates, or related entities */ export type PartyLegalNaturalPersonNegativeNews = { /** * Indicates whether there is negative news against related parties */ negativeNewsAgainstRelatedParties?: boolean | undefined; /** * Description of the negative news against related parties */ negativeNewsAgainstRelatedPartiesDescription?: string | undefined; }; /** * The applicant's other source of wealth */ export type PartyOtherSourcesOfWealth = { /** * Indicates whether the applicant has other sources of wealth. */ applicantHasOtherSourcesOfWealth?: boolean | undefined; /** * The applicant's other source of wealth description. If the applicant has no other sources of wealth, they must specify "N/A." */ otherSourcesOfWealth?: string | undefined; /** * The applicant's other source of wealth verification. If the applicant has no other sources of wealth, they must specify "N/A." */ otherSourcesOfWealthVerification?: string | undefined; }; /** * Foreign Due Diligence (FDD) information for Legal Natural Person */ export type PartyNaturalPersonFdd = { /** * Customer Non-referral Source */ customerNonReferralSource?: string | undefined; /** * Customer Referral Source */ customerReferralSource?: PartyCustomerReferralSource | null | undefined; /** * The description of the applicant's source of wealth */ employmentAndEmployerDescription?: string | undefined; /** * Information about any negative news against the client, or any immediate family members, close associates, or related entities */ negativeNews?: PartyLegalNaturalPersonNegativeNews | null | undefined; /** * The applicant's other source of wealth */ otherSourcesOfWealth?: PartyOtherSourcesOfWealth | null | undefined; }; export enum PartyResidencyStatus { ResidencyStatusUnspecified = "RESIDENCY_STATUS_UNSPECIFIED", UsPermanentResident = "US_PERMANENT_RESIDENT", UsTemporaryResident = "US_TEMPORARY_RESIDENT", UsNonResident = "US_NON_RESIDENT", } export type PartyResidencyStatusOpen = OpenEnum; /** * Facilitates non-citizen lawful US residents to open domestic accounts */ export type PartyNonCitizenResidency = { residencyStatus?: PartyResidencyStatusOpen | undefined; }; /** * The legal street number and street name for an account Party. Required fields within the `personal_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ export type PartyPersonalAddress = { /** * 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 PartyLegalNaturalPersonTaxIdType { 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 PartyLegalNaturalPersonTaxIdTypeOpen = OpenEnum< typeof PartyLegalNaturalPersonTaxIdType >; /** * C Notice date. */ export type PartyLegalNaturalPersonCNoticeDate = { /** * 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 PartyLegalNaturalPersonFederalTaxClassification { 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 PartyLegalNaturalPersonFederalTaxClassificationOpen = OpenEnum< typeof PartyLegalNaturalPersonFederalTaxClassification >; /** * Initial B Notice date. */ export type PartyLegalNaturalPersonFirstBNoticeDate = { /** * 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 PartyLegalNaturalPersonIrsFormType { IrsFormTypeUnspecified = "IRS_FORM_TYPE_UNSPECIFIED", W9 = "W_9", W8Ben = "W_8BEN", } /** * IRS form type. */ export type PartyLegalNaturalPersonIrsFormTypeOpen = OpenEnum< typeof PartyLegalNaturalPersonIrsFormType >; /** * Tax reporting eligibility. */ export enum PartyLegalNaturalPersonReportingEligibility { TaxReportingEligibilityUnspecified = "TAX_REPORTING_ELIGIBILITY_UNSPECIFIED", Eligible = "ELIGIBLE", Ineligible = "INELIGIBLE", } /** * Tax reporting eligibility. */ export type PartyLegalNaturalPersonReportingEligibilityOpen = OpenEnum< typeof PartyLegalNaturalPersonReportingEligibility >; /** * Tax Certification date. */ export type PartyLegalNaturalPersonTaxCertificationDate = { /** * 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 PartyLegalNaturalPersonTaxpayerCertificationState { TaxpayerCertificationStateUnspecified = "TAXPAYER_CERTIFICATION_STATE_UNSPECIFIED", Certified = "CERTIFIED", Uncertified = "UNCERTIFIED", PendingCertification = "PENDING_CERTIFICATION", } /** * Taxpayer certification status. */ export type PartyLegalNaturalPersonTaxpayerCertificationStateOpen = OpenEnum< typeof PartyLegalNaturalPersonTaxpayerCertificationState >; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export enum PartyLegalNaturalPersonUsTinStatus { UsTinStatusUnspecified = "US_TIN_STATUS_UNSPECIFIED", Passing = "PASSING", Failing = "FAILING", } /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export type PartyLegalNaturalPersonUsTinStatusOpen = OpenEnum< typeof PartyLegalNaturalPersonUsTinStatus >; /** * B/C Notice status. */ export enum PartyLegalNaturalPersonWithholdingState { 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 PartyLegalNaturalPersonWithholdingStateOpen = OpenEnum< typeof PartyLegalNaturalPersonWithholdingState >; /** * Tax-related attributes at the for the account; A tax profile with taxpayer attributes is located on the legal_natural_person or legal_entity objects elsewhere on the account record. */ export type PartyLegalNaturalPersonTaxProfile = { /** * C Notice date. */ cNoticeDate?: PartyLegalNaturalPersonCNoticeDate | null | undefined; /** * Federal tax classification. */ federalTaxClassification?: | PartyLegalNaturalPersonFederalTaxClassificationOpen | undefined; /** * Initial B Notice date. */ firstBNoticeDate?: PartyLegalNaturalPersonFirstBNoticeDate | null | undefined; /** * IRS form type. */ irsFormType?: PartyLegalNaturalPersonIrsFormTypeOpen | 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?: | PartyLegalNaturalPersonReportingEligibilityOpen | undefined; /** * Tax Certification date. */ taxCertificationDate?: | PartyLegalNaturalPersonTaxCertificationDate | null | undefined; /** * Taxpayer certification status. */ taxpayerCertificationState?: | PartyLegalNaturalPersonTaxpayerCertificationStateOpen | undefined; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ usTinStatus?: PartyLegalNaturalPersonUsTinStatusOpen | undefined; /** * B/C Notice status. */ withholdingState?: PartyLegalNaturalPersonWithholdingStateOpen | undefined; }; /** * Legal natural person. */ export type PartyLegalNaturalPerson = { /** * Indicates whether the person is an accredited investor. By default, this is set to `false`. */ accreditedInvestor?: boolean | undefined; /** * Indicates whether the person is an adviser. By default, this is set to `false`. */ adviser?: boolean | undefined; /** * The legal day, month, and year of birth for a natural person. */ birthDate?: PartyBirthDate | null | undefined; /** * This is used for tax (treaty) and country block list considerations Maximum list of two 2-char CLDR Code citizenship countries, e.g. US, CA */ citizenshipCountries?: Array | undefined; /** * An external identifier for the legal natural person. This identifier does not have internal uniqueness constraints. */ clientPersonId?: string | undefined; /** * A list of ticker symbols in which the underlying person is a control person; control persons are defined as having significant influence over a company’s management and operations, typically through ownership of a large percentage of the company’s voting stock or through positions on the company’s board of directors or executive team */ controlPersonCompanySymbols?: string | undefined; /** * Indicates the related owner record is an employee of the clearing broker's correspondent customer. By default, this is set to `false`. */ correspondentEmployee?: boolean | undefined; /** * A unique identifier referencing a Correspondent; A Client may have several operating Correspondents within its purview. */ correspondentId?: string | undefined; /** * A flag to indicate whether this person is an employee of the correspondent. By default, this is set to `false`. */ custodianEmployee?: boolean | undefined; /** * Customer identification id returned by the customer identification service which represents a single instance of an identity verification outcome for the specified customer. This verification result will be used as part of the full investigation. */ customerIdentificationId?: string | undefined; /** * The day, month, and year of death of a legal natural person */ deathDate?: PartyDeathDate | null | undefined; /** * DBA (Doing Business As) names. Can list up to 5 associated with the Legal Natural Person */ doingBusinessAs?: Array | undefined; /** * Object containing information pertaining to a investor's current employer including the name, address, and duration of employment. */ employment?: PartyEmployment | null | undefined; /** * Family name of a natural person. */ familyName?: string | undefined; /** * The name of the FINRA-associated entity the underlying natural person is affiliated with. */ finraAssociatedEntity?: string | undefined; /** * **Field Dependencies:** * * @remarks * * Required if `irs_form_type` is `W_8BEN`. * * Otherwise, must be empty. */ foreignIdentification?: PartyForeignIdentification | null | undefined; /** * The given name of a natural person; Conventionally known as 'first name' in most English-speaking countries. */ givenName?: string | undefined; /** * Globally Unique identifier for a legal natural person */ globalPersonId?: string | undefined; /** * Third-party data result used to verify the identity of an introduced investor. If the client identity_verification_model is PROVIDED_BY_CLIENT, this field is required */ identityVerificationResult?: | PartyIdentityVerificationResult | null | undefined; /** * Indicates whether the person is an institutional customer. By default, this is set to `false`. */ institutionalCustomer?: boolean | undefined; /** * Investigation id relating a comprehensive investigation for a customer, encompassing the aggregation of identity verification results and watchlist screenings, conducted to support the Customer Identification Program (CIP) and Customer Due Diligence (CDD) */ investigationId?: string | undefined; /** * Indicates if the person is recognized as a "Large Trader" by the SEC. */ largeTrader?: PartyLegalNaturalPersonLargeTrader | null | undefined; /** * A system-generated unique identifier referencing a single natural person; Used to access the record after creation. */ legalNaturalPersonId?: string | undefined; /** * The legal marital status of an account-holder; Used in combination with state of domicile to determine qualification for account types and beneficiary exclusion rules. */ maritalStatus?: PartyMaritalStatusOpen | undefined; /** * Non-primary names representing a natural person; Name attributed to a person other than "Given" and "Family" names. */ middleNames?: string | undefined; /** * The name field Format: legalNaturalPersons/{legalNaturalPerson} */ name?: string | undefined; /** * The suffix of a natural person; A suffix in a name is any part of the name that comes after the last name */ nameSuffix?: PartyNameSuffixOpen | undefined; /** * Foreign Due Diligence (FDD) information for Legal Natural Person */ naturalPersonFdd?: PartyNaturalPersonFdd | null | undefined; /** * Facilitates non-citizen lawful US residents to open domestic accounts */ nonCitizenResidency?: PartyNonCitizenResidency | null | undefined; /** * The legal street number and street name for an account Party. Required fields within the `personal_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ personalAddress?: PartyPersonalAddress | null | undefined; /** * A Party's self-disclosed list of names representing family members who are politically exposed. */ politicallyExposedImmediateFamilyNames?: Array | undefined; /** * A Party's self-disclosed list of named politically exposed organizations they are personally associated with. */ politicallyExposedOrganization?: string | undefined; /** * The full U.S. tax ID for a related person; Must be provided with `ITIN` or `SSN` 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?: PartyLegalNaturalPersonTaxIdTypeOpen | undefined; /** * Tax-related attributes at the for the account; A tax profile with taxpayer attributes is located on the legal_natural_person or legal_entity objects elsewhere on the account record. */ taxProfile?: PartyLegalNaturalPersonTaxProfile | null | undefined; }; /** * The object containing data for the purpose of delivery physical mailings to a party; Typically used for statements, account updates, tax documents, and other postal mailings; May also be used as an alternative identity verification address to personalAddress. Required fields within the `mailing_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ export type PartyMailingAddress = { /** * 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; }; /** * A short code. * * @remarks * * Reference(s): * - https://en.wikipedia.org/wiki/Short_code */ export type PartyShortCode = { /** * Required. The short code digits, without a leading plus ('+') or country calling code, e.g. "611". */ number?: string | undefined; /** * Required. The BCP-47 region code of the location where calls to this short code can be made, such as "US" and "BB". * * @remarks * * Reference(s): * - http://www.unicode.org/reports/tr35/#unicode_region_subtag */ regionCode?: string | undefined; }; /** * The phone number for a party. Lives on the party record in the context of the account and does not commute to other accounts held by/for the person. */ export type PartyPhoneNumber = { /** * The phone number, represented as a leading plus sign ('+'), followed by a phone number that uses a relaxed ITU E.164 format consisting of the country calling code (1 to 3 digits) and the subscriber number, with no additional spaces or formatting, e.g.: - correct: "+15552220123" - incorrect: "+1 (555) 222-01234 x123". * * @remarks * * The ITU E.164 format limits the latter to 12 digits, but in practice not all countries respect that, so we relax that restriction here. National-only numbers are not allowed. * * References: - https://www.itu.int/rec/T-REC-E.164-201011-I - https://en.wikipedia.org/wiki/E.164. - https://en.wikipedia.org/wiki/List_of_country_calling_codes */ e164Number?: string | undefined; /** * The phone number's extension. The extension is not standardized in ITU recommendations, except for being defined as a series of numbers with a maximum length of 40 digits. Other than digits, some other dialing characters such as ',' (indicating a wait) or '#' may be stored here. * * @remarks * * Note that no regions currently use extensions with short codes, so this field is normally only set in conjunction with an E.164 number. It is held separately from the E.164 number to allow for short code extensions in the future. */ extension?: string | undefined; /** * A short code. * * @remarks * * Reference(s): * - https://en.wikipedia.org/wiki/Short_code */ shortCode?: PartyShortCode | null | undefined; }; /** * Delivery method instruction for prospectuses for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export enum PartyProspectusDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for prospectuses for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export type PartyProspectusDeliveryPreferenceOpen = OpenEnum< typeof PartyProspectusDeliveryPreference >; /** * Delivery method instruction for proxy voting for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export enum PartyProxyDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for proxy voting for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export type PartyProxyDeliveryPreferenceOpen = OpenEnum< typeof PartyProxyDeliveryPreference >; /** * Conveys how a person is related to account; Located on each account Party record; Examples are `PRIMARY_OWNER`, `JOINT_OWNER`, `EXECUTOR`, etc. */ export enum PartyRelationType { PartyRelationTypeUnspecified = "PARTY_RELATION_TYPE_UNSPECIFIED", PrimaryOwner = "PRIMARY_OWNER", JointOwner = "JOINT_OWNER", Custodian = "CUSTODIAN", Executor = "EXECUTOR", AuthorizedSigner = "AUTHORIZED_SIGNER", BeneficialOwner = "BENEFICIAL_OWNER", ControlPerson = "CONTROL_PERSON", AuthorizedRepresentative = "AUTHORIZED_REPRESENTATIVE", Trustee = "TRUSTEE", AuthTrusteeRep = "AUTH_TRUSTEE_REP", } /** * Conveys how a person is related to account; Located on each account Party record; Examples are `PRIMARY_OWNER`, `JOINT_OWNER`, `EXECUTOR`, etc. */ export type PartyRelationTypeOpen = OpenEnum; /** * Delivery method instruction for account statements for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export enum PartyStatementDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for account statements for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export type PartyStatementDeliveryPreferenceOpen = OpenEnum< typeof PartyStatementDeliveryPreference >; /** * Delivery method instruction for tax documents for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated; Per regulation, selected tax forms will be mailed by regulation regardless of this setting */ export enum PartyTaxDocumentDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for tax documents for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated; Per regulation, selected tax forms will be mailed by regulation regardless of this setting */ export type PartyTaxDocumentDeliveryPreferenceOpen = OpenEnum< typeof PartyTaxDocumentDeliveryPreference >; /** * Delivery method instruction for trade confirmations for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export enum PartyTradeConfirmationDeliveryPreference { DeliveryPreferenceUnspecified = "DELIVERY_PREFERENCE_UNSPECIFIED", Digital = "DIGITAL", Physical = "PHYSICAL", Suppress = "SUPPRESS", } /** * Delivery method instruction for trade confirmations for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ export type PartyTradeConfirmationDeliveryPreferenceOpen = OpenEnum< typeof PartyTradeConfirmationDeliveryPreference >; /** * A single record representing an owner or manager of an Account. Contains fully populated Party Identity object. */ export type Party = { /** * Delivery method instruction for CFTC documents for a given Party record; Defaults to `DIGITAL` on futures account creation Only applies to CFTC regulated accounts */ cftcDocumentDeliveryPreference?: | PartyCftcDocumentDeliveryPreferenceOpen | undefined; /** * An email address indicated for account communications. */ emailAddress?: string | undefined; /** * Legal entity. */ legalEntity?: PartyLegalEntity | null | undefined; /** * Legal natural person. */ legalNaturalPerson?: PartyLegalNaturalPerson | null | undefined; /** * The object containing data for the purpose of delivery physical mailings to a party; Typically used for statements, account updates, tax documents, and other postal mailings; May also be used as an alternative identity verification address to personalAddress. Required fields within the `mailing_address` object include: * * @remarks * - `administrative_area` * - `region_code` - 2 character CLDR Code * - `postal_code` * - `locality` * - `address_lines` - max 5 lines */ mailingAddress?: PartyMailingAddress | null | undefined; /** * The name field Format: {parent=account/*}/{name=party/*} */ name?: string | undefined; /** * A system-generated unique identifier referencing a single owner or control person on an account; A Party contains account-specific information about a person whereas inside the Party is a reference to a reusable instance of a Person `legal_natural_person` or `legal_entity` which contains non-changing information about these persons; Used to access the record after creation */ partyId?: string | undefined; /** * The phone number for a party. Lives on the party record in the context of the account and does not commute to other accounts held by/for the person. */ phoneNumber?: PartyPhoneNumber | null | undefined; /** * Delivery method instruction for prospectuses for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ prospectusDeliveryPreference?: | PartyProspectusDeliveryPreferenceOpen | undefined; /** * Delivery method instruction for proxy voting for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ proxyDeliveryPreference?: PartyProxyDeliveryPreferenceOpen | undefined; /** * Conveys how a person is related to account; Located on each account Party record; Examples are `PRIMARY_OWNER`, `JOINT_OWNER`, `EXECUTOR`, etc. */ relationType?: PartyRelationTypeOpen | undefined; /** * Delivery method instruction for account statements for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ statementDeliveryPreference?: | PartyStatementDeliveryPreferenceOpen | undefined; /** * Delivery method instruction for tax documents for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated; Per regulation, selected tax forms will be mailed by regulation regardless of this setting */ taxDocumentDeliveryPreference?: | PartyTaxDocumentDeliveryPreferenceOpen | undefined; /** * Delivery method instruction for trade confirmations for a given Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `DIGITAL` on account creation but may be updated */ tradeConfirmationDeliveryPreference?: | PartyTradeConfirmationDeliveryPreferenceOpen | undefined; }; /** @internal */ export const PartyCftcDocumentDeliveryPreference$inboundSchema: z.ZodType< PartyCftcDocumentDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyCftcDocumentDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyCftcDocumentDeliveryPreference$outboundSchema: z.ZodType< PartyCftcDocumentDeliveryPreferenceOpen, z.ZodTypeDef, PartyCftcDocumentDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyCftcDocumentDeliveryPreference), 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 PartyCftcDocumentDeliveryPreference$ { /** @deprecated use `PartyCftcDocumentDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyCftcDocumentDeliveryPreference$inboundSchema; /** @deprecated use `PartyCftcDocumentDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyCftcDocumentDeliveryPreference$outboundSchema; } /** @internal */ export const PartyBusinessIndustrialClassification$inboundSchema: z.ZodType< PartyBusinessIndustrialClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyBusinessIndustrialClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyBusinessIndustrialClassification$outboundSchema: z.ZodType< PartyBusinessIndustrialClassificationOpen, z.ZodTypeDef, PartyBusinessIndustrialClassificationOpen > = z.union([ z.nativeEnum(PartyBusinessIndustrialClassification), 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 PartyBusinessIndustrialClassification$ { /** @deprecated use `PartyBusinessIndustrialClassification$inboundSchema` instead. */ export const inboundSchema = PartyBusinessIndustrialClassification$inboundSchema; /** @deprecated use `PartyBusinessIndustrialClassification$outboundSchema` instead. */ export const outboundSchema = PartyBusinessIndustrialClassification$outboundSchema; } /** @internal */ export const PartyCorporateStructure$inboundSchema: z.ZodType< PartyCorporateStructureOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyCorporateStructure), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyCorporateStructure$outboundSchema: z.ZodType< PartyCorporateStructureOpen, z.ZodTypeDef, PartyCorporateStructureOpen > = z.union([ z.nativeEnum(PartyCorporateStructure), 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 PartyCorporateStructure$ { /** @deprecated use `PartyCorporateStructure$inboundSchema` instead. */ export const inboundSchema = PartyCorporateStructure$inboundSchema; /** @deprecated use `PartyCorporateStructure$outboundSchema` instead. */ export const outboundSchema = PartyCorporateStructure$outboundSchema; } /** @internal */ export const PartyNegativeNews$inboundSchema: z.ZodType< PartyNegativeNews, 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 PartyNegativeNews$Outbound = { negative_news_against_related_parties?: boolean | undefined; negative_news_against_related_parties_description?: string | undefined; }; /** @internal */ export const PartyNegativeNews$outboundSchema: z.ZodType< PartyNegativeNews$Outbound, z.ZodTypeDef, PartyNegativeNews > = 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 PartyNegativeNews$ { /** @deprecated use `PartyNegativeNews$inboundSchema` instead. */ export const inboundSchema = PartyNegativeNews$inboundSchema; /** @deprecated use `PartyNegativeNews$outboundSchema` instead. */ export const outboundSchema = PartyNegativeNews$outboundSchema; /** @deprecated use `PartyNegativeNews$Outbound` instead. */ export type Outbound = PartyNegativeNews$Outbound; } export function partyNegativeNewsToJSON( partyNegativeNews: PartyNegativeNews, ): string { return JSON.stringify( PartyNegativeNews$outboundSchema.parse(partyNegativeNews), ); } export function partyNegativeNewsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyNegativeNews$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyNegativeNews' from JSON`, ); } /** @internal */ export const PartyEntityDueDiligence$inboundSchema: z.ZodType< PartyEntityDueDiligence, z.ZodTypeDef, unknown > = z.object({ entity_issues_bearer_shares: z.boolean().optional(), negative_news: z.nullable(z.lazy(() => PartyNegativeNews$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "entity_issues_bearer_shares": "entityIssuesBearerShares", "negative_news": "negativeNews", }); }); /** @internal */ export type PartyEntityDueDiligence$Outbound = { entity_issues_bearer_shares?: boolean | undefined; negative_news?: PartyNegativeNews$Outbound | null | undefined; }; /** @internal */ export const PartyEntityDueDiligence$outboundSchema: z.ZodType< PartyEntityDueDiligence$Outbound, z.ZodTypeDef, PartyEntityDueDiligence > = z.object({ entityIssuesBearerShares: z.boolean().optional(), negativeNews: z.nullable(z.lazy(() => PartyNegativeNews$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 PartyEntityDueDiligence$ { /** @deprecated use `PartyEntityDueDiligence$inboundSchema` instead. */ export const inboundSchema = PartyEntityDueDiligence$inboundSchema; /** @deprecated use `PartyEntityDueDiligence$outboundSchema` instead. */ export const outboundSchema = PartyEntityDueDiligence$outboundSchema; /** @deprecated use `PartyEntityDueDiligence$Outbound` instead. */ export type Outbound = PartyEntityDueDiligence$Outbound; } export function partyEntityDueDiligenceToJSON( partyEntityDueDiligence: PartyEntityDueDiligence, ): string { return JSON.stringify( PartyEntityDueDiligence$outboundSchema.parse(partyEntityDueDiligence), ); } export function partyEntityDueDiligenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyEntityDueDiligence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyEntityDueDiligence' from JSON`, ); } /** @internal */ export const PartyEntityType$inboundSchema: z.ZodType< PartyEntityTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyEntityType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyEntityType$outboundSchema: z.ZodType< PartyEntityTypeOpen, z.ZodTypeDef, PartyEntityTypeOpen > = z.union([ z.nativeEnum(PartyEntityType), 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 PartyEntityType$ { /** @deprecated use `PartyEntityType$inboundSchema` instead. */ export const inboundSchema = PartyEntityType$inboundSchema; /** @deprecated use `PartyEntityType$outboundSchema` instead. */ export const outboundSchema = PartyEntityType$outboundSchema; } /** @internal */ export const PartyExemptCustomerReason$inboundSchema: z.ZodType< PartyExemptCustomerReasonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyExemptCustomerReason), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyExemptCustomerReason$outboundSchema: z.ZodType< PartyExemptCustomerReasonOpen, z.ZodTypeDef, PartyExemptCustomerReasonOpen > = z.union([ z.nativeEnum(PartyExemptCustomerReason), 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 PartyExemptCustomerReason$ { /** @deprecated use `PartyExemptCustomerReason$inboundSchema` instead. */ export const inboundSchema = PartyExemptCustomerReason$inboundSchema; /** @deprecated use `PartyExemptCustomerReason$outboundSchema` instead. */ export const outboundSchema = PartyExemptCustomerReason$outboundSchema; } /** @internal */ export const PartyFormationDate$inboundSchema: z.ZodType< PartyFormationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyFormationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyFormationDate$outboundSchema: z.ZodType< PartyFormationDate$Outbound, z.ZodTypeDef, PartyFormationDate > = 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 PartyFormationDate$ { /** @deprecated use `PartyFormationDate$inboundSchema` instead. */ export const inboundSchema = PartyFormationDate$inboundSchema; /** @deprecated use `PartyFormationDate$outboundSchema` instead. */ export const outboundSchema = PartyFormationDate$outboundSchema; /** @deprecated use `PartyFormationDate$Outbound` instead. */ export type Outbound = PartyFormationDate$Outbound; } export function partyFormationDateToJSON( partyFormationDate: PartyFormationDate, ): string { return JSON.stringify( PartyFormationDate$outboundSchema.parse(partyFormationDate), ); } export function partyFormationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyFormationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyFormationDate' from JSON`, ); } /** @internal */ export const PartyEffectiveDate$inboundSchema: z.ZodType< PartyEffectiveDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyEffectiveDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyEffectiveDate$outboundSchema: z.ZodType< PartyEffectiveDate$Outbound, z.ZodTypeDef, PartyEffectiveDate > = 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 PartyEffectiveDate$ { /** @deprecated use `PartyEffectiveDate$inboundSchema` instead. */ export const inboundSchema = PartyEffectiveDate$inboundSchema; /** @deprecated use `PartyEffectiveDate$outboundSchema` instead. */ export const outboundSchema = PartyEffectiveDate$outboundSchema; /** @deprecated use `PartyEffectiveDate$Outbound` instead. */ export type Outbound = PartyEffectiveDate$Outbound; } export function partyEffectiveDateToJSON( partyEffectiveDate: PartyEffectiveDate, ): string { return JSON.stringify( PartyEffectiveDate$outboundSchema.parse(partyEffectiveDate), ); } export function partyEffectiveDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyEffectiveDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyEffectiveDate' from JSON`, ); } /** @internal */ export const PartyLargeTrader$inboundSchema: z.ZodType< PartyLargeTrader, z.ZodTypeDef, unknown > = z.object({ effective_date: z.nullable(z.lazy(() => PartyEffectiveDate$inboundSchema)) .optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type PartyLargeTrader$Outbound = { effective_date?: PartyEffectiveDate$Outbound | null | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const PartyLargeTrader$outboundSchema: z.ZodType< PartyLargeTrader$Outbound, z.ZodTypeDef, PartyLargeTrader > = z.object({ effectiveDate: z.nullable(z.lazy(() => PartyEffectiveDate$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 PartyLargeTrader$ { /** @deprecated use `PartyLargeTrader$inboundSchema` instead. */ export const inboundSchema = PartyLargeTrader$inboundSchema; /** @deprecated use `PartyLargeTrader$outboundSchema` instead. */ export const outboundSchema = PartyLargeTrader$outboundSchema; /** @deprecated use `PartyLargeTrader$Outbound` instead. */ export type Outbound = PartyLargeTrader$Outbound; } export function partyLargeTraderToJSON( partyLargeTrader: PartyLargeTrader, ): string { return JSON.stringify( PartyLargeTrader$outboundSchema.parse(partyLargeTrader), ); } export function partyLargeTraderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLargeTrader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLargeTrader' from JSON`, ); } /** @internal */ export const PartyLegalAddress$inboundSchema: z.ZodType< PartyLegalAddress, 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 PartyLegalAddress$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 PartyLegalAddress$outboundSchema: z.ZodType< PartyLegalAddress$Outbound, z.ZodTypeDef, PartyLegalAddress > = 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 PartyLegalAddress$ { /** @deprecated use `PartyLegalAddress$inboundSchema` instead. */ export const inboundSchema = PartyLegalAddress$inboundSchema; /** @deprecated use `PartyLegalAddress$outboundSchema` instead. */ export const outboundSchema = PartyLegalAddress$outboundSchema; /** @deprecated use `PartyLegalAddress$Outbound` instead. */ export type Outbound = PartyLegalAddress$Outbound; } export function partyLegalAddressToJSON( partyLegalAddress: PartyLegalAddress, ): string { return JSON.stringify( PartyLegalAddress$outboundSchema.parse(partyLegalAddress), ); } export function partyLegalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalAddress' from JSON`, ); } /** @internal */ export const PartyTaxIdType$inboundSchema: z.ZodType< PartyTaxIdTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyTaxIdType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyTaxIdType$outboundSchema: z.ZodType< PartyTaxIdTypeOpen, z.ZodTypeDef, PartyTaxIdTypeOpen > = z.union([ z.nativeEnum(PartyTaxIdType), 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 PartyTaxIdType$ { /** @deprecated use `PartyTaxIdType$inboundSchema` instead. */ export const inboundSchema = PartyTaxIdType$inboundSchema; /** @deprecated use `PartyTaxIdType$outboundSchema` instead. */ export const outboundSchema = PartyTaxIdType$outboundSchema; } /** @internal */ export const PartyCNoticeDate$inboundSchema: z.ZodType< PartyCNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyCNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyCNoticeDate$outboundSchema: z.ZodType< PartyCNoticeDate$Outbound, z.ZodTypeDef, PartyCNoticeDate > = 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 PartyCNoticeDate$ { /** @deprecated use `PartyCNoticeDate$inboundSchema` instead. */ export const inboundSchema = PartyCNoticeDate$inboundSchema; /** @deprecated use `PartyCNoticeDate$outboundSchema` instead. */ export const outboundSchema = PartyCNoticeDate$outboundSchema; /** @deprecated use `PartyCNoticeDate$Outbound` instead. */ export type Outbound = PartyCNoticeDate$Outbound; } export function partyCNoticeDateToJSON( partyCNoticeDate: PartyCNoticeDate, ): string { return JSON.stringify( PartyCNoticeDate$outboundSchema.parse(partyCNoticeDate), ); } export function partyCNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyCNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyCNoticeDate' from JSON`, ); } /** @internal */ export const PartyFederalTaxClassification$inboundSchema: z.ZodType< PartyFederalTaxClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyFederalTaxClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyFederalTaxClassification$outboundSchema: z.ZodType< PartyFederalTaxClassificationOpen, z.ZodTypeDef, PartyFederalTaxClassificationOpen > = z.union([ z.nativeEnum(PartyFederalTaxClassification), 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 PartyFederalTaxClassification$ { /** @deprecated use `PartyFederalTaxClassification$inboundSchema` instead. */ export const inboundSchema = PartyFederalTaxClassification$inboundSchema; /** @deprecated use `PartyFederalTaxClassification$outboundSchema` instead. */ export const outboundSchema = PartyFederalTaxClassification$outboundSchema; } /** @internal */ export const PartyFirstBNoticeDate$inboundSchema: z.ZodType< PartyFirstBNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyFirstBNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyFirstBNoticeDate$outboundSchema: z.ZodType< PartyFirstBNoticeDate$Outbound, z.ZodTypeDef, PartyFirstBNoticeDate > = 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 PartyFirstBNoticeDate$ { /** @deprecated use `PartyFirstBNoticeDate$inboundSchema` instead. */ export const inboundSchema = PartyFirstBNoticeDate$inboundSchema; /** @deprecated use `PartyFirstBNoticeDate$outboundSchema` instead. */ export const outboundSchema = PartyFirstBNoticeDate$outboundSchema; /** @deprecated use `PartyFirstBNoticeDate$Outbound` instead. */ export type Outbound = PartyFirstBNoticeDate$Outbound; } export function partyFirstBNoticeDateToJSON( partyFirstBNoticeDate: PartyFirstBNoticeDate, ): string { return JSON.stringify( PartyFirstBNoticeDate$outboundSchema.parse(partyFirstBNoticeDate), ); } export function partyFirstBNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyFirstBNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyFirstBNoticeDate' from JSON`, ); } /** @internal */ export const PartyIrsFormType$inboundSchema: z.ZodType< PartyIrsFormTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyIrsFormType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyIrsFormType$outboundSchema: z.ZodType< PartyIrsFormTypeOpen, z.ZodTypeDef, PartyIrsFormTypeOpen > = z.union([ z.nativeEnum(PartyIrsFormType), 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 PartyIrsFormType$ { /** @deprecated use `PartyIrsFormType$inboundSchema` instead. */ export const inboundSchema = PartyIrsFormType$inboundSchema; /** @deprecated use `PartyIrsFormType$outboundSchema` instead. */ export const outboundSchema = PartyIrsFormType$outboundSchema; } /** @internal */ export const PartyReportingEligibility$inboundSchema: z.ZodType< PartyReportingEligibilityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyReportingEligibility), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyReportingEligibility$outboundSchema: z.ZodType< PartyReportingEligibilityOpen, z.ZodTypeDef, PartyReportingEligibilityOpen > = z.union([ z.nativeEnum(PartyReportingEligibility), 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 PartyReportingEligibility$ { /** @deprecated use `PartyReportingEligibility$inboundSchema` instead. */ export const inboundSchema = PartyReportingEligibility$inboundSchema; /** @deprecated use `PartyReportingEligibility$outboundSchema` instead. */ export const outboundSchema = PartyReportingEligibility$outboundSchema; } /** @internal */ export const PartyTaxCertificationDate$inboundSchema: z.ZodType< PartyTaxCertificationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyTaxCertificationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyTaxCertificationDate$outboundSchema: z.ZodType< PartyTaxCertificationDate$Outbound, z.ZodTypeDef, PartyTaxCertificationDate > = 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 PartyTaxCertificationDate$ { /** @deprecated use `PartyTaxCertificationDate$inboundSchema` instead. */ export const inboundSchema = PartyTaxCertificationDate$inboundSchema; /** @deprecated use `PartyTaxCertificationDate$outboundSchema` instead. */ export const outboundSchema = PartyTaxCertificationDate$outboundSchema; /** @deprecated use `PartyTaxCertificationDate$Outbound` instead. */ export type Outbound = PartyTaxCertificationDate$Outbound; } export function partyTaxCertificationDateToJSON( partyTaxCertificationDate: PartyTaxCertificationDate, ): string { return JSON.stringify( PartyTaxCertificationDate$outboundSchema.parse(partyTaxCertificationDate), ); } export function partyTaxCertificationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyTaxCertificationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyTaxCertificationDate' from JSON`, ); } /** @internal */ export const PartyTaxpayerCertificationState$inboundSchema: z.ZodType< PartyTaxpayerCertificationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyTaxpayerCertificationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyTaxpayerCertificationState$outboundSchema: z.ZodType< PartyTaxpayerCertificationStateOpen, z.ZodTypeDef, PartyTaxpayerCertificationStateOpen > = z.union([ z.nativeEnum(PartyTaxpayerCertificationState), 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 PartyTaxpayerCertificationState$ { /** @deprecated use `PartyTaxpayerCertificationState$inboundSchema` instead. */ export const inboundSchema = PartyTaxpayerCertificationState$inboundSchema; /** @deprecated use `PartyTaxpayerCertificationState$outboundSchema` instead. */ export const outboundSchema = PartyTaxpayerCertificationState$outboundSchema; } /** @internal */ export const PartyUsTinStatus$inboundSchema: z.ZodType< PartyUsTinStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyUsTinStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyUsTinStatus$outboundSchema: z.ZodType< PartyUsTinStatusOpen, z.ZodTypeDef, PartyUsTinStatusOpen > = z.union([ z.nativeEnum(PartyUsTinStatus), 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 PartyUsTinStatus$ { /** @deprecated use `PartyUsTinStatus$inboundSchema` instead. */ export const inboundSchema = PartyUsTinStatus$inboundSchema; /** @deprecated use `PartyUsTinStatus$outboundSchema` instead. */ export const outboundSchema = PartyUsTinStatus$outboundSchema; } /** @internal */ export const PartyWithholdingState$inboundSchema: z.ZodType< PartyWithholdingStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyWithholdingState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyWithholdingState$outboundSchema: z.ZodType< PartyWithholdingStateOpen, z.ZodTypeDef, PartyWithholdingStateOpen > = z.union([ z.nativeEnum(PartyWithholdingState), 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 PartyWithholdingState$ { /** @deprecated use `PartyWithholdingState$inboundSchema` instead. */ export const inboundSchema = PartyWithholdingState$inboundSchema; /** @deprecated use `PartyWithholdingState$outboundSchema` instead. */ export const outboundSchema = PartyWithholdingState$outboundSchema; } /** @internal */ export const PartyTaxProfile$inboundSchema: z.ZodType< PartyTaxProfile, z.ZodTypeDef, unknown > = z.object({ c_notice_date: z.nullable(z.lazy(() => PartyCNoticeDate$inboundSchema)) .optional(), federal_tax_classification: PartyFederalTaxClassification$inboundSchema .optional(), first_b_notice_date: z.nullable( z.lazy(() => PartyFirstBNoticeDate$inboundSchema), ).optional(), irs_form_type: PartyIrsFormType$inboundSchema.optional(), legal_tax_region_code: z.string().optional(), reporting_eligibility: PartyReportingEligibility$inboundSchema.optional(), tax_certification_date: z.nullable( z.lazy(() => PartyTaxCertificationDate$inboundSchema), ).optional(), taxpayer_certification_state: PartyTaxpayerCertificationState$inboundSchema .optional(), us_tin_status: PartyUsTinStatus$inboundSchema.optional(), withholding_state: PartyWithholdingState$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 PartyTaxProfile$Outbound = { c_notice_date?: PartyCNoticeDate$Outbound | null | undefined; federal_tax_classification?: string | undefined; first_b_notice_date?: PartyFirstBNoticeDate$Outbound | null | undefined; irs_form_type?: string | undefined; legal_tax_region_code?: string | undefined; reporting_eligibility?: string | undefined; tax_certification_date?: | PartyTaxCertificationDate$Outbound | null | undefined; taxpayer_certification_state?: string | undefined; us_tin_status?: string | undefined; withholding_state?: string | undefined; }; /** @internal */ export const PartyTaxProfile$outboundSchema: z.ZodType< PartyTaxProfile$Outbound, z.ZodTypeDef, PartyTaxProfile > = z.object({ cNoticeDate: z.nullable(z.lazy(() => PartyCNoticeDate$outboundSchema)) .optional(), federalTaxClassification: PartyFederalTaxClassification$outboundSchema .optional(), firstBNoticeDate: z.nullable( z.lazy(() => PartyFirstBNoticeDate$outboundSchema), ).optional(), irsFormType: PartyIrsFormType$outboundSchema.optional(), legalTaxRegionCode: z.string().optional(), reportingEligibility: PartyReportingEligibility$outboundSchema.optional(), taxCertificationDate: z.nullable( z.lazy(() => PartyTaxCertificationDate$outboundSchema), ).optional(), taxpayerCertificationState: PartyTaxpayerCertificationState$outboundSchema .optional(), usTinStatus: PartyUsTinStatus$outboundSchema.optional(), withholdingState: PartyWithholdingState$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 PartyTaxProfile$ { /** @deprecated use `PartyTaxProfile$inboundSchema` instead. */ export const inboundSchema = PartyTaxProfile$inboundSchema; /** @deprecated use `PartyTaxProfile$outboundSchema` instead. */ export const outboundSchema = PartyTaxProfile$outboundSchema; /** @deprecated use `PartyTaxProfile$Outbound` instead. */ export type Outbound = PartyTaxProfile$Outbound; } export function partyTaxProfileToJSON( partyTaxProfile: PartyTaxProfile, ): string { return JSON.stringify(PartyTaxProfile$outboundSchema.parse(partyTaxProfile)); } export function partyTaxProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyTaxProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyTaxProfile' from JSON`, ); } /** @internal */ export const PartyLegalEntity$inboundSchema: z.ZodType< PartyLegalEntity, z.ZodTypeDef, unknown > = z.object({ accredited_investor: z.boolean().optional(), adviser: z.boolean().optional(), broker_dealer: z.boolean().optional(), business_industrial_classification: PartyBusinessIndustrialClassification$inboundSchema.optional(), client_entity_id: z.string().optional(), corporate_structure: PartyCorporateStructure$inboundSchema.optional(), correspondent_id: z.string().optional(), doing_business_as: z.array(z.string()).optional(), entity_due_diligence: z.nullable( z.lazy(() => PartyEntityDueDiligence$inboundSchema), ).optional(), entity_name: z.string().optional(), entity_type: PartyEntityType$inboundSchema.optional(), exempt_customer_reason: PartyExemptCustomerReason$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(() => PartyFormationDate$inboundSchema)) .optional(), global_person_id: z.string().optional(), institutional_customer: z.boolean().optional(), investigation_id: z.string().optional(), large_trader: z.nullable(z.lazy(() => PartyLargeTrader$inboundSchema)) .optional(), legal_address: z.nullable(z.lazy(() => PartyLegalAddress$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: PartyTaxIdType$inboundSchema.optional(), tax_profile: z.nullable(z.lazy(() => PartyTaxProfile$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 PartyLegalEntity$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?: PartyEntityDueDiligence$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?: PartyFormationDate$Outbound | null | undefined; global_person_id?: string | undefined; institutional_customer?: boolean | undefined; investigation_id?: string | undefined; large_trader?: PartyLargeTrader$Outbound | null | undefined; legal_address?: PartyLegalAddress$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?: PartyTaxProfile$Outbound | null | undefined; }; /** @internal */ export const PartyLegalEntity$outboundSchema: z.ZodType< PartyLegalEntity$Outbound, z.ZodTypeDef, PartyLegalEntity > = z.object({ accreditedInvestor: z.boolean().optional(), adviser: z.boolean().optional(), brokerDealer: z.boolean().optional(), businessIndustrialClassification: PartyBusinessIndustrialClassification$outboundSchema.optional(), clientEntityId: z.string().optional(), corporateStructure: PartyCorporateStructure$outboundSchema.optional(), correspondentId: z.string().optional(), doingBusinessAs: z.array(z.string()).optional(), entityDueDiligence: z.nullable( z.lazy(() => PartyEntityDueDiligence$outboundSchema), ).optional(), entityName: z.string().optional(), entityType: PartyEntityType$outboundSchema.optional(), exemptCustomerReason: PartyExemptCustomerReason$outboundSchema.optional(), exemptVerifyingBeneficialOwners: z.boolean().optional(), forTheBenefitOf: z.string().optional(), foreignEntity: z.boolean().optional(), foreignFinancialInstitution: z.boolean().optional(), formationDate: z.nullable(z.lazy(() => PartyFormationDate$outboundSchema)) .optional(), globalPersonId: z.string().optional(), institutionalCustomer: z.boolean().optional(), investigationId: z.string().optional(), largeTrader: z.nullable(z.lazy(() => PartyLargeTrader$outboundSchema)) .optional(), legalAddress: z.nullable(z.lazy(() => PartyLegalAddress$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: PartyTaxIdType$outboundSchema.optional(), taxProfile: z.nullable(z.lazy(() => PartyTaxProfile$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 PartyLegalEntity$ { /** @deprecated use `PartyLegalEntity$inboundSchema` instead. */ export const inboundSchema = PartyLegalEntity$inboundSchema; /** @deprecated use `PartyLegalEntity$outboundSchema` instead. */ export const outboundSchema = PartyLegalEntity$outboundSchema; /** @deprecated use `PartyLegalEntity$Outbound` instead. */ export type Outbound = PartyLegalEntity$Outbound; } export function partyLegalEntityToJSON( partyLegalEntity: PartyLegalEntity, ): string { return JSON.stringify( PartyLegalEntity$outboundSchema.parse(partyLegalEntity), ); } export function partyLegalEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalEntity' from JSON`, ); } /** @internal */ export const PartyBirthDate$inboundSchema: z.ZodType< PartyBirthDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyBirthDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyBirthDate$outboundSchema: z.ZodType< PartyBirthDate$Outbound, z.ZodTypeDef, PartyBirthDate > = 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 PartyBirthDate$ { /** @deprecated use `PartyBirthDate$inboundSchema` instead. */ export const inboundSchema = PartyBirthDate$inboundSchema; /** @deprecated use `PartyBirthDate$outboundSchema` instead. */ export const outboundSchema = PartyBirthDate$outboundSchema; /** @deprecated use `PartyBirthDate$Outbound` instead. */ export type Outbound = PartyBirthDate$Outbound; } export function partyBirthDateToJSON(partyBirthDate: PartyBirthDate): string { return JSON.stringify(PartyBirthDate$outboundSchema.parse(partyBirthDate)); } export function partyBirthDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyBirthDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyBirthDate' from JSON`, ); } /** @internal */ export const PartyDeathDate$inboundSchema: z.ZodType< PartyDeathDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyDeathDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyDeathDate$outboundSchema: z.ZodType< PartyDeathDate$Outbound, z.ZodTypeDef, PartyDeathDate > = 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 PartyDeathDate$ { /** @deprecated use `PartyDeathDate$inboundSchema` instead. */ export const inboundSchema = PartyDeathDate$inboundSchema; /** @deprecated use `PartyDeathDate$outboundSchema` instead. */ export const outboundSchema = PartyDeathDate$outboundSchema; /** @deprecated use `PartyDeathDate$Outbound` instead. */ export type Outbound = PartyDeathDate$Outbound; } export function partyDeathDateToJSON(partyDeathDate: PartyDeathDate): string { return JSON.stringify(PartyDeathDate$outboundSchema.parse(partyDeathDate)); } export function partyDeathDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyDeathDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyDeathDate' from JSON`, ); } /** @internal */ export const PartyEmployerAddress$inboundSchema: z.ZodType< PartyEmployerAddress, 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 PartyEmployerAddress$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 PartyEmployerAddress$outboundSchema: z.ZodType< PartyEmployerAddress$Outbound, z.ZodTypeDef, PartyEmployerAddress > = 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 PartyEmployerAddress$ { /** @deprecated use `PartyEmployerAddress$inboundSchema` instead. */ export const inboundSchema = PartyEmployerAddress$inboundSchema; /** @deprecated use `PartyEmployerAddress$outboundSchema` instead. */ export const outboundSchema = PartyEmployerAddress$outboundSchema; /** @deprecated use `PartyEmployerAddress$Outbound` instead. */ export type Outbound = PartyEmployerAddress$Outbound; } export function partyEmployerAddressToJSON( partyEmployerAddress: PartyEmployerAddress, ): string { return JSON.stringify( PartyEmployerAddress$outboundSchema.parse(partyEmployerAddress), ); } export function partyEmployerAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyEmployerAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyEmployerAddress' from JSON`, ); } /** @internal */ export const PartyEmploymentStatus$inboundSchema: z.ZodType< PartyEmploymentStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyEmploymentStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyEmploymentStatus$outboundSchema: z.ZodType< PartyEmploymentStatusOpen, z.ZodTypeDef, PartyEmploymentStatusOpen > = z.union([ z.nativeEnum(PartyEmploymentStatus), 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 PartyEmploymentStatus$ { /** @deprecated use `PartyEmploymentStatus$inboundSchema` instead. */ export const inboundSchema = PartyEmploymentStatus$inboundSchema; /** @deprecated use `PartyEmploymentStatus$outboundSchema` instead. */ export const outboundSchema = PartyEmploymentStatus$outboundSchema; } /** @internal */ export const PartyEmployment$inboundSchema: z.ZodType< PartyEmployment, z.ZodTypeDef, unknown > = z.object({ employer: z.string().optional(), employer_address: z.nullable(z.lazy(() => PartyEmployerAddress$inboundSchema)) .optional(), employment_id: z.string().optional(), employment_status: PartyEmploymentStatus$inboundSchema.optional(), occupation: z.string().optional(), start_year: z.number().int().optional(), }).transform((v) => { return remap$(v, { "employer_address": "employerAddress", "employment_id": "employmentId", "employment_status": "employmentStatus", "start_year": "startYear", }); }); /** @internal */ export type PartyEmployment$Outbound = { employer?: string | undefined; employer_address?: PartyEmployerAddress$Outbound | null | undefined; employment_id?: string | undefined; employment_status?: string | undefined; occupation?: string | undefined; start_year?: number | undefined; }; /** @internal */ export const PartyEmployment$outboundSchema: z.ZodType< PartyEmployment$Outbound, z.ZodTypeDef, PartyEmployment > = z.object({ employer: z.string().optional(), employerAddress: z.nullable(z.lazy(() => PartyEmployerAddress$outboundSchema)) .optional(), employmentId: z.string().optional(), employmentStatus: PartyEmploymentStatus$outboundSchema.optional(), occupation: z.string().optional(), startYear: z.number().int().optional(), }).transform((v) => { return remap$(v, { employerAddress: "employer_address", employmentId: "employment_id", employmentStatus: "employment_status", startYear: "start_year", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyEmployment$ { /** @deprecated use `PartyEmployment$inboundSchema` instead. */ export const inboundSchema = PartyEmployment$inboundSchema; /** @deprecated use `PartyEmployment$outboundSchema` instead. */ export const outboundSchema = PartyEmployment$outboundSchema; /** @deprecated use `PartyEmployment$Outbound` instead. */ export type Outbound = PartyEmployment$Outbound; } export function partyEmploymentToJSON( partyEmployment: PartyEmployment, ): string { return JSON.stringify(PartyEmployment$outboundSchema.parse(partyEmployment)); } export function partyEmploymentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyEmployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyEmployment' from JSON`, ); } /** @internal */ export const PartyExpirationDate$inboundSchema: z.ZodType< PartyExpirationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyExpirationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyExpirationDate$outboundSchema: z.ZodType< PartyExpirationDate$Outbound, z.ZodTypeDef, PartyExpirationDate > = 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 PartyExpirationDate$ { /** @deprecated use `PartyExpirationDate$inboundSchema` instead. */ export const inboundSchema = PartyExpirationDate$inboundSchema; /** @deprecated use `PartyExpirationDate$outboundSchema` instead. */ export const outboundSchema = PartyExpirationDate$outboundSchema; /** @deprecated use `PartyExpirationDate$Outbound` instead. */ export type Outbound = PartyExpirationDate$Outbound; } export function partyExpirationDateToJSON( partyExpirationDate: PartyExpirationDate, ): string { return JSON.stringify( PartyExpirationDate$outboundSchema.parse(partyExpirationDate), ); } export function partyExpirationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyExpirationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyExpirationDate' from JSON`, ); } /** @internal */ export const PartyIssueDate$inboundSchema: z.ZodType< PartyIssueDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyIssueDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyIssueDate$outboundSchema: z.ZodType< PartyIssueDate$Outbound, z.ZodTypeDef, PartyIssueDate > = 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 PartyIssueDate$ { /** @deprecated use `PartyIssueDate$inboundSchema` instead. */ export const inboundSchema = PartyIssueDate$inboundSchema; /** @deprecated use `PartyIssueDate$outboundSchema` instead. */ export const outboundSchema = PartyIssueDate$outboundSchema; /** @deprecated use `PartyIssueDate$Outbound` instead. */ export type Outbound = PartyIssueDate$Outbound; } export function partyIssueDateToJSON(partyIssueDate: PartyIssueDate): string { return JSON.stringify(PartyIssueDate$outboundSchema.parse(partyIssueDate)); } export function partyIssueDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyIssueDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyIssueDate' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonType$inboundSchema: z.ZodType< PartyLegalNaturalPersonTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonType$outboundSchema: z.ZodType< PartyLegalNaturalPersonTypeOpen, z.ZodTypeDef, PartyLegalNaturalPersonTypeOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonType), 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 PartyLegalNaturalPersonType$ { /** @deprecated use `PartyLegalNaturalPersonType$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonType$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonType$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonType$outboundSchema; } /** @internal */ export const PartyForeignIdentification$inboundSchema: z.ZodType< PartyForeignIdentification, z.ZodTypeDef, unknown > = z.object({ expiration_date: z.nullable(z.lazy(() => PartyExpirationDate$inboundSchema)) .optional(), ftin: z.boolean().optional(), identification_number: z.string().optional(), issue_date: z.nullable(z.lazy(() => PartyIssueDate$inboundSchema)).optional(), issuing_region_code: z.string().optional(), type: PartyLegalNaturalPersonType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "expiration_date": "expirationDate", "identification_number": "identificationNumber", "issue_date": "issueDate", "issuing_region_code": "issuingRegionCode", }); }); /** @internal */ export type PartyForeignIdentification$Outbound = { expiration_date?: PartyExpirationDate$Outbound | null | undefined; ftin?: boolean | undefined; identification_number?: string | undefined; issue_date?: PartyIssueDate$Outbound | null | undefined; issuing_region_code?: string | undefined; type?: string | undefined; }; /** @internal */ export const PartyForeignIdentification$outboundSchema: z.ZodType< PartyForeignIdentification$Outbound, z.ZodTypeDef, PartyForeignIdentification > = z.object({ expirationDate: z.nullable(z.lazy(() => PartyExpirationDate$outboundSchema)) .optional(), ftin: z.boolean().optional(), identificationNumber: z.string().optional(), issueDate: z.nullable(z.lazy(() => PartyIssueDate$outboundSchema)).optional(), issuingRegionCode: z.string().optional(), type: PartyLegalNaturalPersonType$outboundSchema.optional(), }).transform((v) => { return remap$(v, { expirationDate: "expiration_date", identificationNumber: "identification_number", issueDate: "issue_date", issuingRegionCode: "issuing_region_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyForeignIdentification$ { /** @deprecated use `PartyForeignIdentification$inboundSchema` instead. */ export const inboundSchema = PartyForeignIdentification$inboundSchema; /** @deprecated use `PartyForeignIdentification$outboundSchema` instead. */ export const outboundSchema = PartyForeignIdentification$outboundSchema; /** @deprecated use `PartyForeignIdentification$Outbound` instead. */ export type Outbound = PartyForeignIdentification$Outbound; } export function partyForeignIdentificationToJSON( partyForeignIdentification: PartyForeignIdentification, ): string { return JSON.stringify( PartyForeignIdentification$outboundSchema.parse(partyForeignIdentification), ); } export function partyForeignIdentificationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyForeignIdentification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyForeignIdentification' from JSON`, ); } /** @internal */ export const PartyExecutionDate$inboundSchema: z.ZodType< PartyExecutionDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyExecutionDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyExecutionDate$outboundSchema: z.ZodType< PartyExecutionDate$Outbound, z.ZodTypeDef, PartyExecutionDate > = 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 PartyExecutionDate$ { /** @deprecated use `PartyExecutionDate$inboundSchema` instead. */ export const inboundSchema = PartyExecutionDate$inboundSchema; /** @deprecated use `PartyExecutionDate$outboundSchema` instead. */ export const outboundSchema = PartyExecutionDate$outboundSchema; /** @deprecated use `PartyExecutionDate$Outbound` instead. */ export type Outbound = PartyExecutionDate$Outbound; } export function partyExecutionDateToJSON( partyExecutionDate: PartyExecutionDate, ): string { return JSON.stringify( PartyExecutionDate$outboundSchema.parse(partyExecutionDate), ); } export function partyExecutionDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyExecutionDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyExecutionDate' from JSON`, ); } /** @internal */ export const PartyIdentityVerificationResult$inboundSchema: z.ZodType< PartyIdentityVerificationResult, z.ZodTypeDef, unknown > = z.object({ address_verified: z.boolean().optional(), birth_date_verified: z.boolean().optional(), execution_date: z.nullable(z.lazy(() => PartyExecutionDate$inboundSchema)) .optional(), external_case_id: z.string().optional(), identity_verification_document_ids: z.array(z.string()).optional(), identity_verification_result_id: z.string().optional(), name_verified: z.boolean().optional(), raw_vendor_data_document_id: z.string().optional(), tax_id_verified: z.boolean().optional(), vendor: z.string().optional(), }).transform((v) => { return remap$(v, { "address_verified": "addressVerified", "birth_date_verified": "birthDateVerified", "execution_date": "executionDate", "external_case_id": "externalCaseId", "identity_verification_document_ids": "identityVerificationDocumentIds", "identity_verification_result_id": "identityVerificationResultId", "name_verified": "nameVerified", "raw_vendor_data_document_id": "rawVendorDataDocumentId", "tax_id_verified": "taxIdVerified", }); }); /** @internal */ export type PartyIdentityVerificationResult$Outbound = { address_verified?: boolean | undefined; birth_date_verified?: boolean | undefined; execution_date?: PartyExecutionDate$Outbound | null | undefined; external_case_id?: string | undefined; identity_verification_document_ids?: Array | undefined; identity_verification_result_id?: string | undefined; name_verified?: boolean | undefined; raw_vendor_data_document_id?: string | undefined; tax_id_verified?: boolean | undefined; vendor?: string | undefined; }; /** @internal */ export const PartyIdentityVerificationResult$outboundSchema: z.ZodType< PartyIdentityVerificationResult$Outbound, z.ZodTypeDef, PartyIdentityVerificationResult > = z.object({ addressVerified: z.boolean().optional(), birthDateVerified: z.boolean().optional(), executionDate: z.nullable(z.lazy(() => PartyExecutionDate$outboundSchema)) .optional(), externalCaseId: z.string().optional(), identityVerificationDocumentIds: z.array(z.string()).optional(), identityVerificationResultId: z.string().optional(), nameVerified: z.boolean().optional(), rawVendorDataDocumentId: z.string().optional(), taxIdVerified: z.boolean().optional(), vendor: z.string().optional(), }).transform((v) => { return remap$(v, { addressVerified: "address_verified", birthDateVerified: "birth_date_verified", executionDate: "execution_date", externalCaseId: "external_case_id", identityVerificationDocumentIds: "identity_verification_document_ids", identityVerificationResultId: "identity_verification_result_id", nameVerified: "name_verified", rawVendorDataDocumentId: "raw_vendor_data_document_id", taxIdVerified: "tax_id_verified", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyIdentityVerificationResult$ { /** @deprecated use `PartyIdentityVerificationResult$inboundSchema` instead. */ export const inboundSchema = PartyIdentityVerificationResult$inboundSchema; /** @deprecated use `PartyIdentityVerificationResult$outboundSchema` instead. */ export const outboundSchema = PartyIdentityVerificationResult$outboundSchema; /** @deprecated use `PartyIdentityVerificationResult$Outbound` instead. */ export type Outbound = PartyIdentityVerificationResult$Outbound; } export function partyIdentityVerificationResultToJSON( partyIdentityVerificationResult: PartyIdentityVerificationResult, ): string { return JSON.stringify( PartyIdentityVerificationResult$outboundSchema.parse( partyIdentityVerificationResult, ), ); } export function partyIdentityVerificationResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyIdentityVerificationResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyIdentityVerificationResult' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonEffectiveDate$inboundSchema: z.ZodType< PartyLegalNaturalPersonEffectiveDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyLegalNaturalPersonEffectiveDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyLegalNaturalPersonEffectiveDate$outboundSchema: z.ZodType< PartyLegalNaturalPersonEffectiveDate$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonEffectiveDate > = 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 PartyLegalNaturalPersonEffectiveDate$ { /** @deprecated use `PartyLegalNaturalPersonEffectiveDate$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonEffectiveDate$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonEffectiveDate$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonEffectiveDate$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonEffectiveDate$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonEffectiveDate$Outbound; } export function partyLegalNaturalPersonEffectiveDateToJSON( partyLegalNaturalPersonEffectiveDate: PartyLegalNaturalPersonEffectiveDate, ): string { return JSON.stringify( PartyLegalNaturalPersonEffectiveDate$outboundSchema.parse( partyLegalNaturalPersonEffectiveDate, ), ); } export function partyLegalNaturalPersonEffectiveDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPersonEffectiveDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPersonEffectiveDate' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonLargeTrader$inboundSchema: z.ZodType< PartyLegalNaturalPersonLargeTrader, z.ZodTypeDef, unknown > = z.object({ effective_date: z.nullable( z.lazy(() => PartyLegalNaturalPersonEffectiveDate$inboundSchema), ).optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type PartyLegalNaturalPersonLargeTrader$Outbound = { effective_date?: | PartyLegalNaturalPersonEffectiveDate$Outbound | null | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const PartyLegalNaturalPersonLargeTrader$outboundSchema: z.ZodType< PartyLegalNaturalPersonLargeTrader$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonLargeTrader > = z.object({ effectiveDate: z.nullable( z.lazy(() => PartyLegalNaturalPersonEffectiveDate$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 PartyLegalNaturalPersonLargeTrader$ { /** @deprecated use `PartyLegalNaturalPersonLargeTrader$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonLargeTrader$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonLargeTrader$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonLargeTrader$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonLargeTrader$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonLargeTrader$Outbound; } export function partyLegalNaturalPersonLargeTraderToJSON( partyLegalNaturalPersonLargeTrader: PartyLegalNaturalPersonLargeTrader, ): string { return JSON.stringify( PartyLegalNaturalPersonLargeTrader$outboundSchema.parse( partyLegalNaturalPersonLargeTrader, ), ); } export function partyLegalNaturalPersonLargeTraderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPersonLargeTrader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPersonLargeTrader' from JSON`, ); } /** @internal */ export const PartyMaritalStatus$inboundSchema: z.ZodType< PartyMaritalStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyMaritalStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyMaritalStatus$outboundSchema: z.ZodType< PartyMaritalStatusOpen, z.ZodTypeDef, PartyMaritalStatusOpen > = z.union([ z.nativeEnum(PartyMaritalStatus), 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 PartyMaritalStatus$ { /** @deprecated use `PartyMaritalStatus$inboundSchema` instead. */ export const inboundSchema = PartyMaritalStatus$inboundSchema; /** @deprecated use `PartyMaritalStatus$outboundSchema` instead. */ export const outboundSchema = PartyMaritalStatus$outboundSchema; } /** @internal */ export const PartyNameSuffix$inboundSchema: z.ZodType< PartyNameSuffixOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyNameSuffix), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyNameSuffix$outboundSchema: z.ZodType< PartyNameSuffixOpen, z.ZodTypeDef, PartyNameSuffixOpen > = z.union([ z.nativeEnum(PartyNameSuffix), 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 PartyNameSuffix$ { /** @deprecated use `PartyNameSuffix$inboundSchema` instead. */ export const inboundSchema = PartyNameSuffix$inboundSchema; /** @deprecated use `PartyNameSuffix$outboundSchema` instead. */ export const outboundSchema = PartyNameSuffix$outboundSchema; } /** @internal */ export const PartyCustomerReferralSource$inboundSchema: z.ZodType< PartyCustomerReferralSource, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), relationship_to_applicant: z.string().optional(), relationship_years_with_applicant: z.number().int().optional(), relationship_years_with_broker: z.number().int().optional(), }).transform((v) => { return remap$(v, { "relationship_to_applicant": "relationshipToApplicant", "relationship_years_with_applicant": "relationshipYearsWithApplicant", "relationship_years_with_broker": "relationshipYearsWithBroker", }); }); /** @internal */ export type PartyCustomerReferralSource$Outbound = { name?: string | undefined; relationship_to_applicant?: string | undefined; relationship_years_with_applicant?: number | undefined; relationship_years_with_broker?: number | undefined; }; /** @internal */ export const PartyCustomerReferralSource$outboundSchema: z.ZodType< PartyCustomerReferralSource$Outbound, z.ZodTypeDef, PartyCustomerReferralSource > = z.object({ name: z.string().optional(), relationshipToApplicant: z.string().optional(), relationshipYearsWithApplicant: z.number().int().optional(), relationshipYearsWithBroker: z.number().int().optional(), }).transform((v) => { return remap$(v, { relationshipToApplicant: "relationship_to_applicant", relationshipYearsWithApplicant: "relationship_years_with_applicant", relationshipYearsWithBroker: "relationship_years_with_broker", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyCustomerReferralSource$ { /** @deprecated use `PartyCustomerReferralSource$inboundSchema` instead. */ export const inboundSchema = PartyCustomerReferralSource$inboundSchema; /** @deprecated use `PartyCustomerReferralSource$outboundSchema` instead. */ export const outboundSchema = PartyCustomerReferralSource$outboundSchema; /** @deprecated use `PartyCustomerReferralSource$Outbound` instead. */ export type Outbound = PartyCustomerReferralSource$Outbound; } export function partyCustomerReferralSourceToJSON( partyCustomerReferralSource: PartyCustomerReferralSource, ): string { return JSON.stringify( PartyCustomerReferralSource$outboundSchema.parse( partyCustomerReferralSource, ), ); } export function partyCustomerReferralSourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyCustomerReferralSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyCustomerReferralSource' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonNegativeNews$inboundSchema: z.ZodType< PartyLegalNaturalPersonNegativeNews, 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 PartyLegalNaturalPersonNegativeNews$Outbound = { negative_news_against_related_parties?: boolean | undefined; negative_news_against_related_parties_description?: string | undefined; }; /** @internal */ export const PartyLegalNaturalPersonNegativeNews$outboundSchema: z.ZodType< PartyLegalNaturalPersonNegativeNews$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonNegativeNews > = 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 PartyLegalNaturalPersonNegativeNews$ { /** @deprecated use `PartyLegalNaturalPersonNegativeNews$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonNegativeNews$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonNegativeNews$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonNegativeNews$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonNegativeNews$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonNegativeNews$Outbound; } export function partyLegalNaturalPersonNegativeNewsToJSON( partyLegalNaturalPersonNegativeNews: PartyLegalNaturalPersonNegativeNews, ): string { return JSON.stringify( PartyLegalNaturalPersonNegativeNews$outboundSchema.parse( partyLegalNaturalPersonNegativeNews, ), ); } export function partyLegalNaturalPersonNegativeNewsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPersonNegativeNews$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPersonNegativeNews' from JSON`, ); } /** @internal */ export const PartyOtherSourcesOfWealth$inboundSchema: z.ZodType< PartyOtherSourcesOfWealth, z.ZodTypeDef, unknown > = z.object({ applicant_has_other_sources_of_wealth: z.boolean().optional(), other_sources_of_wealth: z.string().optional(), other_sources_of_wealth_verification: z.string().optional(), }).transform((v) => { return remap$(v, { "applicant_has_other_sources_of_wealth": "applicantHasOtherSourcesOfWealth", "other_sources_of_wealth": "otherSourcesOfWealth", "other_sources_of_wealth_verification": "otherSourcesOfWealthVerification", }); }); /** @internal */ export type PartyOtherSourcesOfWealth$Outbound = { applicant_has_other_sources_of_wealth?: boolean | undefined; other_sources_of_wealth?: string | undefined; other_sources_of_wealth_verification?: string | undefined; }; /** @internal */ export const PartyOtherSourcesOfWealth$outboundSchema: z.ZodType< PartyOtherSourcesOfWealth$Outbound, z.ZodTypeDef, PartyOtherSourcesOfWealth > = z.object({ applicantHasOtherSourcesOfWealth: z.boolean().optional(), otherSourcesOfWealth: z.string().optional(), otherSourcesOfWealthVerification: z.string().optional(), }).transform((v) => { return remap$(v, { applicantHasOtherSourcesOfWealth: "applicant_has_other_sources_of_wealth", otherSourcesOfWealth: "other_sources_of_wealth", otherSourcesOfWealthVerification: "other_sources_of_wealth_verification", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyOtherSourcesOfWealth$ { /** @deprecated use `PartyOtherSourcesOfWealth$inboundSchema` instead. */ export const inboundSchema = PartyOtherSourcesOfWealth$inboundSchema; /** @deprecated use `PartyOtherSourcesOfWealth$outboundSchema` instead. */ export const outboundSchema = PartyOtherSourcesOfWealth$outboundSchema; /** @deprecated use `PartyOtherSourcesOfWealth$Outbound` instead. */ export type Outbound = PartyOtherSourcesOfWealth$Outbound; } export function partyOtherSourcesOfWealthToJSON( partyOtherSourcesOfWealth: PartyOtherSourcesOfWealth, ): string { return JSON.stringify( PartyOtherSourcesOfWealth$outboundSchema.parse(partyOtherSourcesOfWealth), ); } export function partyOtherSourcesOfWealthFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyOtherSourcesOfWealth$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyOtherSourcesOfWealth' from JSON`, ); } /** @internal */ export const PartyNaturalPersonFdd$inboundSchema: z.ZodType< PartyNaturalPersonFdd, z.ZodTypeDef, unknown > = z.object({ customer_non_referral_source: z.string().optional(), customer_referral_source: z.nullable( z.lazy(() => PartyCustomerReferralSource$inboundSchema), ).optional(), employment_and_employer_description: z.string().optional(), negative_news: z.nullable( z.lazy(() => PartyLegalNaturalPersonNegativeNews$inboundSchema), ).optional(), other_sources_of_wealth: z.nullable( z.lazy(() => PartyOtherSourcesOfWealth$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "customer_non_referral_source": "customerNonReferralSource", "customer_referral_source": "customerReferralSource", "employment_and_employer_description": "employmentAndEmployerDescription", "negative_news": "negativeNews", "other_sources_of_wealth": "otherSourcesOfWealth", }); }); /** @internal */ export type PartyNaturalPersonFdd$Outbound = { customer_non_referral_source?: string | undefined; customer_referral_source?: | PartyCustomerReferralSource$Outbound | null | undefined; employment_and_employer_description?: string | undefined; negative_news?: | PartyLegalNaturalPersonNegativeNews$Outbound | null | undefined; other_sources_of_wealth?: | PartyOtherSourcesOfWealth$Outbound | null | undefined; }; /** @internal */ export const PartyNaturalPersonFdd$outboundSchema: z.ZodType< PartyNaturalPersonFdd$Outbound, z.ZodTypeDef, PartyNaturalPersonFdd > = z.object({ customerNonReferralSource: z.string().optional(), customerReferralSource: z.nullable( z.lazy(() => PartyCustomerReferralSource$outboundSchema), ).optional(), employmentAndEmployerDescription: z.string().optional(), negativeNews: z.nullable( z.lazy(() => PartyLegalNaturalPersonNegativeNews$outboundSchema), ).optional(), otherSourcesOfWealth: z.nullable( z.lazy(() => PartyOtherSourcesOfWealth$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { customerNonReferralSource: "customer_non_referral_source", customerReferralSource: "customer_referral_source", employmentAndEmployerDescription: "employment_and_employer_description", negativeNews: "negative_news", otherSourcesOfWealth: "other_sources_of_wealth", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyNaturalPersonFdd$ { /** @deprecated use `PartyNaturalPersonFdd$inboundSchema` instead. */ export const inboundSchema = PartyNaturalPersonFdd$inboundSchema; /** @deprecated use `PartyNaturalPersonFdd$outboundSchema` instead. */ export const outboundSchema = PartyNaturalPersonFdd$outboundSchema; /** @deprecated use `PartyNaturalPersonFdd$Outbound` instead. */ export type Outbound = PartyNaturalPersonFdd$Outbound; } export function partyNaturalPersonFddToJSON( partyNaturalPersonFdd: PartyNaturalPersonFdd, ): string { return JSON.stringify( PartyNaturalPersonFdd$outboundSchema.parse(partyNaturalPersonFdd), ); } export function partyNaturalPersonFddFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyNaturalPersonFdd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyNaturalPersonFdd' from JSON`, ); } /** @internal */ export const PartyResidencyStatus$inboundSchema: z.ZodType< PartyResidencyStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyResidencyStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyResidencyStatus$outboundSchema: z.ZodType< PartyResidencyStatusOpen, z.ZodTypeDef, PartyResidencyStatusOpen > = z.union([ z.nativeEnum(PartyResidencyStatus), 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 PartyResidencyStatus$ { /** @deprecated use `PartyResidencyStatus$inboundSchema` instead. */ export const inboundSchema = PartyResidencyStatus$inboundSchema; /** @deprecated use `PartyResidencyStatus$outboundSchema` instead. */ export const outboundSchema = PartyResidencyStatus$outboundSchema; } /** @internal */ export const PartyNonCitizenResidency$inboundSchema: z.ZodType< PartyNonCitizenResidency, z.ZodTypeDef, unknown > = z.object({ residency_status: PartyResidencyStatus$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "residency_status": "residencyStatus", }); }); /** @internal */ export type PartyNonCitizenResidency$Outbound = { residency_status?: string | undefined; }; /** @internal */ export const PartyNonCitizenResidency$outboundSchema: z.ZodType< PartyNonCitizenResidency$Outbound, z.ZodTypeDef, PartyNonCitizenResidency > = z.object({ residencyStatus: PartyResidencyStatus$outboundSchema.optional(), }).transform((v) => { return remap$(v, { residencyStatus: "residency_status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyNonCitizenResidency$ { /** @deprecated use `PartyNonCitizenResidency$inboundSchema` instead. */ export const inboundSchema = PartyNonCitizenResidency$inboundSchema; /** @deprecated use `PartyNonCitizenResidency$outboundSchema` instead. */ export const outboundSchema = PartyNonCitizenResidency$outboundSchema; /** @deprecated use `PartyNonCitizenResidency$Outbound` instead. */ export type Outbound = PartyNonCitizenResidency$Outbound; } export function partyNonCitizenResidencyToJSON( partyNonCitizenResidency: PartyNonCitizenResidency, ): string { return JSON.stringify( PartyNonCitizenResidency$outboundSchema.parse(partyNonCitizenResidency), ); } export function partyNonCitizenResidencyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyNonCitizenResidency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyNonCitizenResidency' from JSON`, ); } /** @internal */ export const PartyPersonalAddress$inboundSchema: z.ZodType< PartyPersonalAddress, 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 PartyPersonalAddress$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 PartyPersonalAddress$outboundSchema: z.ZodType< PartyPersonalAddress$Outbound, z.ZodTypeDef, PartyPersonalAddress > = 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 PartyPersonalAddress$ { /** @deprecated use `PartyPersonalAddress$inboundSchema` instead. */ export const inboundSchema = PartyPersonalAddress$inboundSchema; /** @deprecated use `PartyPersonalAddress$outboundSchema` instead. */ export const outboundSchema = PartyPersonalAddress$outboundSchema; /** @deprecated use `PartyPersonalAddress$Outbound` instead. */ export type Outbound = PartyPersonalAddress$Outbound; } export function partyPersonalAddressToJSON( partyPersonalAddress: PartyPersonalAddress, ): string { return JSON.stringify( PartyPersonalAddress$outboundSchema.parse(partyPersonalAddress), ); } export function partyPersonalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyPersonalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyPersonalAddress' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonTaxIdType$inboundSchema: z.ZodType< PartyLegalNaturalPersonTaxIdTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonTaxIdType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonTaxIdType$outboundSchema: z.ZodType< PartyLegalNaturalPersonTaxIdTypeOpen, z.ZodTypeDef, PartyLegalNaturalPersonTaxIdTypeOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonTaxIdType), 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 PartyLegalNaturalPersonTaxIdType$ { /** @deprecated use `PartyLegalNaturalPersonTaxIdType$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonTaxIdType$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxIdType$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonTaxIdType$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonCNoticeDate$inboundSchema: z.ZodType< PartyLegalNaturalPersonCNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyLegalNaturalPersonCNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyLegalNaturalPersonCNoticeDate$outboundSchema: z.ZodType< PartyLegalNaturalPersonCNoticeDate$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonCNoticeDate > = 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 PartyLegalNaturalPersonCNoticeDate$ { /** @deprecated use `PartyLegalNaturalPersonCNoticeDate$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonCNoticeDate$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonCNoticeDate$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonCNoticeDate$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonCNoticeDate$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonCNoticeDate$Outbound; } export function partyLegalNaturalPersonCNoticeDateToJSON( partyLegalNaturalPersonCNoticeDate: PartyLegalNaturalPersonCNoticeDate, ): string { return JSON.stringify( PartyLegalNaturalPersonCNoticeDate$outboundSchema.parse( partyLegalNaturalPersonCNoticeDate, ), ); } export function partyLegalNaturalPersonCNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPersonCNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPersonCNoticeDate' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonFederalTaxClassification$inboundSchema: z.ZodType< PartyLegalNaturalPersonFederalTaxClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonFederalTaxClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonFederalTaxClassification$outboundSchema: z.ZodType< PartyLegalNaturalPersonFederalTaxClassificationOpen, z.ZodTypeDef, PartyLegalNaturalPersonFederalTaxClassificationOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonFederalTaxClassification), 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 PartyLegalNaturalPersonFederalTaxClassification$ { /** @deprecated use `PartyLegalNaturalPersonFederalTaxClassification$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonFederalTaxClassification$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonFederalTaxClassification$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonFederalTaxClassification$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonFirstBNoticeDate$inboundSchema: z.ZodType< PartyLegalNaturalPersonFirstBNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyLegalNaturalPersonFirstBNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyLegalNaturalPersonFirstBNoticeDate$outboundSchema: z.ZodType< PartyLegalNaturalPersonFirstBNoticeDate$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonFirstBNoticeDate > = 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 PartyLegalNaturalPersonFirstBNoticeDate$ { /** @deprecated use `PartyLegalNaturalPersonFirstBNoticeDate$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonFirstBNoticeDate$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonFirstBNoticeDate$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonFirstBNoticeDate$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonFirstBNoticeDate$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonFirstBNoticeDate$Outbound; } export function partyLegalNaturalPersonFirstBNoticeDateToJSON( partyLegalNaturalPersonFirstBNoticeDate: PartyLegalNaturalPersonFirstBNoticeDate, ): string { return JSON.stringify( PartyLegalNaturalPersonFirstBNoticeDate$outboundSchema.parse( partyLegalNaturalPersonFirstBNoticeDate, ), ); } export function partyLegalNaturalPersonFirstBNoticeDateFromJSON( jsonString: string, ): SafeParseResult< PartyLegalNaturalPersonFirstBNoticeDate, SDKValidationError > { return safeParse( jsonString, (x) => PartyLegalNaturalPersonFirstBNoticeDate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PartyLegalNaturalPersonFirstBNoticeDate' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonIrsFormType$inboundSchema: z.ZodType< PartyLegalNaturalPersonIrsFormTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonIrsFormType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonIrsFormType$outboundSchema: z.ZodType< PartyLegalNaturalPersonIrsFormTypeOpen, z.ZodTypeDef, PartyLegalNaturalPersonIrsFormTypeOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonIrsFormType), 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 PartyLegalNaturalPersonIrsFormType$ { /** @deprecated use `PartyLegalNaturalPersonIrsFormType$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonIrsFormType$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonIrsFormType$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonIrsFormType$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonReportingEligibility$inboundSchema: z.ZodType< PartyLegalNaturalPersonReportingEligibilityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonReportingEligibility), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonReportingEligibility$outboundSchema: z.ZodType< PartyLegalNaturalPersonReportingEligibilityOpen, z.ZodTypeDef, PartyLegalNaturalPersonReportingEligibilityOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonReportingEligibility), 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 PartyLegalNaturalPersonReportingEligibility$ { /** @deprecated use `PartyLegalNaturalPersonReportingEligibility$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonReportingEligibility$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonReportingEligibility$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonReportingEligibility$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonTaxCertificationDate$inboundSchema: z.ZodType< PartyLegalNaturalPersonTaxCertificationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type PartyLegalNaturalPersonTaxCertificationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const PartyLegalNaturalPersonTaxCertificationDate$outboundSchema: z.ZodType< PartyLegalNaturalPersonTaxCertificationDate$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonTaxCertificationDate > = 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 PartyLegalNaturalPersonTaxCertificationDate$ { /** @deprecated use `PartyLegalNaturalPersonTaxCertificationDate$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonTaxCertificationDate$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxCertificationDate$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonTaxCertificationDate$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxCertificationDate$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonTaxCertificationDate$Outbound; } export function partyLegalNaturalPersonTaxCertificationDateToJSON( partyLegalNaturalPersonTaxCertificationDate: PartyLegalNaturalPersonTaxCertificationDate, ): string { return JSON.stringify( PartyLegalNaturalPersonTaxCertificationDate$outboundSchema.parse( partyLegalNaturalPersonTaxCertificationDate, ), ); } export function partyLegalNaturalPersonTaxCertificationDateFromJSON( jsonString: string, ): SafeParseResult< PartyLegalNaturalPersonTaxCertificationDate, SDKValidationError > { return safeParse( jsonString, (x) => PartyLegalNaturalPersonTaxCertificationDate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PartyLegalNaturalPersonTaxCertificationDate' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPersonTaxpayerCertificationState$inboundSchema: z.ZodType< PartyLegalNaturalPersonTaxpayerCertificationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonTaxpayerCertificationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonTaxpayerCertificationState$outboundSchema: z.ZodType< PartyLegalNaturalPersonTaxpayerCertificationStateOpen, z.ZodTypeDef, PartyLegalNaturalPersonTaxpayerCertificationStateOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonTaxpayerCertificationState), 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 PartyLegalNaturalPersonTaxpayerCertificationState$ { /** @deprecated use `PartyLegalNaturalPersonTaxpayerCertificationState$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonTaxpayerCertificationState$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxpayerCertificationState$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonTaxpayerCertificationState$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonUsTinStatus$inboundSchema: z.ZodType< PartyLegalNaturalPersonUsTinStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonUsTinStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonUsTinStatus$outboundSchema: z.ZodType< PartyLegalNaturalPersonUsTinStatusOpen, z.ZodTypeDef, PartyLegalNaturalPersonUsTinStatusOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonUsTinStatus), 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 PartyLegalNaturalPersonUsTinStatus$ { /** @deprecated use `PartyLegalNaturalPersonUsTinStatus$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonUsTinStatus$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonUsTinStatus$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonUsTinStatus$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonWithholdingState$inboundSchema: z.ZodType< PartyLegalNaturalPersonWithholdingStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyLegalNaturalPersonWithholdingState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyLegalNaturalPersonWithholdingState$outboundSchema: z.ZodType< PartyLegalNaturalPersonWithholdingStateOpen, z.ZodTypeDef, PartyLegalNaturalPersonWithholdingStateOpen > = z.union([ z.nativeEnum(PartyLegalNaturalPersonWithholdingState), 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 PartyLegalNaturalPersonWithholdingState$ { /** @deprecated use `PartyLegalNaturalPersonWithholdingState$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonWithholdingState$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonWithholdingState$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonWithholdingState$outboundSchema; } /** @internal */ export const PartyLegalNaturalPersonTaxProfile$inboundSchema: z.ZodType< PartyLegalNaturalPersonTaxProfile, z.ZodTypeDef, unknown > = z.object({ c_notice_date: z.nullable( z.lazy(() => PartyLegalNaturalPersonCNoticeDate$inboundSchema), ).optional(), federal_tax_classification: PartyLegalNaturalPersonFederalTaxClassification$inboundSchema.optional(), first_b_notice_date: z.nullable( z.lazy(() => PartyLegalNaturalPersonFirstBNoticeDate$inboundSchema), ).optional(), irs_form_type: PartyLegalNaturalPersonIrsFormType$inboundSchema.optional(), legal_tax_region_code: z.string().optional(), reporting_eligibility: PartyLegalNaturalPersonReportingEligibility$inboundSchema.optional(), tax_certification_date: z.nullable( z.lazy(() => PartyLegalNaturalPersonTaxCertificationDate$inboundSchema), ).optional(), taxpayer_certification_state: PartyLegalNaturalPersonTaxpayerCertificationState$inboundSchema.optional(), us_tin_status: PartyLegalNaturalPersonUsTinStatus$inboundSchema.optional(), withholding_state: PartyLegalNaturalPersonWithholdingState$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 PartyLegalNaturalPersonTaxProfile$Outbound = { c_notice_date?: | PartyLegalNaturalPersonCNoticeDate$Outbound | null | undefined; federal_tax_classification?: string | undefined; first_b_notice_date?: | PartyLegalNaturalPersonFirstBNoticeDate$Outbound | null | undefined; irs_form_type?: string | undefined; legal_tax_region_code?: string | undefined; reporting_eligibility?: string | undefined; tax_certification_date?: | PartyLegalNaturalPersonTaxCertificationDate$Outbound | null | undefined; taxpayer_certification_state?: string | undefined; us_tin_status?: string | undefined; withholding_state?: string | undefined; }; /** @internal */ export const PartyLegalNaturalPersonTaxProfile$outboundSchema: z.ZodType< PartyLegalNaturalPersonTaxProfile$Outbound, z.ZodTypeDef, PartyLegalNaturalPersonTaxProfile > = z.object({ cNoticeDate: z.nullable( z.lazy(() => PartyLegalNaturalPersonCNoticeDate$outboundSchema), ).optional(), federalTaxClassification: PartyLegalNaturalPersonFederalTaxClassification$outboundSchema.optional(), firstBNoticeDate: z.nullable( z.lazy(() => PartyLegalNaturalPersonFirstBNoticeDate$outboundSchema), ).optional(), irsFormType: PartyLegalNaturalPersonIrsFormType$outboundSchema.optional(), legalTaxRegionCode: z.string().optional(), reportingEligibility: PartyLegalNaturalPersonReportingEligibility$outboundSchema.optional(), taxCertificationDate: z.nullable( z.lazy(() => PartyLegalNaturalPersonTaxCertificationDate$outboundSchema), ).optional(), taxpayerCertificationState: PartyLegalNaturalPersonTaxpayerCertificationState$outboundSchema.optional(), usTinStatus: PartyLegalNaturalPersonUsTinStatus$outboundSchema.optional(), withholdingState: PartyLegalNaturalPersonWithholdingState$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 PartyLegalNaturalPersonTaxProfile$ { /** @deprecated use `PartyLegalNaturalPersonTaxProfile$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPersonTaxProfile$inboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxProfile$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPersonTaxProfile$outboundSchema; /** @deprecated use `PartyLegalNaturalPersonTaxProfile$Outbound` instead. */ export type Outbound = PartyLegalNaturalPersonTaxProfile$Outbound; } export function partyLegalNaturalPersonTaxProfileToJSON( partyLegalNaturalPersonTaxProfile: PartyLegalNaturalPersonTaxProfile, ): string { return JSON.stringify( PartyLegalNaturalPersonTaxProfile$outboundSchema.parse( partyLegalNaturalPersonTaxProfile, ), ); } export function partyLegalNaturalPersonTaxProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPersonTaxProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPersonTaxProfile' from JSON`, ); } /** @internal */ export const PartyLegalNaturalPerson$inboundSchema: z.ZodType< PartyLegalNaturalPerson, z.ZodTypeDef, unknown > = z.object({ accredited_investor: z.boolean().optional(), adviser: z.boolean().optional(), birth_date: z.nullable(z.lazy(() => PartyBirthDate$inboundSchema)).optional(), citizenship_countries: z.array(z.string()).optional(), client_person_id: z.string().optional(), control_person_company_symbols: z.string().optional(), correspondent_employee: z.boolean().optional(), correspondent_id: z.string().optional(), custodian_employee: z.boolean().optional(), customer_identification_id: z.string().optional(), death_date: z.nullable(z.lazy(() => PartyDeathDate$inboundSchema)).optional(), doing_business_as: z.array(z.string()).optional(), employment: z.nullable(z.lazy(() => PartyEmployment$inboundSchema)) .optional(), family_name: z.string().optional(), finra_associated_entity: z.string().optional(), foreign_identification: z.nullable( z.lazy(() => PartyForeignIdentification$inboundSchema), ).optional(), given_name: z.string().optional(), global_person_id: z.string().optional(), identity_verification_result: z.nullable( z.lazy(() => PartyIdentityVerificationResult$inboundSchema), ).optional(), institutional_customer: z.boolean().optional(), investigation_id: z.string().optional(), large_trader: z.nullable( z.lazy(() => PartyLegalNaturalPersonLargeTrader$inboundSchema), ).optional(), legal_natural_person_id: z.string().optional(), marital_status: PartyMaritalStatus$inboundSchema.optional(), middle_names: z.string().optional(), name: z.string().optional(), name_suffix: PartyNameSuffix$inboundSchema.optional(), natural_person_fdd: z.nullable( z.lazy(() => PartyNaturalPersonFdd$inboundSchema), ).optional(), non_citizen_residency: z.nullable( z.lazy(() => PartyNonCitizenResidency$inboundSchema), ).optional(), personal_address: z.nullable(z.lazy(() => PartyPersonalAddress$inboundSchema)) .optional(), politically_exposed_immediate_family_names: z.array(z.string()).optional(), politically_exposed_organization: z.string().optional(), tax_id: z.string().optional(), tax_id_last_four: z.string().optional(), tax_id_type: PartyLegalNaturalPersonTaxIdType$inboundSchema.optional(), tax_profile: z.nullable( z.lazy(() => PartyLegalNaturalPersonTaxProfile$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "accredited_investor": "accreditedInvestor", "birth_date": "birthDate", "citizenship_countries": "citizenshipCountries", "client_person_id": "clientPersonId", "control_person_company_symbols": "controlPersonCompanySymbols", "correspondent_employee": "correspondentEmployee", "correspondent_id": "correspondentId", "custodian_employee": "custodianEmployee", "customer_identification_id": "customerIdentificationId", "death_date": "deathDate", "doing_business_as": "doingBusinessAs", "family_name": "familyName", "finra_associated_entity": "finraAssociatedEntity", "foreign_identification": "foreignIdentification", "given_name": "givenName", "global_person_id": "globalPersonId", "identity_verification_result": "identityVerificationResult", "institutional_customer": "institutionalCustomer", "investigation_id": "investigationId", "large_trader": "largeTrader", "legal_natural_person_id": "legalNaturalPersonId", "marital_status": "maritalStatus", "middle_names": "middleNames", "name_suffix": "nameSuffix", "natural_person_fdd": "naturalPersonFdd", "non_citizen_residency": "nonCitizenResidency", "personal_address": "personalAddress", "politically_exposed_immediate_family_names": "politicallyExposedImmediateFamilyNames", "politically_exposed_organization": "politicallyExposedOrganization", "tax_id": "taxId", "tax_id_last_four": "taxIdLastFour", "tax_id_type": "taxIdType", "tax_profile": "taxProfile", }); }); /** @internal */ export type PartyLegalNaturalPerson$Outbound = { accredited_investor?: boolean | undefined; adviser?: boolean | undefined; birth_date?: PartyBirthDate$Outbound | null | undefined; citizenship_countries?: Array | undefined; client_person_id?: string | undefined; control_person_company_symbols?: string | undefined; correspondent_employee?: boolean | undefined; correspondent_id?: string | undefined; custodian_employee?: boolean | undefined; customer_identification_id?: string | undefined; death_date?: PartyDeathDate$Outbound | null | undefined; doing_business_as?: Array | undefined; employment?: PartyEmployment$Outbound | null | undefined; family_name?: string | undefined; finra_associated_entity?: string | undefined; foreign_identification?: | PartyForeignIdentification$Outbound | null | undefined; given_name?: string | undefined; global_person_id?: string | undefined; identity_verification_result?: | PartyIdentityVerificationResult$Outbound | null | undefined; institutional_customer?: boolean | undefined; investigation_id?: string | undefined; large_trader?: PartyLegalNaturalPersonLargeTrader$Outbound | null | undefined; legal_natural_person_id?: string | undefined; marital_status?: string | undefined; middle_names?: string | undefined; name?: string | undefined; name_suffix?: string | undefined; natural_person_fdd?: PartyNaturalPersonFdd$Outbound | null | undefined; non_citizen_residency?: PartyNonCitizenResidency$Outbound | null | undefined; personal_address?: PartyPersonalAddress$Outbound | null | undefined; politically_exposed_immediate_family_names?: Array | undefined; politically_exposed_organization?: string | undefined; tax_id?: string | undefined; tax_id_last_four?: string | undefined; tax_id_type?: string | undefined; tax_profile?: PartyLegalNaturalPersonTaxProfile$Outbound | null | undefined; }; /** @internal */ export const PartyLegalNaturalPerson$outboundSchema: z.ZodType< PartyLegalNaturalPerson$Outbound, z.ZodTypeDef, PartyLegalNaturalPerson > = z.object({ accreditedInvestor: z.boolean().optional(), adviser: z.boolean().optional(), birthDate: z.nullable(z.lazy(() => PartyBirthDate$outboundSchema)).optional(), citizenshipCountries: z.array(z.string()).optional(), clientPersonId: z.string().optional(), controlPersonCompanySymbols: z.string().optional(), correspondentEmployee: z.boolean().optional(), correspondentId: z.string().optional(), custodianEmployee: z.boolean().optional(), customerIdentificationId: z.string().optional(), deathDate: z.nullable(z.lazy(() => PartyDeathDate$outboundSchema)).optional(), doingBusinessAs: z.array(z.string()).optional(), employment: z.nullable(z.lazy(() => PartyEmployment$outboundSchema)) .optional(), familyName: z.string().optional(), finraAssociatedEntity: z.string().optional(), foreignIdentification: z.nullable( z.lazy(() => PartyForeignIdentification$outboundSchema), ).optional(), givenName: z.string().optional(), globalPersonId: z.string().optional(), identityVerificationResult: z.nullable( z.lazy(() => PartyIdentityVerificationResult$outboundSchema), ).optional(), institutionalCustomer: z.boolean().optional(), investigationId: z.string().optional(), largeTrader: z.nullable( z.lazy(() => PartyLegalNaturalPersonLargeTrader$outboundSchema), ).optional(), legalNaturalPersonId: z.string().optional(), maritalStatus: PartyMaritalStatus$outboundSchema.optional(), middleNames: z.string().optional(), name: z.string().optional(), nameSuffix: PartyNameSuffix$outboundSchema.optional(), naturalPersonFdd: z.nullable( z.lazy(() => PartyNaturalPersonFdd$outboundSchema), ).optional(), nonCitizenResidency: z.nullable( z.lazy(() => PartyNonCitizenResidency$outboundSchema), ).optional(), personalAddress: z.nullable(z.lazy(() => PartyPersonalAddress$outboundSchema)) .optional(), politicallyExposedImmediateFamilyNames: z.array(z.string()).optional(), politicallyExposedOrganization: z.string().optional(), taxId: z.string().optional(), taxIdLastFour: z.string().optional(), taxIdType: PartyLegalNaturalPersonTaxIdType$outboundSchema.optional(), taxProfile: z.nullable( z.lazy(() => PartyLegalNaturalPersonTaxProfile$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { accreditedInvestor: "accredited_investor", birthDate: "birth_date", citizenshipCountries: "citizenship_countries", clientPersonId: "client_person_id", controlPersonCompanySymbols: "control_person_company_symbols", correspondentEmployee: "correspondent_employee", correspondentId: "correspondent_id", custodianEmployee: "custodian_employee", customerIdentificationId: "customer_identification_id", deathDate: "death_date", doingBusinessAs: "doing_business_as", familyName: "family_name", finraAssociatedEntity: "finra_associated_entity", foreignIdentification: "foreign_identification", givenName: "given_name", globalPersonId: "global_person_id", identityVerificationResult: "identity_verification_result", institutionalCustomer: "institutional_customer", investigationId: "investigation_id", largeTrader: "large_trader", legalNaturalPersonId: "legal_natural_person_id", maritalStatus: "marital_status", middleNames: "middle_names", nameSuffix: "name_suffix", naturalPersonFdd: "natural_person_fdd", nonCitizenResidency: "non_citizen_residency", personalAddress: "personal_address", politicallyExposedImmediateFamilyNames: "politically_exposed_immediate_family_names", politicallyExposedOrganization: "politically_exposed_organization", 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 PartyLegalNaturalPerson$ { /** @deprecated use `PartyLegalNaturalPerson$inboundSchema` instead. */ export const inboundSchema = PartyLegalNaturalPerson$inboundSchema; /** @deprecated use `PartyLegalNaturalPerson$outboundSchema` instead. */ export const outboundSchema = PartyLegalNaturalPerson$outboundSchema; /** @deprecated use `PartyLegalNaturalPerson$Outbound` instead. */ export type Outbound = PartyLegalNaturalPerson$Outbound; } export function partyLegalNaturalPersonToJSON( partyLegalNaturalPerson: PartyLegalNaturalPerson, ): string { return JSON.stringify( PartyLegalNaturalPerson$outboundSchema.parse(partyLegalNaturalPerson), ); } export function partyLegalNaturalPersonFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyLegalNaturalPerson$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyLegalNaturalPerson' from JSON`, ); } /** @internal */ export const PartyMailingAddress$inboundSchema: z.ZodType< PartyMailingAddress, 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 PartyMailingAddress$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 PartyMailingAddress$outboundSchema: z.ZodType< PartyMailingAddress$Outbound, z.ZodTypeDef, PartyMailingAddress > = 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 PartyMailingAddress$ { /** @deprecated use `PartyMailingAddress$inboundSchema` instead. */ export const inboundSchema = PartyMailingAddress$inboundSchema; /** @deprecated use `PartyMailingAddress$outboundSchema` instead. */ export const outboundSchema = PartyMailingAddress$outboundSchema; /** @deprecated use `PartyMailingAddress$Outbound` instead. */ export type Outbound = PartyMailingAddress$Outbound; } export function partyMailingAddressToJSON( partyMailingAddress: PartyMailingAddress, ): string { return JSON.stringify( PartyMailingAddress$outboundSchema.parse(partyMailingAddress), ); } export function partyMailingAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyMailingAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyMailingAddress' from JSON`, ); } /** @internal */ export const PartyShortCode$inboundSchema: z.ZodType< PartyShortCode, z.ZodTypeDef, unknown > = z.object({ number: z.string().optional(), region_code: z.string().optional(), }).transform((v) => { return remap$(v, { "region_code": "regionCode", }); }); /** @internal */ export type PartyShortCode$Outbound = { number?: string | undefined; region_code?: string | undefined; }; /** @internal */ export const PartyShortCode$outboundSchema: z.ZodType< PartyShortCode$Outbound, z.ZodTypeDef, PartyShortCode > = z.object({ number: z.string().optional(), regionCode: z.string().optional(), }).transform((v) => { return remap$(v, { regionCode: "region_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyShortCode$ { /** @deprecated use `PartyShortCode$inboundSchema` instead. */ export const inboundSchema = PartyShortCode$inboundSchema; /** @deprecated use `PartyShortCode$outboundSchema` instead. */ export const outboundSchema = PartyShortCode$outboundSchema; /** @deprecated use `PartyShortCode$Outbound` instead. */ export type Outbound = PartyShortCode$Outbound; } export function partyShortCodeToJSON(partyShortCode: PartyShortCode): string { return JSON.stringify(PartyShortCode$outboundSchema.parse(partyShortCode)); } export function partyShortCodeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyShortCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyShortCode' from JSON`, ); } /** @internal */ export const PartyPhoneNumber$inboundSchema: z.ZodType< PartyPhoneNumber, z.ZodTypeDef, unknown > = z.object({ e164_number: z.string().optional(), extension: z.string().optional(), short_code: z.nullable(z.lazy(() => PartyShortCode$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "e164_number": "e164Number", "short_code": "shortCode", }); }); /** @internal */ export type PartyPhoneNumber$Outbound = { e164_number?: string | undefined; extension?: string | undefined; short_code?: PartyShortCode$Outbound | null | undefined; }; /** @internal */ export const PartyPhoneNumber$outboundSchema: z.ZodType< PartyPhoneNumber$Outbound, z.ZodTypeDef, PartyPhoneNumber > = z.object({ e164Number: z.string().optional(), extension: z.string().optional(), shortCode: z.nullable(z.lazy(() => PartyShortCode$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { e164Number: "e164_number", shortCode: "short_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PartyPhoneNumber$ { /** @deprecated use `PartyPhoneNumber$inboundSchema` instead. */ export const inboundSchema = PartyPhoneNumber$inboundSchema; /** @deprecated use `PartyPhoneNumber$outboundSchema` instead. */ export const outboundSchema = PartyPhoneNumber$outboundSchema; /** @deprecated use `PartyPhoneNumber$Outbound` instead. */ export type Outbound = PartyPhoneNumber$Outbound; } export function partyPhoneNumberToJSON( partyPhoneNumber: PartyPhoneNumber, ): string { return JSON.stringify( PartyPhoneNumber$outboundSchema.parse(partyPhoneNumber), ); } export function partyPhoneNumberFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartyPhoneNumber$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartyPhoneNumber' from JSON`, ); } /** @internal */ export const PartyProspectusDeliveryPreference$inboundSchema: z.ZodType< PartyProspectusDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyProspectusDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyProspectusDeliveryPreference$outboundSchema: z.ZodType< PartyProspectusDeliveryPreferenceOpen, z.ZodTypeDef, PartyProspectusDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyProspectusDeliveryPreference), 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 PartyProspectusDeliveryPreference$ { /** @deprecated use `PartyProspectusDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyProspectusDeliveryPreference$inboundSchema; /** @deprecated use `PartyProspectusDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyProspectusDeliveryPreference$outboundSchema; } /** @internal */ export const PartyProxyDeliveryPreference$inboundSchema: z.ZodType< PartyProxyDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyProxyDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyProxyDeliveryPreference$outboundSchema: z.ZodType< PartyProxyDeliveryPreferenceOpen, z.ZodTypeDef, PartyProxyDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyProxyDeliveryPreference), 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 PartyProxyDeliveryPreference$ { /** @deprecated use `PartyProxyDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyProxyDeliveryPreference$inboundSchema; /** @deprecated use `PartyProxyDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyProxyDeliveryPreference$outboundSchema; } /** @internal */ export const PartyRelationType$inboundSchema: z.ZodType< PartyRelationTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyRelationType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyRelationType$outboundSchema: z.ZodType< PartyRelationTypeOpen, z.ZodTypeDef, PartyRelationTypeOpen > = z.union([ z.nativeEnum(PartyRelationType), 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 PartyRelationType$ { /** @deprecated use `PartyRelationType$inboundSchema` instead. */ export const inboundSchema = PartyRelationType$inboundSchema; /** @deprecated use `PartyRelationType$outboundSchema` instead. */ export const outboundSchema = PartyRelationType$outboundSchema; } /** @internal */ export const PartyStatementDeliveryPreference$inboundSchema: z.ZodType< PartyStatementDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyStatementDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyStatementDeliveryPreference$outboundSchema: z.ZodType< PartyStatementDeliveryPreferenceOpen, z.ZodTypeDef, PartyStatementDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyStatementDeliveryPreference), 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 PartyStatementDeliveryPreference$ { /** @deprecated use `PartyStatementDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyStatementDeliveryPreference$inboundSchema; /** @deprecated use `PartyStatementDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyStatementDeliveryPreference$outboundSchema; } /** @internal */ export const PartyTaxDocumentDeliveryPreference$inboundSchema: z.ZodType< PartyTaxDocumentDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyTaxDocumentDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyTaxDocumentDeliveryPreference$outboundSchema: z.ZodType< PartyTaxDocumentDeliveryPreferenceOpen, z.ZodTypeDef, PartyTaxDocumentDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyTaxDocumentDeliveryPreference), 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 PartyTaxDocumentDeliveryPreference$ { /** @deprecated use `PartyTaxDocumentDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyTaxDocumentDeliveryPreference$inboundSchema; /** @deprecated use `PartyTaxDocumentDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyTaxDocumentDeliveryPreference$outboundSchema; } /** @internal */ export const PartyTradeConfirmationDeliveryPreference$inboundSchema: z.ZodType< PartyTradeConfirmationDeliveryPreferenceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PartyTradeConfirmationDeliveryPreference), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PartyTradeConfirmationDeliveryPreference$outboundSchema: z.ZodType< PartyTradeConfirmationDeliveryPreferenceOpen, z.ZodTypeDef, PartyTradeConfirmationDeliveryPreferenceOpen > = z.union([ z.nativeEnum(PartyTradeConfirmationDeliveryPreference), 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 PartyTradeConfirmationDeliveryPreference$ { /** @deprecated use `PartyTradeConfirmationDeliveryPreference$inboundSchema` instead. */ export const inboundSchema = PartyTradeConfirmationDeliveryPreference$inboundSchema; /** @deprecated use `PartyTradeConfirmationDeliveryPreference$outboundSchema` instead. */ export const outboundSchema = PartyTradeConfirmationDeliveryPreference$outboundSchema; } /** @internal */ export const Party$inboundSchema: z.ZodType = z .object({ cftc_document_delivery_preference: PartyCftcDocumentDeliveryPreference$inboundSchema.optional(), email_address: z.string().optional(), legal_entity: z.nullable(z.lazy(() => PartyLegalEntity$inboundSchema)) .optional(), legal_natural_person: z.nullable( z.lazy(() => PartyLegalNaturalPerson$inboundSchema), ).optional(), mailing_address: z.nullable(z.lazy(() => PartyMailingAddress$inboundSchema)) .optional(), name: z.string().optional(), party_id: z.string().optional(), phone_number: z.nullable(z.lazy(() => PartyPhoneNumber$inboundSchema)) .optional(), prospectus_delivery_preference: PartyProspectusDeliveryPreference$inboundSchema.optional(), proxy_delivery_preference: PartyProxyDeliveryPreference$inboundSchema .optional(), relation_type: PartyRelationType$inboundSchema.optional(), statement_delivery_preference: PartyStatementDeliveryPreference$inboundSchema.optional(), tax_document_delivery_preference: PartyTaxDocumentDeliveryPreference$inboundSchema.optional(), trade_confirmation_delivery_preference: PartyTradeConfirmationDeliveryPreference$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "cftc_document_delivery_preference": "cftcDocumentDeliveryPreference", "email_address": "emailAddress", "legal_entity": "legalEntity", "legal_natural_person": "legalNaturalPerson", "mailing_address": "mailingAddress", "party_id": "partyId", "phone_number": "phoneNumber", "prospectus_delivery_preference": "prospectusDeliveryPreference", "proxy_delivery_preference": "proxyDeliveryPreference", "relation_type": "relationType", "statement_delivery_preference": "statementDeliveryPreference", "tax_document_delivery_preference": "taxDocumentDeliveryPreference", "trade_confirmation_delivery_preference": "tradeConfirmationDeliveryPreference", }); }); /** @internal */ export type Party$Outbound = { cftc_document_delivery_preference?: string | undefined; email_address?: string | undefined; legal_entity?: PartyLegalEntity$Outbound | null | undefined; legal_natural_person?: PartyLegalNaturalPerson$Outbound | null | undefined; mailing_address?: PartyMailingAddress$Outbound | null | undefined; name?: string | undefined; party_id?: string | undefined; phone_number?: PartyPhoneNumber$Outbound | null | undefined; prospectus_delivery_preference?: string | undefined; proxy_delivery_preference?: string | undefined; relation_type?: string | undefined; statement_delivery_preference?: string | undefined; tax_document_delivery_preference?: string | undefined; trade_confirmation_delivery_preference?: string | undefined; }; /** @internal */ export const Party$outboundSchema: z.ZodType< Party$Outbound, z.ZodTypeDef, Party > = z.object({ cftcDocumentDeliveryPreference: PartyCftcDocumentDeliveryPreference$outboundSchema.optional(), emailAddress: z.string().optional(), legalEntity: z.nullable(z.lazy(() => PartyLegalEntity$outboundSchema)) .optional(), legalNaturalPerson: z.nullable( z.lazy(() => PartyLegalNaturalPerson$outboundSchema), ).optional(), mailingAddress: z.nullable(z.lazy(() => PartyMailingAddress$outboundSchema)) .optional(), name: z.string().optional(), partyId: z.string().optional(), phoneNumber: z.nullable(z.lazy(() => PartyPhoneNumber$outboundSchema)) .optional(), prospectusDeliveryPreference: PartyProspectusDeliveryPreference$outboundSchema .optional(), proxyDeliveryPreference: PartyProxyDeliveryPreference$outboundSchema .optional(), relationType: PartyRelationType$outboundSchema.optional(), statementDeliveryPreference: PartyStatementDeliveryPreference$outboundSchema .optional(), taxDocumentDeliveryPreference: PartyTaxDocumentDeliveryPreference$outboundSchema.optional(), tradeConfirmationDeliveryPreference: PartyTradeConfirmationDeliveryPreference$outboundSchema.optional(), }).transform((v) => { return remap$(v, { cftcDocumentDeliveryPreference: "cftc_document_delivery_preference", emailAddress: "email_address", legalEntity: "legal_entity", legalNaturalPerson: "legal_natural_person", mailingAddress: "mailing_address", partyId: "party_id", phoneNumber: "phone_number", prospectusDeliveryPreference: "prospectus_delivery_preference", proxyDeliveryPreference: "proxy_delivery_preference", relationType: "relation_type", statementDeliveryPreference: "statement_delivery_preference", taxDocumentDeliveryPreference: "tax_document_delivery_preference", tradeConfirmationDeliveryPreference: "trade_confirmation_delivery_preference", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Party$ { /** @deprecated use `Party$inboundSchema` instead. */ export const inboundSchema = Party$inboundSchema; /** @deprecated use `Party$outboundSchema` instead. */ export const outboundSchema = Party$outboundSchema; /** @deprecated use `Party$Outbound` instead. */ export type Outbound = Party$Outbound; } export function partyToJSON(party: Party): string { return JSON.stringify(Party$outboundSchema.parse(party)); } export function partyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Party$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Party' from JSON`, ); }