/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AuditTrail, AuditTrail$inboundSchema, AuditTrail$Outbound, AuditTrail$outboundSchema, } from "./audittrail.js"; import { EntityIdentification, EntityIdentification$inboundSchema, EntityIdentification$Outbound, EntityIdentification$outboundSchema, } from "./entityidentification.js"; import { IdentityVerificationResult, IdentityVerificationResult$inboundSchema, IdentityVerificationResult$Outbound, IdentityVerificationResult$outboundSchema, } from "./identityverificationresult.js"; import { PersonIdentification, PersonIdentification$inboundSchema, PersonIdentification$Outbound, PersonIdentification$outboundSchema, } from "./personidentification.js"; import { PostalAddress, PostalAddress$inboundSchema, PostalAddress$Outbound, PostalAddress$outboundSchema, } from "./postaladdress.js"; import { WatchlistMatch, WatchlistMatch$inboundSchema, WatchlistMatch$Outbound, WatchlistMatch$outboundSchema, } from "./watchlistmatch.js"; /** * legal address */ export type InvestigationLegalAddress = { /** * 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; }; /** * investigation details on an entity */ export type Entity = { /** * Other names the entity is known by (Doing Business As) */ dbaNames?: Array | undefined; /** * Email addresses */ emailAddresses?: Array | undefined; /** * Identification details including id value, and type (e.g. ein, lei) */ identifications?: Array | undefined; /** * legal address */ legalAddress?: InvestigationLegalAddress | null | undefined; /** * The legal name of the entity */ legalName?: string | undefined; /** * mailing address */ mailingAddresses?: Array | undefined; /** * The countries where an entity does business Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ operatingRegionCodes?: Array | undefined; /** * phone numbers */ phoneNumbers?: Array | undefined; /** * Region of registration Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ registrationRegion?: string | undefined; }; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export enum IdentityVerification { ScreenStateUnspecified = "SCREEN_STATE_UNSPECIFIED", Pending = "PENDING", Passed = "PASSED", Failed = "FAILED", NeedsReview = "NEEDS_REVIEW", DeferredReview = "DEFERRED_REVIEW", OutOfScope = "OUT_OF_SCOPE", } /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export type IdentityVerificationOpen = OpenEnum; /** * Used to determine who is responsible for running identity verification checks, one of: * * @remarks * - `IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED` - Default/Null value. * - `PERFORMED_BY_APEX` - Run CIP and CDD checks. * - `PROVIDED_BY_CLIENT` - Run CDD checks with CIP provided in request. */ export enum IdentityVerificationScope { IdentityVerificationScopeUnspecified = "IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED", PerformedByApex = "PERFORMED_BY_APEX", ProvidedByClient = "PROVIDED_BY_CLIENT", } /** * Used to determine who is responsible for running identity verification checks, one of: * * @remarks * - `IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED` - Default/Null value. * - `PERFORMED_BY_APEX` - Run CIP and CDD checks. * - `PROVIDED_BY_CLIENT` - Run CDD checks with CIP provided in request. */ export type IdentityVerificationScopeOpen = OpenEnum< typeof IdentityVerificationScope >; /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ export enum InvestigationRequestState { InvestigationRequestStateUnspecified = "INVESTIGATION_REQUEST_STATE_UNSPECIFIED", Open = "OPEN", Closed = "CLOSED", } /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ export type InvestigationRequestStateOpen = OpenEnum< typeof InvestigationRequestState >; /** * The legal day, month, and year of birth for a natural person Must be formatted as an ISO-8601 YYYY-MM-DD */ export type InvestigationBirthDate = { /** * 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; }; /** * legal address */ export type InvestigationPersonLegalAddress = { /** * 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 name suffix for individuals, one of: * * @remarks * - `NAME_SUFFIX_UNSPECIFIED` - Default/Null value. * - `SR` - Senior. * - `JR` - Junior. * - `III` - The third. * - `IV` - The fourth. * - `V` - The fifth. */ export enum InvestigationNameSuffix { NameSuffixUnspecified = "NAME_SUFFIX_UNSPECIFIED", Sr = "SR", Jr = "JR", Iii = "III", Iv = "IV", V = "V", } /** * The name suffix for individuals, one of: * * @remarks * - `NAME_SUFFIX_UNSPECIFIED` - Default/Null value. * - `SR` - Senior. * - `JR` - Junior. * - `III` - The third. * - `IV` - The fourth. * - `V` - The fifth. */ export type InvestigationNameSuffixOpen = OpenEnum< typeof InvestigationNameSuffix >; /** * The date identity verification was performed. */ export type InvestigationExecutionDate = { /** * 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; }; /** * Conditional: Identity Verification results must be provided by the correspondent if InvestigationRequestScope = PROVIDED_BY_CLIENT */ export type ProvidedIdentityVerification = { /** * Indicates whether the identity's address was verified */ addressVerified?: boolean | undefined; /** * Indicates whether the identity's date of birth was verified */ birthDateVerified?: boolean | undefined; /** * Indicates that the client directly verified the ID documents rather than using a third-party vendor (self-inspected) */ clientDirectlyVerifiedIdDocs?: boolean | undefined; /** * The date identity verification was performed. */ executionDate?: InvestigationExecutionDate | null | undefined; /** * Client-generated identifier associated with the KYC results for the appropriate case */ externalCaseId?: string | undefined; /** * A collection of unique identifiers provided by the documents api that correspond to any number of identity verification documents used in support of the external vendor to verify the identity, such as a driver's license, passport, etc */ identityVerificationDocumentIds?: Array | undefined; /** * Indicates whether the identity's name was verified */ nameVerified?: boolean | undefined; /** * Id of this identity verification record */ providedIdentityVerificationId?: string | undefined; /** * A unique identifier provided from the documents api that corresponds to an identity verification result */ rawVendorDataDocumentId?: string | undefined; /** * Indicates whether the identity's tax id was verified */ taxIdVerified?: boolean | undefined; /** * Name of the vendor that performed identity verification */ vendor?: string | undefined; }; /** * investigation details on a person */ export type Person = { /** * The legal day, month, and year of birth for a natural person Must be formatted as an ISO-8601 YYYY-MM-DD */ birthDate?: InvestigationBirthDate | null | undefined; /** * Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ birthRegionCode?: string | undefined; /** * The countries where a natural person retains citizenship; This is used for tax (treaty) and country block list considerations Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ citizenshipRegionCodes?: Array | undefined; /** * Conditional: document_ids must be provided by the correspondent if InvestigationRequestScope = PERFORMED_BY_APEX and citizenship_country is not USA */ documentIds?: Array | undefined; /** * Email addresses indicated for account communications */ emailAddresses?: Array | undefined; /** * Family name of a natural person */ familyName?: string | undefined; /** * The given name of a natural person; Conventionally known as 'first name' in most English-speaking countries */ givenName?: string | undefined; /** * Identification details including id value, and type (e.g. ssn) */ identifications?: Array | undefined; /** * legal address */ legalAddress?: InvestigationPersonLegalAddress | null | undefined; /** * mailing address */ mailingAddresses?: Array | undefined; /** * Middle names */ middleNames?: string | undefined; /** * The name suffix for individuals, one of: * * @remarks * - `NAME_SUFFIX_UNSPECIFIED` - Default/Null value. * - `SR` - Senior. * - `JR` - Junior. * - `III` - The third. * - `IV` - The fourth. * - `V` - The fifth. */ nameSuffix?: InvestigationNameSuffixOpen | undefined; /** * phone numbers related to this person */ phoneNumbers?: Array | undefined; /** * Conditional: Identity Verification results must be provided by the correspondent if InvestigationRequestScope = PROVIDED_BY_CLIENT */ providedIdentityVerification?: | ProvidedIdentityVerification | null | undefined; }; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export enum WatchlistScreen { ScreenStateUnspecified = "SCREEN_STATE_UNSPECIFIED", Pending = "PENDING", Passed = "PASSED", Failed = "FAILED", NeedsReview = "NEEDS_REVIEW", DeferredReview = "DEFERRED_REVIEW", OutOfScope = "OUT_OF_SCOPE", } /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export type WatchlistScreenOpen = OpenEnum; /** * Contains investigation details of corresponding investigation */ export type Investigation = { /** * Audit trail of an investigation */ auditTrail?: Array | undefined; /** * A unique identifier referencing a client The client ID serves as the unique identifier for the apex client positioned above the correspondent within the apex client configurator hierarchy. Moving forward, the account service will internally assign the client ID for all investigations. */ clientId?: string | undefined; /** * A unique identifier referencing a Correspondent */ correspondentId?: string | undefined; /** * The time the investigation state was created */ createTime?: Date | null | undefined; /** * investigation details on an entity */ entity?: Entity | null | undefined; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ identityVerification?: IdentityVerificationOpen | undefined; /** * The results of the identity verification check */ identityVerificationResults?: Array | undefined; /** * Used to determine who is responsible for running identity verification checks, one of: * * @remarks * - `IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED` - Default/Null value. * - `PERFORMED_BY_APEX` - Run CIP and CDD checks. * - `PROVIDED_BY_CLIENT` - Run CDD checks with CIP provided in request. */ identityVerificationScope?: IdentityVerificationScopeOpen | undefined; /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ investigationRequestState?: InvestigationRequestStateOpen | undefined; /** * Required: The ID for an open investigation The format is "investigations/{investigation}" */ name?: string | undefined; /** * investigation details on a person */ person?: Person | null | undefined; /** * The time the investigation state was last updated */ updateTime?: Date | null | undefined; /** * A list of watchlist entries matched against the investigation */ watchlistMatches?: Array | undefined; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ watchlistScreen?: WatchlistScreenOpen | undefined; }; /** @internal */ export const InvestigationLegalAddress$inboundSchema: z.ZodType< InvestigationLegalAddress, 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 InvestigationLegalAddress$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 InvestigationLegalAddress$outboundSchema: z.ZodType< InvestigationLegalAddress$Outbound, z.ZodTypeDef, InvestigationLegalAddress > = 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 InvestigationLegalAddress$ { /** @deprecated use `InvestigationLegalAddress$inboundSchema` instead. */ export const inboundSchema = InvestigationLegalAddress$inboundSchema; /** @deprecated use `InvestigationLegalAddress$outboundSchema` instead. */ export const outboundSchema = InvestigationLegalAddress$outboundSchema; /** @deprecated use `InvestigationLegalAddress$Outbound` instead. */ export type Outbound = InvestigationLegalAddress$Outbound; } export function investigationLegalAddressToJSON( investigationLegalAddress: InvestigationLegalAddress, ): string { return JSON.stringify( InvestigationLegalAddress$outboundSchema.parse(investigationLegalAddress), ); } export function investigationLegalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvestigationLegalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvestigationLegalAddress' from JSON`, ); } /** @internal */ export const Entity$inboundSchema: z.ZodType = z .object({ dba_names: z.array(z.string()).optional(), email_addresses: z.array(z.string()).optional(), identifications: z.array(EntityIdentification$inboundSchema).optional(), legal_address: z.nullable( z.lazy(() => InvestigationLegalAddress$inboundSchema), ).optional(), legal_name: z.string().optional(), mailing_addresses: z.array(PostalAddress$inboundSchema).optional(), operating_region_codes: z.array(z.string()).optional(), phone_numbers: z.array(z.string()).optional(), registration_region: z.string().optional(), }).transform((v) => { return remap$(v, { "dba_names": "dbaNames", "email_addresses": "emailAddresses", "legal_address": "legalAddress", "legal_name": "legalName", "mailing_addresses": "mailingAddresses", "operating_region_codes": "operatingRegionCodes", "phone_numbers": "phoneNumbers", "registration_region": "registrationRegion", }); }); /** @internal */ export type Entity$Outbound = { dba_names?: Array | undefined; email_addresses?: Array | undefined; identifications?: Array | undefined; legal_address?: InvestigationLegalAddress$Outbound | null | undefined; legal_name?: string | undefined; mailing_addresses?: Array | undefined; operating_region_codes?: Array | undefined; phone_numbers?: Array | undefined; registration_region?: string | undefined; }; /** @internal */ export const Entity$outboundSchema: z.ZodType< Entity$Outbound, z.ZodTypeDef, Entity > = z.object({ dbaNames: z.array(z.string()).optional(), emailAddresses: z.array(z.string()).optional(), identifications: z.array(EntityIdentification$outboundSchema).optional(), legalAddress: z.nullable( z.lazy(() => InvestigationLegalAddress$outboundSchema), ).optional(), legalName: z.string().optional(), mailingAddresses: z.array(PostalAddress$outboundSchema).optional(), operatingRegionCodes: z.array(z.string()).optional(), phoneNumbers: z.array(z.string()).optional(), registrationRegion: z.string().optional(), }).transform((v) => { return remap$(v, { dbaNames: "dba_names", emailAddresses: "email_addresses", legalAddress: "legal_address", legalName: "legal_name", mailingAddresses: "mailing_addresses", operatingRegionCodes: "operating_region_codes", phoneNumbers: "phone_numbers", registrationRegion: "registration_region", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Entity$ { /** @deprecated use `Entity$inboundSchema` instead. */ export const inboundSchema = Entity$inboundSchema; /** @deprecated use `Entity$outboundSchema` instead. */ export const outboundSchema = Entity$outboundSchema; /** @deprecated use `Entity$Outbound` instead. */ export type Outbound = Entity$Outbound; } export function entityToJSON(entity: Entity): string { return JSON.stringify(Entity$outboundSchema.parse(entity)); } export function entityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Entity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entity' from JSON`, ); } /** @internal */ export const IdentityVerification$inboundSchema: z.ZodType< IdentityVerificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(IdentityVerification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const IdentityVerification$outboundSchema: z.ZodType< IdentityVerificationOpen, z.ZodTypeDef, IdentityVerificationOpen > = z.union([ z.nativeEnum(IdentityVerification), 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 IdentityVerification$ { /** @deprecated use `IdentityVerification$inboundSchema` instead. */ export const inboundSchema = IdentityVerification$inboundSchema; /** @deprecated use `IdentityVerification$outboundSchema` instead. */ export const outboundSchema = IdentityVerification$outboundSchema; } /** @internal */ export const IdentityVerificationScope$inboundSchema: z.ZodType< IdentityVerificationScopeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(IdentityVerificationScope), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const IdentityVerificationScope$outboundSchema: z.ZodType< IdentityVerificationScopeOpen, z.ZodTypeDef, IdentityVerificationScopeOpen > = z.union([ z.nativeEnum(IdentityVerificationScope), 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 IdentityVerificationScope$ { /** @deprecated use `IdentityVerificationScope$inboundSchema` instead. */ export const inboundSchema = IdentityVerificationScope$inboundSchema; /** @deprecated use `IdentityVerificationScope$outboundSchema` instead. */ export const outboundSchema = IdentityVerificationScope$outboundSchema; } /** @internal */ export const InvestigationRequestState$inboundSchema: z.ZodType< InvestigationRequestStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(InvestigationRequestState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const InvestigationRequestState$outboundSchema: z.ZodType< InvestigationRequestStateOpen, z.ZodTypeDef, InvestigationRequestStateOpen > = z.union([ z.nativeEnum(InvestigationRequestState), 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 InvestigationRequestState$ { /** @deprecated use `InvestigationRequestState$inboundSchema` instead. */ export const inboundSchema = InvestigationRequestState$inboundSchema; /** @deprecated use `InvestigationRequestState$outboundSchema` instead. */ export const outboundSchema = InvestigationRequestState$outboundSchema; } /** @internal */ export const InvestigationBirthDate$inboundSchema: z.ZodType< InvestigationBirthDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type InvestigationBirthDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const InvestigationBirthDate$outboundSchema: z.ZodType< InvestigationBirthDate$Outbound, z.ZodTypeDef, InvestigationBirthDate > = 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 InvestigationBirthDate$ { /** @deprecated use `InvestigationBirthDate$inboundSchema` instead. */ export const inboundSchema = InvestigationBirthDate$inboundSchema; /** @deprecated use `InvestigationBirthDate$outboundSchema` instead. */ export const outboundSchema = InvestigationBirthDate$outboundSchema; /** @deprecated use `InvestigationBirthDate$Outbound` instead. */ export type Outbound = InvestigationBirthDate$Outbound; } export function investigationBirthDateToJSON( investigationBirthDate: InvestigationBirthDate, ): string { return JSON.stringify( InvestigationBirthDate$outboundSchema.parse(investigationBirthDate), ); } export function investigationBirthDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvestigationBirthDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvestigationBirthDate' from JSON`, ); } /** @internal */ export const InvestigationPersonLegalAddress$inboundSchema: z.ZodType< InvestigationPersonLegalAddress, 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 InvestigationPersonLegalAddress$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 InvestigationPersonLegalAddress$outboundSchema: z.ZodType< InvestigationPersonLegalAddress$Outbound, z.ZodTypeDef, InvestigationPersonLegalAddress > = 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 InvestigationPersonLegalAddress$ { /** @deprecated use `InvestigationPersonLegalAddress$inboundSchema` instead. */ export const inboundSchema = InvestigationPersonLegalAddress$inboundSchema; /** @deprecated use `InvestigationPersonLegalAddress$outboundSchema` instead. */ export const outboundSchema = InvestigationPersonLegalAddress$outboundSchema; /** @deprecated use `InvestigationPersonLegalAddress$Outbound` instead. */ export type Outbound = InvestigationPersonLegalAddress$Outbound; } export function investigationPersonLegalAddressToJSON( investigationPersonLegalAddress: InvestigationPersonLegalAddress, ): string { return JSON.stringify( InvestigationPersonLegalAddress$outboundSchema.parse( investigationPersonLegalAddress, ), ); } export function investigationPersonLegalAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvestigationPersonLegalAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvestigationPersonLegalAddress' from JSON`, ); } /** @internal */ export const InvestigationNameSuffix$inboundSchema: z.ZodType< InvestigationNameSuffixOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(InvestigationNameSuffix), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const InvestigationNameSuffix$outboundSchema: z.ZodType< InvestigationNameSuffixOpen, z.ZodTypeDef, InvestigationNameSuffixOpen > = z.union([ z.nativeEnum(InvestigationNameSuffix), 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 InvestigationNameSuffix$ { /** @deprecated use `InvestigationNameSuffix$inboundSchema` instead. */ export const inboundSchema = InvestigationNameSuffix$inboundSchema; /** @deprecated use `InvestigationNameSuffix$outboundSchema` instead. */ export const outboundSchema = InvestigationNameSuffix$outboundSchema; } /** @internal */ export const InvestigationExecutionDate$inboundSchema: z.ZodType< InvestigationExecutionDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type InvestigationExecutionDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const InvestigationExecutionDate$outboundSchema: z.ZodType< InvestigationExecutionDate$Outbound, z.ZodTypeDef, InvestigationExecutionDate > = 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 InvestigationExecutionDate$ { /** @deprecated use `InvestigationExecutionDate$inboundSchema` instead. */ export const inboundSchema = InvestigationExecutionDate$inboundSchema; /** @deprecated use `InvestigationExecutionDate$outboundSchema` instead. */ export const outboundSchema = InvestigationExecutionDate$outboundSchema; /** @deprecated use `InvestigationExecutionDate$Outbound` instead. */ export type Outbound = InvestigationExecutionDate$Outbound; } export function investigationExecutionDateToJSON( investigationExecutionDate: InvestigationExecutionDate, ): string { return JSON.stringify( InvestigationExecutionDate$outboundSchema.parse(investigationExecutionDate), ); } export function investigationExecutionDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvestigationExecutionDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvestigationExecutionDate' from JSON`, ); } /** @internal */ export const ProvidedIdentityVerification$inboundSchema: z.ZodType< ProvidedIdentityVerification, z.ZodTypeDef, unknown > = z.object({ address_verified: z.boolean().optional(), birth_date_verified: z.boolean().optional(), client_directly_verified_id_docs: z.boolean().optional(), execution_date: z.nullable( z.lazy(() => InvestigationExecutionDate$inboundSchema), ).optional(), external_case_id: z.string().optional(), identity_verification_document_ids: z.array(z.string()).optional(), name_verified: z.boolean().optional(), provided_identity_verification_id: z.string().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", "client_directly_verified_id_docs": "clientDirectlyVerifiedIdDocs", "execution_date": "executionDate", "external_case_id": "externalCaseId", "identity_verification_document_ids": "identityVerificationDocumentIds", "name_verified": "nameVerified", "provided_identity_verification_id": "providedIdentityVerificationId", "raw_vendor_data_document_id": "rawVendorDataDocumentId", "tax_id_verified": "taxIdVerified", }); }); /** @internal */ export type ProvidedIdentityVerification$Outbound = { address_verified?: boolean | undefined; birth_date_verified?: boolean | undefined; client_directly_verified_id_docs?: boolean | undefined; execution_date?: InvestigationExecutionDate$Outbound | null | undefined; external_case_id?: string | undefined; identity_verification_document_ids?: Array | undefined; name_verified?: boolean | undefined; provided_identity_verification_id?: string | undefined; raw_vendor_data_document_id?: string | undefined; tax_id_verified?: boolean | undefined; vendor?: string | undefined; }; /** @internal */ export const ProvidedIdentityVerification$outboundSchema: z.ZodType< ProvidedIdentityVerification$Outbound, z.ZodTypeDef, ProvidedIdentityVerification > = z.object({ addressVerified: z.boolean().optional(), birthDateVerified: z.boolean().optional(), clientDirectlyVerifiedIdDocs: z.boolean().optional(), executionDate: z.nullable( z.lazy(() => InvestigationExecutionDate$outboundSchema), ).optional(), externalCaseId: z.string().optional(), identityVerificationDocumentIds: z.array(z.string()).optional(), nameVerified: z.boolean().optional(), providedIdentityVerificationId: z.string().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", clientDirectlyVerifiedIdDocs: "client_directly_verified_id_docs", executionDate: "execution_date", externalCaseId: "external_case_id", identityVerificationDocumentIds: "identity_verification_document_ids", nameVerified: "name_verified", providedIdentityVerificationId: "provided_identity_verification_id", 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 ProvidedIdentityVerification$ { /** @deprecated use `ProvidedIdentityVerification$inboundSchema` instead. */ export const inboundSchema = ProvidedIdentityVerification$inboundSchema; /** @deprecated use `ProvidedIdentityVerification$outboundSchema` instead. */ export const outboundSchema = ProvidedIdentityVerification$outboundSchema; /** @deprecated use `ProvidedIdentityVerification$Outbound` instead. */ export type Outbound = ProvidedIdentityVerification$Outbound; } export function providedIdentityVerificationToJSON( providedIdentityVerification: ProvidedIdentityVerification, ): string { return JSON.stringify( ProvidedIdentityVerification$outboundSchema.parse( providedIdentityVerification, ), ); } export function providedIdentityVerificationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProvidedIdentityVerification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProvidedIdentityVerification' from JSON`, ); } /** @internal */ export const Person$inboundSchema: z.ZodType = z .object({ birth_date: z.nullable(z.lazy(() => InvestigationBirthDate$inboundSchema)) .optional(), birth_region_code: z.string().optional(), citizenship_region_codes: z.array(z.string()).optional(), document_ids: z.array(z.string()).optional(), email_addresses: z.array(z.string()).optional(), family_name: z.string().optional(), given_name: z.string().optional(), identifications: z.array(PersonIdentification$inboundSchema).optional(), legal_address: z.nullable( z.lazy(() => InvestigationPersonLegalAddress$inboundSchema), ).optional(), mailing_addresses: z.array(PostalAddress$inboundSchema).optional(), middle_names: z.string().optional(), name_suffix: InvestigationNameSuffix$inboundSchema.optional(), phone_numbers: z.array(z.string()).optional(), provided_identity_verification: z.nullable( z.lazy(() => ProvidedIdentityVerification$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "birth_date": "birthDate", "birth_region_code": "birthRegionCode", "citizenship_region_codes": "citizenshipRegionCodes", "document_ids": "documentIds", "email_addresses": "emailAddresses", "family_name": "familyName", "given_name": "givenName", "legal_address": "legalAddress", "mailing_addresses": "mailingAddresses", "middle_names": "middleNames", "name_suffix": "nameSuffix", "phone_numbers": "phoneNumbers", "provided_identity_verification": "providedIdentityVerification", }); }); /** @internal */ export type Person$Outbound = { birth_date?: InvestigationBirthDate$Outbound | null | undefined; birth_region_code?: string | undefined; citizenship_region_codes?: Array | undefined; document_ids?: Array | undefined; email_addresses?: Array | undefined; family_name?: string | undefined; given_name?: string | undefined; identifications?: Array | undefined; legal_address?: InvestigationPersonLegalAddress$Outbound | null | undefined; mailing_addresses?: Array | undefined; middle_names?: string | undefined; name_suffix?: string | undefined; phone_numbers?: Array | undefined; provided_identity_verification?: | ProvidedIdentityVerification$Outbound | null | undefined; }; /** @internal */ export const Person$outboundSchema: z.ZodType< Person$Outbound, z.ZodTypeDef, Person > = z.object({ birthDate: z.nullable(z.lazy(() => InvestigationBirthDate$outboundSchema)) .optional(), birthRegionCode: z.string().optional(), citizenshipRegionCodes: z.array(z.string()).optional(), documentIds: z.array(z.string()).optional(), emailAddresses: z.array(z.string()).optional(), familyName: z.string().optional(), givenName: z.string().optional(), identifications: z.array(PersonIdentification$outboundSchema).optional(), legalAddress: z.nullable( z.lazy(() => InvestigationPersonLegalAddress$outboundSchema), ).optional(), mailingAddresses: z.array(PostalAddress$outboundSchema).optional(), middleNames: z.string().optional(), nameSuffix: InvestigationNameSuffix$outboundSchema.optional(), phoneNumbers: z.array(z.string()).optional(), providedIdentityVerification: z.nullable( z.lazy(() => ProvidedIdentityVerification$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { birthDate: "birth_date", birthRegionCode: "birth_region_code", citizenshipRegionCodes: "citizenship_region_codes", documentIds: "document_ids", emailAddresses: "email_addresses", familyName: "family_name", givenName: "given_name", legalAddress: "legal_address", mailingAddresses: "mailing_addresses", middleNames: "middle_names", nameSuffix: "name_suffix", phoneNumbers: "phone_numbers", providedIdentityVerification: "provided_identity_verification", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Person$ { /** @deprecated use `Person$inboundSchema` instead. */ export const inboundSchema = Person$inboundSchema; /** @deprecated use `Person$outboundSchema` instead. */ export const outboundSchema = Person$outboundSchema; /** @deprecated use `Person$Outbound` instead. */ export type Outbound = Person$Outbound; } export function personToJSON(person: Person): string { return JSON.stringify(Person$outboundSchema.parse(person)); } export function personFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Person$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Person' from JSON`, ); } /** @internal */ export const WatchlistScreen$inboundSchema: z.ZodType< WatchlistScreenOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WatchlistScreen), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WatchlistScreen$outboundSchema: z.ZodType< WatchlistScreenOpen, z.ZodTypeDef, WatchlistScreenOpen > = z.union([ z.nativeEnum(WatchlistScreen), 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 WatchlistScreen$ { /** @deprecated use `WatchlistScreen$inboundSchema` instead. */ export const inboundSchema = WatchlistScreen$inboundSchema; /** @deprecated use `WatchlistScreen$outboundSchema` instead. */ export const outboundSchema = WatchlistScreen$outboundSchema; } /** @internal */ export const Investigation$inboundSchema: z.ZodType< Investigation, z.ZodTypeDef, unknown > = z.object({ audit_trail: z.array(AuditTrail$inboundSchema).optional(), client_id: z.string().optional(), correspondent_id: z.string().optional(), create_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), entity: z.nullable(z.lazy(() => Entity$inboundSchema)).optional(), identity_verification: IdentityVerification$inboundSchema.optional(), identity_verification_results: z.array( IdentityVerificationResult$inboundSchema, ).optional(), identity_verification_scope: IdentityVerificationScope$inboundSchema .optional(), investigation_request_state: InvestigationRequestState$inboundSchema .optional(), name: z.string().optional(), person: z.nullable(z.lazy(() => Person$inboundSchema)).optional(), update_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), watchlist_matches: z.array(WatchlistMatch$inboundSchema).optional(), watchlist_screen: WatchlistScreen$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "audit_trail": "auditTrail", "client_id": "clientId", "correspondent_id": "correspondentId", "create_time": "createTime", "identity_verification": "identityVerification", "identity_verification_results": "identityVerificationResults", "identity_verification_scope": "identityVerificationScope", "investigation_request_state": "investigationRequestState", "update_time": "updateTime", "watchlist_matches": "watchlistMatches", "watchlist_screen": "watchlistScreen", }); }); /** @internal */ export type Investigation$Outbound = { audit_trail?: Array | undefined; client_id?: string | undefined; correspondent_id?: string | undefined; create_time?: string | null | undefined; entity?: Entity$Outbound | null | undefined; identity_verification?: string | undefined; identity_verification_results?: | Array | undefined; identity_verification_scope?: string | undefined; investigation_request_state?: string | undefined; name?: string | undefined; person?: Person$Outbound | null | undefined; update_time?: string | null | undefined; watchlist_matches?: Array | undefined; watchlist_screen?: string | undefined; }; /** @internal */ export const Investigation$outboundSchema: z.ZodType< Investigation$Outbound, z.ZodTypeDef, Investigation > = z.object({ auditTrail: z.array(AuditTrail$outboundSchema).optional(), clientId: z.string().optional(), correspondentId: z.string().optional(), createTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), entity: z.nullable(z.lazy(() => Entity$outboundSchema)).optional(), identityVerification: IdentityVerification$outboundSchema.optional(), identityVerificationResults: z.array( IdentityVerificationResult$outboundSchema, ).optional(), identityVerificationScope: IdentityVerificationScope$outboundSchema .optional(), investigationRequestState: InvestigationRequestState$outboundSchema .optional(), name: z.string().optional(), person: z.nullable(z.lazy(() => Person$outboundSchema)).optional(), updateTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), watchlistMatches: z.array(WatchlistMatch$outboundSchema).optional(), watchlistScreen: WatchlistScreen$outboundSchema.optional(), }).transform((v) => { return remap$(v, { auditTrail: "audit_trail", clientId: "client_id", correspondentId: "correspondent_id", createTime: "create_time", identityVerification: "identity_verification", identityVerificationResults: "identity_verification_results", identityVerificationScope: "identity_verification_scope", investigationRequestState: "investigation_request_state", updateTime: "update_time", watchlistMatches: "watchlist_matches", watchlistScreen: "watchlist_screen", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Investigation$ { /** @deprecated use `Investigation$inboundSchema` instead. */ export const inboundSchema = Investigation$inboundSchema; /** @deprecated use `Investigation$outboundSchema` instead. */ export const outboundSchema = Investigation$outboundSchema; /** @deprecated use `Investigation$Outbound` instead. */ export type Outbound = Investigation$Outbound; } export function investigationToJSON(investigation: Investigation): string { return JSON.stringify(Investigation$outboundSchema.parse(investigation)); } export function investigationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Investigation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Investigation' from JSON`, ); }