/* * 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"; /** * The legal day, month, and year of birth for a natural person. */ export type BirthDate = { /** * 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 DeathDate = { /** * 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 EmployerAddress = { /** * 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 LegalNaturalPersonEmploymentStatus { 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 LegalNaturalPersonEmploymentStatusOpen = OpenEnum< typeof LegalNaturalPersonEmploymentStatus >; /** * Object containing information pertaining to a investor's current employer including the name, address, and duration of employment. */ export type Employment = { /** * 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?: EmployerAddress | 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?: LegalNaturalPersonEmploymentStatusOpen | 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 ExpirationDate = { /** * 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 IssueDate = { /** * 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 LegalNaturalPersonType { IdentificationTypeUnspecified = "IDENTIFICATION_TYPE_UNSPECIFIED", Passport = "PASSPORT", NationalId = "NATIONAL_ID", DriversLicense = "DRIVERS_LICENSE", } /** * Identification type */ export type LegalNaturalPersonTypeOpen = OpenEnum< typeof LegalNaturalPersonType >; /** * **Field Dependencies:** * * @remarks * * Required if `irs_form_type` is `W_8BEN`. * * Otherwise, must be empty. */ export type ForeignIdentification = { /** * Identification expiration date */ expirationDate?: ExpirationDate | null | undefined; /** * Denotes if the identification is a tax id or other */ ftin?: boolean | undefined; /** * Identification number */ identificationNumber?: string | undefined; /** * Identification issue date */ issueDate?: IssueDate | null | undefined; /** * Region of issuance must be provided as a two-character CLDR country code */ issuingRegionCode?: string | undefined; /** * Identification type */ type?: LegalNaturalPersonTypeOpen | undefined; }; /** * The datetime external identity verification results were run on a natural person */ export type ExecutionDate = { /** * 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 LegalNaturalPersonIdentityVerificationResult = { /** * 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?: ExecutionDate | 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 LegalNaturalPersonEffectiveDate = { /** * 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 LegalNaturalPersonLargeTrader = { /** * 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?: LegalNaturalPersonEffectiveDate | 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 LegalNaturalPersonMaritalStatus { 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 LegalNaturalPersonMaritalStatusOpen = OpenEnum< typeof LegalNaturalPersonMaritalStatus >; /** * 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 LegalNaturalPersonNameSuffix { 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 LegalNaturalPersonNameSuffixOpen = OpenEnum< typeof LegalNaturalPersonNameSuffix >; /** * Customer Referral Source */ export type CustomerReferralSource = { /** * 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 NegativeNews = { /** * 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 OtherSourcesOfWealth = { /** * 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 NaturalPersonFdd = { /** * Customer Non-referral Source */ customerNonReferralSource?: string | undefined; /** * Customer Referral Source */ customerReferralSource?: CustomerReferralSource | 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?: NegativeNews | null | undefined; /** * The applicant's other source of wealth */ otherSourcesOfWealth?: OtherSourcesOfWealth | null | undefined; }; export enum LegalNaturalPersonResidencyStatus { ResidencyStatusUnspecified = "RESIDENCY_STATUS_UNSPECIFIED", UsPermanentResident = "US_PERMANENT_RESIDENT", UsTemporaryResident = "US_TEMPORARY_RESIDENT", UsNonResident = "US_NON_RESIDENT", } export type LegalNaturalPersonResidencyStatusOpen = OpenEnum< typeof LegalNaturalPersonResidencyStatus >; /** * Facilitates non-citizen lawful US residents to open domestic accounts */ export type NonCitizenResidency = { residencyStatus?: LegalNaturalPersonResidencyStatusOpen | 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 PersonalAddress = { /** * 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 LegalNaturalPersonTaxIdType { 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 LegalNaturalPersonTaxIdTypeOpen = OpenEnum< typeof LegalNaturalPersonTaxIdType >; /** * C Notice date. */ export type CNoticeDate = { /** * 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 LegalNaturalPersonFederalTaxClassification { 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 LegalNaturalPersonFederalTaxClassificationOpen = OpenEnum< typeof LegalNaturalPersonFederalTaxClassification >; /** * Initial B Notice date. */ export type FirstBNoticeDate = { /** * 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 LegalNaturalPersonIrsFormType { IrsFormTypeUnspecified = "IRS_FORM_TYPE_UNSPECIFIED", W9 = "W_9", W8Ben = "W_8BEN", } /** * IRS form type. */ export type LegalNaturalPersonIrsFormTypeOpen = OpenEnum< typeof LegalNaturalPersonIrsFormType >; /** * Tax reporting eligibility. */ export enum ReportingEligibility { TaxReportingEligibilityUnspecified = "TAX_REPORTING_ELIGIBILITY_UNSPECIFIED", Eligible = "ELIGIBLE", Ineligible = "INELIGIBLE", } /** * Tax reporting eligibility. */ export type ReportingEligibilityOpen = OpenEnum; /** * Tax Certification date. */ export type TaxCertificationDate = { /** * 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 TaxpayerCertificationState { TaxpayerCertificationStateUnspecified = "TAXPAYER_CERTIFICATION_STATE_UNSPECIFIED", Certified = "CERTIFIED", Uncertified = "UNCERTIFIED", PendingCertification = "PENDING_CERTIFICATION", } /** * Taxpayer certification status. */ export type TaxpayerCertificationStateOpen = OpenEnum< typeof TaxpayerCertificationState >; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export enum LegalNaturalPersonUsTinStatus { UsTinStatusUnspecified = "US_TIN_STATUS_UNSPECIFIED", Passing = "PASSING", Failing = "FAILING", } /** * United States Individual Taxpayer Identification Number (ITIN) status. */ export type LegalNaturalPersonUsTinStatusOpen = OpenEnum< typeof LegalNaturalPersonUsTinStatus >; /** * B/C Notice status. */ export enum LegalNaturalPersonWithholdingState { 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 LegalNaturalPersonWithholdingStateOpen = OpenEnum< typeof LegalNaturalPersonWithholdingState >; /** * 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 TaxProfile = { /** * C Notice date. */ cNoticeDate?: CNoticeDate | null | undefined; /** * Federal tax classification. */ federalTaxClassification?: | LegalNaturalPersonFederalTaxClassificationOpen | undefined; /** * Initial B Notice date. */ firstBNoticeDate?: FirstBNoticeDate | null | undefined; /** * IRS form type. */ irsFormType?: LegalNaturalPersonIrsFormTypeOpen | 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?: ReportingEligibilityOpen | undefined; /** * Tax Certification date. */ taxCertificationDate?: TaxCertificationDate | null | undefined; /** * Taxpayer certification status. */ taxpayerCertificationState?: TaxpayerCertificationStateOpen | undefined; /** * United States Individual Taxpayer Identification Number (ITIN) status. */ usTinStatus?: LegalNaturalPersonUsTinStatusOpen | undefined; /** * B/C Notice status. */ withholdingState?: LegalNaturalPersonWithholdingStateOpen | undefined; }; /** * A legal natural person. This represents the full set of data for an individual. A Customer Identification Program (CIP) may be run on legal natural persons. */ export type LegalNaturalPerson = { /** * 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?: BirthDate | 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?: DeathDate | 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?: Employment | 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?: ForeignIdentification | 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?: | LegalNaturalPersonIdentityVerificationResult | 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?: LegalNaturalPersonLargeTrader | 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?: LegalNaturalPersonMaritalStatusOpen | 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?: LegalNaturalPersonNameSuffixOpen | undefined; /** * Foreign Due Diligence (FDD) information for Legal Natural Person */ naturalPersonFdd?: NaturalPersonFdd | null | undefined; /** * Facilitates non-citizen lawful US residents to open domestic accounts */ nonCitizenResidency?: NonCitizenResidency | 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?: PersonalAddress | 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?: LegalNaturalPersonTaxIdTypeOpen | 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?: TaxProfile | null | undefined; }; /** @internal */ export const BirthDate$inboundSchema: z.ZodType< BirthDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type BirthDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const BirthDate$outboundSchema: z.ZodType< BirthDate$Outbound, z.ZodTypeDef, BirthDate > = 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 BirthDate$ { /** @deprecated use `BirthDate$inboundSchema` instead. */ export const inboundSchema = BirthDate$inboundSchema; /** @deprecated use `BirthDate$outboundSchema` instead. */ export const outboundSchema = BirthDate$outboundSchema; /** @deprecated use `BirthDate$Outbound` instead. */ export type Outbound = BirthDate$Outbound; } export function birthDateToJSON(birthDate: BirthDate): string { return JSON.stringify(BirthDate$outboundSchema.parse(birthDate)); } export function birthDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BirthDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BirthDate' from JSON`, ); } /** @internal */ export const DeathDate$inboundSchema: z.ZodType< DeathDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type DeathDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const DeathDate$outboundSchema: z.ZodType< DeathDate$Outbound, z.ZodTypeDef, DeathDate > = 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 DeathDate$ { /** @deprecated use `DeathDate$inboundSchema` instead. */ export const inboundSchema = DeathDate$inboundSchema; /** @deprecated use `DeathDate$outboundSchema` instead. */ export const outboundSchema = DeathDate$outboundSchema; /** @deprecated use `DeathDate$Outbound` instead. */ export type Outbound = DeathDate$Outbound; } export function deathDateToJSON(deathDate: DeathDate): string { return JSON.stringify(DeathDate$outboundSchema.parse(deathDate)); } export function deathDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeathDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeathDate' from JSON`, ); } /** @internal */ export const EmployerAddress$inboundSchema: z.ZodType< EmployerAddress, 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 EmployerAddress$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 EmployerAddress$outboundSchema: z.ZodType< EmployerAddress$Outbound, z.ZodTypeDef, EmployerAddress > = 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 EmployerAddress$ { /** @deprecated use `EmployerAddress$inboundSchema` instead. */ export const inboundSchema = EmployerAddress$inboundSchema; /** @deprecated use `EmployerAddress$outboundSchema` instead. */ export const outboundSchema = EmployerAddress$outboundSchema; /** @deprecated use `EmployerAddress$Outbound` instead. */ export type Outbound = EmployerAddress$Outbound; } export function employerAddressToJSON( employerAddress: EmployerAddress, ): string { return JSON.stringify(EmployerAddress$outboundSchema.parse(employerAddress)); } export function employerAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployerAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployerAddress' from JSON`, ); } /** @internal */ export const LegalNaturalPersonEmploymentStatus$inboundSchema: z.ZodType< LegalNaturalPersonEmploymentStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonEmploymentStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonEmploymentStatus$outboundSchema: z.ZodType< LegalNaturalPersonEmploymentStatusOpen, z.ZodTypeDef, LegalNaturalPersonEmploymentStatusOpen > = z.union([ z.nativeEnum(LegalNaturalPersonEmploymentStatus), 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 LegalNaturalPersonEmploymentStatus$ { /** @deprecated use `LegalNaturalPersonEmploymentStatus$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonEmploymentStatus$inboundSchema; /** @deprecated use `LegalNaturalPersonEmploymentStatus$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonEmploymentStatus$outboundSchema; } /** @internal */ export const Employment$inboundSchema: z.ZodType< Employment, z.ZodTypeDef, unknown > = z.object({ employer: z.string().optional(), employer_address: z.nullable(z.lazy(() => EmployerAddress$inboundSchema)) .optional(), employment_id: z.string().optional(), employment_status: LegalNaturalPersonEmploymentStatus$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 Employment$Outbound = { employer?: string | undefined; employer_address?: EmployerAddress$Outbound | null | undefined; employment_id?: string | undefined; employment_status?: string | undefined; occupation?: string | undefined; start_year?: number | undefined; }; /** @internal */ export const Employment$outboundSchema: z.ZodType< Employment$Outbound, z.ZodTypeDef, Employment > = z.object({ employer: z.string().optional(), employerAddress: z.nullable(z.lazy(() => EmployerAddress$outboundSchema)) .optional(), employmentId: z.string().optional(), employmentStatus: LegalNaturalPersonEmploymentStatus$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 Employment$ { /** @deprecated use `Employment$inboundSchema` instead. */ export const inboundSchema = Employment$inboundSchema; /** @deprecated use `Employment$outboundSchema` instead. */ export const outboundSchema = Employment$outboundSchema; /** @deprecated use `Employment$Outbound` instead. */ export type Outbound = Employment$Outbound; } export function employmentToJSON(employment: Employment): string { return JSON.stringify(Employment$outboundSchema.parse(employment)); } export function employmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Employment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Employment' from JSON`, ); } /** @internal */ export const ExpirationDate$inboundSchema: z.ZodType< ExpirationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type ExpirationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const ExpirationDate$outboundSchema: z.ZodType< ExpirationDate$Outbound, z.ZodTypeDef, ExpirationDate > = 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 ExpirationDate$ { /** @deprecated use `ExpirationDate$inboundSchema` instead. */ export const inboundSchema = ExpirationDate$inboundSchema; /** @deprecated use `ExpirationDate$outboundSchema` instead. */ export const outboundSchema = ExpirationDate$outboundSchema; /** @deprecated use `ExpirationDate$Outbound` instead. */ export type Outbound = ExpirationDate$Outbound; } export function expirationDateToJSON(expirationDate: ExpirationDate): string { return JSON.stringify(ExpirationDate$outboundSchema.parse(expirationDate)); } export function expirationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExpirationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExpirationDate' from JSON`, ); } /** @internal */ export const IssueDate$inboundSchema: z.ZodType< IssueDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type IssueDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const IssueDate$outboundSchema: z.ZodType< IssueDate$Outbound, z.ZodTypeDef, IssueDate > = 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 IssueDate$ { /** @deprecated use `IssueDate$inboundSchema` instead. */ export const inboundSchema = IssueDate$inboundSchema; /** @deprecated use `IssueDate$outboundSchema` instead. */ export const outboundSchema = IssueDate$outboundSchema; /** @deprecated use `IssueDate$Outbound` instead. */ export type Outbound = IssueDate$Outbound; } export function issueDateToJSON(issueDate: IssueDate): string { return JSON.stringify(IssueDate$outboundSchema.parse(issueDate)); } export function issueDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IssueDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IssueDate' from JSON`, ); } /** @internal */ export const LegalNaturalPersonType$inboundSchema: z.ZodType< LegalNaturalPersonTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonType$outboundSchema: z.ZodType< LegalNaturalPersonTypeOpen, z.ZodTypeDef, LegalNaturalPersonTypeOpen > = z.union([ z.nativeEnum(LegalNaturalPersonType), 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 LegalNaturalPersonType$ { /** @deprecated use `LegalNaturalPersonType$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonType$inboundSchema; /** @deprecated use `LegalNaturalPersonType$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonType$outboundSchema; } /** @internal */ export const ForeignIdentification$inboundSchema: z.ZodType< ForeignIdentification, z.ZodTypeDef, unknown > = z.object({ expiration_date: z.nullable(z.lazy(() => ExpirationDate$inboundSchema)) .optional(), ftin: z.boolean().optional(), identification_number: z.string().optional(), issue_date: z.nullable(z.lazy(() => IssueDate$inboundSchema)).optional(), issuing_region_code: z.string().optional(), type: LegalNaturalPersonType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "expiration_date": "expirationDate", "identification_number": "identificationNumber", "issue_date": "issueDate", "issuing_region_code": "issuingRegionCode", }); }); /** @internal */ export type ForeignIdentification$Outbound = { expiration_date?: ExpirationDate$Outbound | null | undefined; ftin?: boolean | undefined; identification_number?: string | undefined; issue_date?: IssueDate$Outbound | null | undefined; issuing_region_code?: string | undefined; type?: string | undefined; }; /** @internal */ export const ForeignIdentification$outboundSchema: z.ZodType< ForeignIdentification$Outbound, z.ZodTypeDef, ForeignIdentification > = z.object({ expirationDate: z.nullable(z.lazy(() => ExpirationDate$outboundSchema)) .optional(), ftin: z.boolean().optional(), identificationNumber: z.string().optional(), issueDate: z.nullable(z.lazy(() => IssueDate$outboundSchema)).optional(), issuingRegionCode: z.string().optional(), type: LegalNaturalPersonType$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 ForeignIdentification$ { /** @deprecated use `ForeignIdentification$inboundSchema` instead. */ export const inboundSchema = ForeignIdentification$inboundSchema; /** @deprecated use `ForeignIdentification$outboundSchema` instead. */ export const outboundSchema = ForeignIdentification$outboundSchema; /** @deprecated use `ForeignIdentification$Outbound` instead. */ export type Outbound = ForeignIdentification$Outbound; } export function foreignIdentificationToJSON( foreignIdentification: ForeignIdentification, ): string { return JSON.stringify( ForeignIdentification$outboundSchema.parse(foreignIdentification), ); } export function foreignIdentificationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ForeignIdentification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForeignIdentification' from JSON`, ); } /** @internal */ export const ExecutionDate$inboundSchema: z.ZodType< ExecutionDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type ExecutionDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const ExecutionDate$outboundSchema: z.ZodType< ExecutionDate$Outbound, z.ZodTypeDef, ExecutionDate > = 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 ExecutionDate$ { /** @deprecated use `ExecutionDate$inboundSchema` instead. */ export const inboundSchema = ExecutionDate$inboundSchema; /** @deprecated use `ExecutionDate$outboundSchema` instead. */ export const outboundSchema = ExecutionDate$outboundSchema; /** @deprecated use `ExecutionDate$Outbound` instead. */ export type Outbound = ExecutionDate$Outbound; } export function executionDateToJSON(executionDate: ExecutionDate): string { return JSON.stringify(ExecutionDate$outboundSchema.parse(executionDate)); } export function executionDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExecutionDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExecutionDate' from JSON`, ); } /** @internal */ export const LegalNaturalPersonIdentityVerificationResult$inboundSchema: z.ZodType< LegalNaturalPersonIdentityVerificationResult, z.ZodTypeDef, unknown > = z.object({ address_verified: z.boolean().optional(), birth_date_verified: z.boolean().optional(), execution_date: z.nullable(z.lazy(() => ExecutionDate$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 LegalNaturalPersonIdentityVerificationResult$Outbound = { address_verified?: boolean | undefined; birth_date_verified?: boolean | undefined; execution_date?: ExecutionDate$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 LegalNaturalPersonIdentityVerificationResult$outboundSchema: z.ZodType< LegalNaturalPersonIdentityVerificationResult$Outbound, z.ZodTypeDef, LegalNaturalPersonIdentityVerificationResult > = z.object({ addressVerified: z.boolean().optional(), birthDateVerified: z.boolean().optional(), executionDate: z.nullable(z.lazy(() => ExecutionDate$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 LegalNaturalPersonIdentityVerificationResult$ { /** @deprecated use `LegalNaturalPersonIdentityVerificationResult$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonIdentityVerificationResult$inboundSchema; /** @deprecated use `LegalNaturalPersonIdentityVerificationResult$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonIdentityVerificationResult$outboundSchema; /** @deprecated use `LegalNaturalPersonIdentityVerificationResult$Outbound` instead. */ export type Outbound = LegalNaturalPersonIdentityVerificationResult$Outbound; } export function legalNaturalPersonIdentityVerificationResultToJSON( legalNaturalPersonIdentityVerificationResult: LegalNaturalPersonIdentityVerificationResult, ): string { return JSON.stringify( LegalNaturalPersonIdentityVerificationResult$outboundSchema.parse( legalNaturalPersonIdentityVerificationResult, ), ); } export function legalNaturalPersonIdentityVerificationResultFromJSON( jsonString: string, ): SafeParseResult< LegalNaturalPersonIdentityVerificationResult, SDKValidationError > { return safeParse( jsonString, (x) => LegalNaturalPersonIdentityVerificationResult$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'LegalNaturalPersonIdentityVerificationResult' from JSON`, ); } /** @internal */ export const LegalNaturalPersonEffectiveDate$inboundSchema: z.ZodType< LegalNaturalPersonEffectiveDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type LegalNaturalPersonEffectiveDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const LegalNaturalPersonEffectiveDate$outboundSchema: z.ZodType< LegalNaturalPersonEffectiveDate$Outbound, z.ZodTypeDef, LegalNaturalPersonEffectiveDate > = 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 LegalNaturalPersonEffectiveDate$ { /** @deprecated use `LegalNaturalPersonEffectiveDate$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonEffectiveDate$inboundSchema; /** @deprecated use `LegalNaturalPersonEffectiveDate$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonEffectiveDate$outboundSchema; /** @deprecated use `LegalNaturalPersonEffectiveDate$Outbound` instead. */ export type Outbound = LegalNaturalPersonEffectiveDate$Outbound; } export function legalNaturalPersonEffectiveDateToJSON( legalNaturalPersonEffectiveDate: LegalNaturalPersonEffectiveDate, ): string { return JSON.stringify( LegalNaturalPersonEffectiveDate$outboundSchema.parse( legalNaturalPersonEffectiveDate, ), ); } export function legalNaturalPersonEffectiveDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalNaturalPersonEffectiveDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalNaturalPersonEffectiveDate' from JSON`, ); } /** @internal */ export const LegalNaturalPersonLargeTrader$inboundSchema: z.ZodType< LegalNaturalPersonLargeTrader, z.ZodTypeDef, unknown > = z.object({ effective_date: z.nullable( z.lazy(() => LegalNaturalPersonEffectiveDate$inboundSchema), ).optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type LegalNaturalPersonLargeTrader$Outbound = { effective_date?: LegalNaturalPersonEffectiveDate$Outbound | null | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const LegalNaturalPersonLargeTrader$outboundSchema: z.ZodType< LegalNaturalPersonLargeTrader$Outbound, z.ZodTypeDef, LegalNaturalPersonLargeTrader > = z.object({ effectiveDate: z.nullable( z.lazy(() => LegalNaturalPersonEffectiveDate$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 LegalNaturalPersonLargeTrader$ { /** @deprecated use `LegalNaturalPersonLargeTrader$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonLargeTrader$inboundSchema; /** @deprecated use `LegalNaturalPersonLargeTrader$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonLargeTrader$outboundSchema; /** @deprecated use `LegalNaturalPersonLargeTrader$Outbound` instead. */ export type Outbound = LegalNaturalPersonLargeTrader$Outbound; } export function legalNaturalPersonLargeTraderToJSON( legalNaturalPersonLargeTrader: LegalNaturalPersonLargeTrader, ): string { return JSON.stringify( LegalNaturalPersonLargeTrader$outboundSchema.parse( legalNaturalPersonLargeTrader, ), ); } export function legalNaturalPersonLargeTraderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalNaturalPersonLargeTrader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalNaturalPersonLargeTrader' from JSON`, ); } /** @internal */ export const LegalNaturalPersonMaritalStatus$inboundSchema: z.ZodType< LegalNaturalPersonMaritalStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonMaritalStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonMaritalStatus$outboundSchema: z.ZodType< LegalNaturalPersonMaritalStatusOpen, z.ZodTypeDef, LegalNaturalPersonMaritalStatusOpen > = z.union([ z.nativeEnum(LegalNaturalPersonMaritalStatus), 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 LegalNaturalPersonMaritalStatus$ { /** @deprecated use `LegalNaturalPersonMaritalStatus$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonMaritalStatus$inboundSchema; /** @deprecated use `LegalNaturalPersonMaritalStatus$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonMaritalStatus$outboundSchema; } /** @internal */ export const LegalNaturalPersonNameSuffix$inboundSchema: z.ZodType< LegalNaturalPersonNameSuffixOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonNameSuffix), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonNameSuffix$outboundSchema: z.ZodType< LegalNaturalPersonNameSuffixOpen, z.ZodTypeDef, LegalNaturalPersonNameSuffixOpen > = z.union([ z.nativeEnum(LegalNaturalPersonNameSuffix), 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 LegalNaturalPersonNameSuffix$ { /** @deprecated use `LegalNaturalPersonNameSuffix$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonNameSuffix$inboundSchema; /** @deprecated use `LegalNaturalPersonNameSuffix$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonNameSuffix$outboundSchema; } /** @internal */ export const CustomerReferralSource$inboundSchema: z.ZodType< CustomerReferralSource, 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 CustomerReferralSource$Outbound = { name?: string | undefined; relationship_to_applicant?: string | undefined; relationship_years_with_applicant?: number | undefined; relationship_years_with_broker?: number | undefined; }; /** @internal */ export const CustomerReferralSource$outboundSchema: z.ZodType< CustomerReferralSource$Outbound, z.ZodTypeDef, CustomerReferralSource > = 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 CustomerReferralSource$ { /** @deprecated use `CustomerReferralSource$inboundSchema` instead. */ export const inboundSchema = CustomerReferralSource$inboundSchema; /** @deprecated use `CustomerReferralSource$outboundSchema` instead. */ export const outboundSchema = CustomerReferralSource$outboundSchema; /** @deprecated use `CustomerReferralSource$Outbound` instead. */ export type Outbound = CustomerReferralSource$Outbound; } export function customerReferralSourceToJSON( customerReferralSource: CustomerReferralSource, ): string { return JSON.stringify( CustomerReferralSource$outboundSchema.parse(customerReferralSource), ); } export function customerReferralSourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomerReferralSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomerReferralSource' from JSON`, ); } /** @internal */ export const NegativeNews$inboundSchema: z.ZodType< NegativeNews, 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 NegativeNews$Outbound = { negative_news_against_related_parties?: boolean | undefined; negative_news_against_related_parties_description?: string | undefined; }; /** @internal */ export const NegativeNews$outboundSchema: z.ZodType< NegativeNews$Outbound, z.ZodTypeDef, NegativeNews > = 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 NegativeNews$ { /** @deprecated use `NegativeNews$inboundSchema` instead. */ export const inboundSchema = NegativeNews$inboundSchema; /** @deprecated use `NegativeNews$outboundSchema` instead. */ export const outboundSchema = NegativeNews$outboundSchema; /** @deprecated use `NegativeNews$Outbound` instead. */ export type Outbound = NegativeNews$Outbound; } export function negativeNewsToJSON(negativeNews: NegativeNews): string { return JSON.stringify(NegativeNews$outboundSchema.parse(negativeNews)); } export function negativeNewsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NegativeNews$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NegativeNews' from JSON`, ); } /** @internal */ export const OtherSourcesOfWealth$inboundSchema: z.ZodType< OtherSourcesOfWealth, 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 OtherSourcesOfWealth$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 OtherSourcesOfWealth$outboundSchema: z.ZodType< OtherSourcesOfWealth$Outbound, z.ZodTypeDef, OtherSourcesOfWealth > = 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 OtherSourcesOfWealth$ { /** @deprecated use `OtherSourcesOfWealth$inboundSchema` instead. */ export const inboundSchema = OtherSourcesOfWealth$inboundSchema; /** @deprecated use `OtherSourcesOfWealth$outboundSchema` instead. */ export const outboundSchema = OtherSourcesOfWealth$outboundSchema; /** @deprecated use `OtherSourcesOfWealth$Outbound` instead. */ export type Outbound = OtherSourcesOfWealth$Outbound; } export function otherSourcesOfWealthToJSON( otherSourcesOfWealth: OtherSourcesOfWealth, ): string { return JSON.stringify( OtherSourcesOfWealth$outboundSchema.parse(otherSourcesOfWealth), ); } export function otherSourcesOfWealthFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OtherSourcesOfWealth$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OtherSourcesOfWealth' from JSON`, ); } /** @internal */ export const NaturalPersonFdd$inboundSchema: z.ZodType< NaturalPersonFdd, z.ZodTypeDef, unknown > = z.object({ customer_non_referral_source: z.string().optional(), customer_referral_source: z.nullable( z.lazy(() => CustomerReferralSource$inboundSchema), ).optional(), employment_and_employer_description: z.string().optional(), negative_news: z.nullable(z.lazy(() => NegativeNews$inboundSchema)) .optional(), other_sources_of_wealth: z.nullable( z.lazy(() => OtherSourcesOfWealth$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 NaturalPersonFdd$Outbound = { customer_non_referral_source?: string | undefined; customer_referral_source?: CustomerReferralSource$Outbound | null | undefined; employment_and_employer_description?: string | undefined; negative_news?: NegativeNews$Outbound | null | undefined; other_sources_of_wealth?: OtherSourcesOfWealth$Outbound | null | undefined; }; /** @internal */ export const NaturalPersonFdd$outboundSchema: z.ZodType< NaturalPersonFdd$Outbound, z.ZodTypeDef, NaturalPersonFdd > = z.object({ customerNonReferralSource: z.string().optional(), customerReferralSource: z.nullable( z.lazy(() => CustomerReferralSource$outboundSchema), ).optional(), employmentAndEmployerDescription: z.string().optional(), negativeNews: z.nullable(z.lazy(() => NegativeNews$outboundSchema)) .optional(), otherSourcesOfWealth: z.nullable( z.lazy(() => OtherSourcesOfWealth$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 NaturalPersonFdd$ { /** @deprecated use `NaturalPersonFdd$inboundSchema` instead. */ export const inboundSchema = NaturalPersonFdd$inboundSchema; /** @deprecated use `NaturalPersonFdd$outboundSchema` instead. */ export const outboundSchema = NaturalPersonFdd$outboundSchema; /** @deprecated use `NaturalPersonFdd$Outbound` instead. */ export type Outbound = NaturalPersonFdd$Outbound; } export function naturalPersonFddToJSON( naturalPersonFdd: NaturalPersonFdd, ): string { return JSON.stringify( NaturalPersonFdd$outboundSchema.parse(naturalPersonFdd), ); } export function naturalPersonFddFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NaturalPersonFdd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NaturalPersonFdd' from JSON`, ); } /** @internal */ export const LegalNaturalPersonResidencyStatus$inboundSchema: z.ZodType< LegalNaturalPersonResidencyStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonResidencyStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonResidencyStatus$outboundSchema: z.ZodType< LegalNaturalPersonResidencyStatusOpen, z.ZodTypeDef, LegalNaturalPersonResidencyStatusOpen > = z.union([ z.nativeEnum(LegalNaturalPersonResidencyStatus), 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 LegalNaturalPersonResidencyStatus$ { /** @deprecated use `LegalNaturalPersonResidencyStatus$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonResidencyStatus$inboundSchema; /** @deprecated use `LegalNaturalPersonResidencyStatus$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonResidencyStatus$outboundSchema; } /** @internal */ export const NonCitizenResidency$inboundSchema: z.ZodType< NonCitizenResidency, z.ZodTypeDef, unknown > = z.object({ residency_status: LegalNaturalPersonResidencyStatus$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "residency_status": "residencyStatus", }); }); /** @internal */ export type NonCitizenResidency$Outbound = { residency_status?: string | undefined; }; /** @internal */ export const NonCitizenResidency$outboundSchema: z.ZodType< NonCitizenResidency$Outbound, z.ZodTypeDef, NonCitizenResidency > = z.object({ residencyStatus: LegalNaturalPersonResidencyStatus$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 NonCitizenResidency$ { /** @deprecated use `NonCitizenResidency$inboundSchema` instead. */ export const inboundSchema = NonCitizenResidency$inboundSchema; /** @deprecated use `NonCitizenResidency$outboundSchema` instead. */ export const outboundSchema = NonCitizenResidency$outboundSchema; /** @deprecated use `NonCitizenResidency$Outbound` instead. */ export type Outbound = NonCitizenResidency$Outbound; } export function nonCitizenResidencyToJSON( nonCitizenResidency: NonCitizenResidency, ): string { return JSON.stringify( NonCitizenResidency$outboundSchema.parse(nonCitizenResidency), ); } export function nonCitizenResidencyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NonCitizenResidency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NonCitizenResidency' from JSON`, ); } /** @internal */ export const PersonalAddress$inboundSchema: z.ZodType< PersonalAddress, 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 PersonalAddress$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 PersonalAddress$outboundSchema: z.ZodType< PersonalAddress$Outbound, z.ZodTypeDef, PersonalAddress > = 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 PersonalAddress$ { /** @deprecated use `PersonalAddress$inboundSchema` instead. */ export const inboundSchema = PersonalAddress$inboundSchema; /** @deprecated use `PersonalAddress$outboundSchema` instead. */ export const outboundSchema = PersonalAddress$outboundSchema; /** @deprecated use `PersonalAddress$Outbound` instead. */ export type Outbound = PersonalAddress$Outbound; } export function personalAddressToJSON( personalAddress: PersonalAddress, ): string { return JSON.stringify(PersonalAddress$outboundSchema.parse(personalAddress)); } export function personalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PersonalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PersonalAddress' from JSON`, ); } /** @internal */ export const LegalNaturalPersonTaxIdType$inboundSchema: z.ZodType< LegalNaturalPersonTaxIdTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonTaxIdType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonTaxIdType$outboundSchema: z.ZodType< LegalNaturalPersonTaxIdTypeOpen, z.ZodTypeDef, LegalNaturalPersonTaxIdTypeOpen > = z.union([ z.nativeEnum(LegalNaturalPersonTaxIdType), 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 LegalNaturalPersonTaxIdType$ { /** @deprecated use `LegalNaturalPersonTaxIdType$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonTaxIdType$inboundSchema; /** @deprecated use `LegalNaturalPersonTaxIdType$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonTaxIdType$outboundSchema; } /** @internal */ export const CNoticeDate$inboundSchema: z.ZodType< CNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type CNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const CNoticeDate$outboundSchema: z.ZodType< CNoticeDate$Outbound, z.ZodTypeDef, CNoticeDate > = 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 CNoticeDate$ { /** @deprecated use `CNoticeDate$inboundSchema` instead. */ export const inboundSchema = CNoticeDate$inboundSchema; /** @deprecated use `CNoticeDate$outboundSchema` instead. */ export const outboundSchema = CNoticeDate$outboundSchema; /** @deprecated use `CNoticeDate$Outbound` instead. */ export type Outbound = CNoticeDate$Outbound; } export function cNoticeDateToJSON(cNoticeDate: CNoticeDate): string { return JSON.stringify(CNoticeDate$outboundSchema.parse(cNoticeDate)); } export function cNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CNoticeDate' from JSON`, ); } /** @internal */ export const LegalNaturalPersonFederalTaxClassification$inboundSchema: z.ZodType< LegalNaturalPersonFederalTaxClassificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonFederalTaxClassification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonFederalTaxClassification$outboundSchema: z.ZodType< LegalNaturalPersonFederalTaxClassificationOpen, z.ZodTypeDef, LegalNaturalPersonFederalTaxClassificationOpen > = z.union([ z.nativeEnum(LegalNaturalPersonFederalTaxClassification), 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 LegalNaturalPersonFederalTaxClassification$ { /** @deprecated use `LegalNaturalPersonFederalTaxClassification$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonFederalTaxClassification$inboundSchema; /** @deprecated use `LegalNaturalPersonFederalTaxClassification$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonFederalTaxClassification$outboundSchema; } /** @internal */ export const FirstBNoticeDate$inboundSchema: z.ZodType< FirstBNoticeDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type FirstBNoticeDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const FirstBNoticeDate$outboundSchema: z.ZodType< FirstBNoticeDate$Outbound, z.ZodTypeDef, FirstBNoticeDate > = 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 FirstBNoticeDate$ { /** @deprecated use `FirstBNoticeDate$inboundSchema` instead. */ export const inboundSchema = FirstBNoticeDate$inboundSchema; /** @deprecated use `FirstBNoticeDate$outboundSchema` instead. */ export const outboundSchema = FirstBNoticeDate$outboundSchema; /** @deprecated use `FirstBNoticeDate$Outbound` instead. */ export type Outbound = FirstBNoticeDate$Outbound; } export function firstBNoticeDateToJSON( firstBNoticeDate: FirstBNoticeDate, ): string { return JSON.stringify( FirstBNoticeDate$outboundSchema.parse(firstBNoticeDate), ); } export function firstBNoticeDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FirstBNoticeDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FirstBNoticeDate' from JSON`, ); } /** @internal */ export const LegalNaturalPersonIrsFormType$inboundSchema: z.ZodType< LegalNaturalPersonIrsFormTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonIrsFormType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonIrsFormType$outboundSchema: z.ZodType< LegalNaturalPersonIrsFormTypeOpen, z.ZodTypeDef, LegalNaturalPersonIrsFormTypeOpen > = z.union([ z.nativeEnum(LegalNaturalPersonIrsFormType), 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 LegalNaturalPersonIrsFormType$ { /** @deprecated use `LegalNaturalPersonIrsFormType$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonIrsFormType$inboundSchema; /** @deprecated use `LegalNaturalPersonIrsFormType$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonIrsFormType$outboundSchema; } /** @internal */ export const ReportingEligibility$inboundSchema: z.ZodType< ReportingEligibilityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(ReportingEligibility), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const ReportingEligibility$outboundSchema: z.ZodType< ReportingEligibilityOpen, z.ZodTypeDef, ReportingEligibilityOpen > = z.union([ z.nativeEnum(ReportingEligibility), 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 ReportingEligibility$ { /** @deprecated use `ReportingEligibility$inboundSchema` instead. */ export const inboundSchema = ReportingEligibility$inboundSchema; /** @deprecated use `ReportingEligibility$outboundSchema` instead. */ export const outboundSchema = ReportingEligibility$outboundSchema; } /** @internal */ export const TaxCertificationDate$inboundSchema: z.ZodType< TaxCertificationDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type TaxCertificationDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const TaxCertificationDate$outboundSchema: z.ZodType< TaxCertificationDate$Outbound, z.ZodTypeDef, TaxCertificationDate > = 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 TaxCertificationDate$ { /** @deprecated use `TaxCertificationDate$inboundSchema` instead. */ export const inboundSchema = TaxCertificationDate$inboundSchema; /** @deprecated use `TaxCertificationDate$outboundSchema` instead. */ export const outboundSchema = TaxCertificationDate$outboundSchema; /** @deprecated use `TaxCertificationDate$Outbound` instead. */ export type Outbound = TaxCertificationDate$Outbound; } export function taxCertificationDateToJSON( taxCertificationDate: TaxCertificationDate, ): string { return JSON.stringify( TaxCertificationDate$outboundSchema.parse(taxCertificationDate), ); } export function taxCertificationDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxCertificationDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxCertificationDate' from JSON`, ); } /** @internal */ export const TaxpayerCertificationState$inboundSchema: z.ZodType< TaxpayerCertificationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TaxpayerCertificationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TaxpayerCertificationState$outboundSchema: z.ZodType< TaxpayerCertificationStateOpen, z.ZodTypeDef, TaxpayerCertificationStateOpen > = z.union([ z.nativeEnum(TaxpayerCertificationState), 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 TaxpayerCertificationState$ { /** @deprecated use `TaxpayerCertificationState$inboundSchema` instead. */ export const inboundSchema = TaxpayerCertificationState$inboundSchema; /** @deprecated use `TaxpayerCertificationState$outboundSchema` instead. */ export const outboundSchema = TaxpayerCertificationState$outboundSchema; } /** @internal */ export const LegalNaturalPersonUsTinStatus$inboundSchema: z.ZodType< LegalNaturalPersonUsTinStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonUsTinStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonUsTinStatus$outboundSchema: z.ZodType< LegalNaturalPersonUsTinStatusOpen, z.ZodTypeDef, LegalNaturalPersonUsTinStatusOpen > = z.union([ z.nativeEnum(LegalNaturalPersonUsTinStatus), 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 LegalNaturalPersonUsTinStatus$ { /** @deprecated use `LegalNaturalPersonUsTinStatus$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonUsTinStatus$inboundSchema; /** @deprecated use `LegalNaturalPersonUsTinStatus$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonUsTinStatus$outboundSchema; } /** @internal */ export const LegalNaturalPersonWithholdingState$inboundSchema: z.ZodType< LegalNaturalPersonWithholdingStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(LegalNaturalPersonWithholdingState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const LegalNaturalPersonWithholdingState$outboundSchema: z.ZodType< LegalNaturalPersonWithholdingStateOpen, z.ZodTypeDef, LegalNaturalPersonWithholdingStateOpen > = z.union([ z.nativeEnum(LegalNaturalPersonWithholdingState), 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 LegalNaturalPersonWithholdingState$ { /** @deprecated use `LegalNaturalPersonWithholdingState$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPersonWithholdingState$inboundSchema; /** @deprecated use `LegalNaturalPersonWithholdingState$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPersonWithholdingState$outboundSchema; } /** @internal */ export const TaxProfile$inboundSchema: z.ZodType< TaxProfile, z.ZodTypeDef, unknown > = z.object({ c_notice_date: z.nullable(z.lazy(() => CNoticeDate$inboundSchema)).optional(), federal_tax_classification: LegalNaturalPersonFederalTaxClassification$inboundSchema.optional(), first_b_notice_date: z.nullable(z.lazy(() => FirstBNoticeDate$inboundSchema)) .optional(), irs_form_type: LegalNaturalPersonIrsFormType$inboundSchema.optional(), legal_tax_region_code: z.string().optional(), reporting_eligibility: ReportingEligibility$inboundSchema.optional(), tax_certification_date: z.nullable( z.lazy(() => TaxCertificationDate$inboundSchema), ).optional(), taxpayer_certification_state: TaxpayerCertificationState$inboundSchema .optional(), us_tin_status: LegalNaturalPersonUsTinStatus$inboundSchema.optional(), withholding_state: LegalNaturalPersonWithholdingState$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 TaxProfile$Outbound = { c_notice_date?: CNoticeDate$Outbound | null | undefined; federal_tax_classification?: string | undefined; first_b_notice_date?: FirstBNoticeDate$Outbound | null | undefined; irs_form_type?: string | undefined; legal_tax_region_code?: string | undefined; reporting_eligibility?: string | undefined; tax_certification_date?: TaxCertificationDate$Outbound | null | undefined; taxpayer_certification_state?: string | undefined; us_tin_status?: string | undefined; withholding_state?: string | undefined; }; /** @internal */ export const TaxProfile$outboundSchema: z.ZodType< TaxProfile$Outbound, z.ZodTypeDef, TaxProfile > = z.object({ cNoticeDate: z.nullable(z.lazy(() => CNoticeDate$outboundSchema)).optional(), federalTaxClassification: LegalNaturalPersonFederalTaxClassification$outboundSchema.optional(), firstBNoticeDate: z.nullable(z.lazy(() => FirstBNoticeDate$outboundSchema)) .optional(), irsFormType: LegalNaturalPersonIrsFormType$outboundSchema.optional(), legalTaxRegionCode: z.string().optional(), reportingEligibility: ReportingEligibility$outboundSchema.optional(), taxCertificationDate: z.nullable( z.lazy(() => TaxCertificationDate$outboundSchema), ).optional(), taxpayerCertificationState: TaxpayerCertificationState$outboundSchema .optional(), usTinStatus: LegalNaturalPersonUsTinStatus$outboundSchema.optional(), withholdingState: LegalNaturalPersonWithholdingState$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 TaxProfile$ { /** @deprecated use `TaxProfile$inboundSchema` instead. */ export const inboundSchema = TaxProfile$inboundSchema; /** @deprecated use `TaxProfile$outboundSchema` instead. */ export const outboundSchema = TaxProfile$outboundSchema; /** @deprecated use `TaxProfile$Outbound` instead. */ export type Outbound = TaxProfile$Outbound; } export function taxProfileToJSON(taxProfile: TaxProfile): string { return JSON.stringify(TaxProfile$outboundSchema.parse(taxProfile)); } export function taxProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxProfile' from JSON`, ); } /** @internal */ export const LegalNaturalPerson$inboundSchema: z.ZodType< LegalNaturalPerson, z.ZodTypeDef, unknown > = z.object({ accredited_investor: z.boolean().optional(), adviser: z.boolean().optional(), birth_date: z.nullable(z.lazy(() => BirthDate$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(() => DeathDate$inboundSchema)).optional(), doing_business_as: z.array(z.string()).optional(), employment: z.nullable(z.lazy(() => Employment$inboundSchema)).optional(), family_name: z.string().optional(), finra_associated_entity: z.string().optional(), foreign_identification: z.nullable( z.lazy(() => ForeignIdentification$inboundSchema), ).optional(), given_name: z.string().optional(), global_person_id: z.string().optional(), identity_verification_result: z.nullable( z.lazy(() => LegalNaturalPersonIdentityVerificationResult$inboundSchema), ).optional(), institutional_customer: z.boolean().optional(), investigation_id: z.string().optional(), large_trader: z.nullable( z.lazy(() => LegalNaturalPersonLargeTrader$inboundSchema), ).optional(), legal_natural_person_id: z.string().optional(), marital_status: LegalNaturalPersonMaritalStatus$inboundSchema.optional(), middle_names: z.string().optional(), name: z.string().optional(), name_suffix: LegalNaturalPersonNameSuffix$inboundSchema.optional(), natural_person_fdd: z.nullable(z.lazy(() => NaturalPersonFdd$inboundSchema)) .optional(), non_citizen_residency: z.nullable( z.lazy(() => NonCitizenResidency$inboundSchema), ).optional(), personal_address: z.nullable(z.lazy(() => PersonalAddress$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: LegalNaturalPersonTaxIdType$inboundSchema.optional(), tax_profile: z.nullable(z.lazy(() => TaxProfile$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 LegalNaturalPerson$Outbound = { accredited_investor?: boolean | undefined; adviser?: boolean | undefined; birth_date?: BirthDate$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?: DeathDate$Outbound | null | undefined; doing_business_as?: Array | undefined; employment?: Employment$Outbound | null | undefined; family_name?: string | undefined; finra_associated_entity?: string | undefined; foreign_identification?: ForeignIdentification$Outbound | null | undefined; given_name?: string | undefined; global_person_id?: string | undefined; identity_verification_result?: | LegalNaturalPersonIdentityVerificationResult$Outbound | null | undefined; institutional_customer?: boolean | undefined; investigation_id?: string | undefined; large_trader?: LegalNaturalPersonLargeTrader$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?: NaturalPersonFdd$Outbound | null | undefined; non_citizen_residency?: NonCitizenResidency$Outbound | null | undefined; personal_address?: PersonalAddress$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?: TaxProfile$Outbound | null | undefined; }; /** @internal */ export const LegalNaturalPerson$outboundSchema: z.ZodType< LegalNaturalPerson$Outbound, z.ZodTypeDef, LegalNaturalPerson > = z.object({ accreditedInvestor: z.boolean().optional(), adviser: z.boolean().optional(), birthDate: z.nullable(z.lazy(() => BirthDate$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(() => DeathDate$outboundSchema)).optional(), doingBusinessAs: z.array(z.string()).optional(), employment: z.nullable(z.lazy(() => Employment$outboundSchema)).optional(), familyName: z.string().optional(), finraAssociatedEntity: z.string().optional(), foreignIdentification: z.nullable( z.lazy(() => ForeignIdentification$outboundSchema), ).optional(), givenName: z.string().optional(), globalPersonId: z.string().optional(), identityVerificationResult: z.nullable( z.lazy(() => LegalNaturalPersonIdentityVerificationResult$outboundSchema), ).optional(), institutionalCustomer: z.boolean().optional(), investigationId: z.string().optional(), largeTrader: z.nullable( z.lazy(() => LegalNaturalPersonLargeTrader$outboundSchema), ).optional(), legalNaturalPersonId: z.string().optional(), maritalStatus: LegalNaturalPersonMaritalStatus$outboundSchema.optional(), middleNames: z.string().optional(), name: z.string().optional(), nameSuffix: LegalNaturalPersonNameSuffix$outboundSchema.optional(), naturalPersonFdd: z.nullable(z.lazy(() => NaturalPersonFdd$outboundSchema)) .optional(), nonCitizenResidency: z.nullable( z.lazy(() => NonCitizenResidency$outboundSchema), ).optional(), personalAddress: z.nullable(z.lazy(() => PersonalAddress$outboundSchema)) .optional(), politicallyExposedImmediateFamilyNames: z.array(z.string()).optional(), politicallyExposedOrganization: z.string().optional(), taxId: z.string().optional(), taxIdLastFour: z.string().optional(), taxIdType: LegalNaturalPersonTaxIdType$outboundSchema.optional(), taxProfile: z.nullable(z.lazy(() => TaxProfile$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 LegalNaturalPerson$ { /** @deprecated use `LegalNaturalPerson$inboundSchema` instead. */ export const inboundSchema = LegalNaturalPerson$inboundSchema; /** @deprecated use `LegalNaturalPerson$outboundSchema` instead. */ export const outboundSchema = LegalNaturalPerson$outboundSchema; /** @deprecated use `LegalNaturalPerson$Outbound` instead. */ export type Outbound = LegalNaturalPerson$Outbound; } export function legalNaturalPersonToJSON( legalNaturalPerson: LegalNaturalPerson, ): string { return JSON.stringify( LegalNaturalPerson$outboundSchema.parse(legalNaturalPerson), ); } export function legalNaturalPersonFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LegalNaturalPerson$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LegalNaturalPerson' from JSON`, ); }