/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DateUpdate, DateUpdate$inboundSchema, DateUpdate$Outbound, DateUpdate$outboundSchema, } from "./dateupdate.js"; /** * An identity verification result that clients may supply. This result represents data and confirmation attesting to identity verification. */ export type IdentityVerificationResultUpdate = { /** * 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; /** * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * * @remarks * * * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date * * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. */ executionDate?: DateUpdate | 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; /** * 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; }; /** @internal */ export const IdentityVerificationResultUpdate$inboundSchema: z.ZodType< IdentityVerificationResultUpdate, z.ZodTypeDef, unknown > = z.object({ address_verified: z.boolean().optional(), birth_date_verified: z.boolean().optional(), execution_date: DateUpdate$inboundSchema.optional(), external_case_id: z.string().optional(), identity_verification_document_ids: z.array(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", "name_verified": "nameVerified", "raw_vendor_data_document_id": "rawVendorDataDocumentId", "tax_id_verified": "taxIdVerified", }); }); /** @internal */ export type IdentityVerificationResultUpdate$Outbound = { address_verified?: boolean | undefined; birth_date_verified?: boolean | undefined; execution_date?: DateUpdate$Outbound | undefined; external_case_id?: string | undefined; identity_verification_document_ids?: Array | undefined; name_verified?: boolean | undefined; raw_vendor_data_document_id?: string | undefined; tax_id_verified?: boolean | undefined; vendor?: string | undefined; }; /** @internal */ export const IdentityVerificationResultUpdate$outboundSchema: z.ZodType< IdentityVerificationResultUpdate$Outbound, z.ZodTypeDef, IdentityVerificationResultUpdate > = z.object({ addressVerified: z.boolean().optional(), birthDateVerified: z.boolean().optional(), executionDate: DateUpdate$outboundSchema.optional(), externalCaseId: z.string().optional(), identityVerificationDocumentIds: z.array(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", 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 IdentityVerificationResultUpdate$ { /** @deprecated use `IdentityVerificationResultUpdate$inboundSchema` instead. */ export const inboundSchema = IdentityVerificationResultUpdate$inboundSchema; /** @deprecated use `IdentityVerificationResultUpdate$outboundSchema` instead. */ export const outboundSchema = IdentityVerificationResultUpdate$outboundSchema; /** @deprecated use `IdentityVerificationResultUpdate$Outbound` instead. */ export type Outbound = IdentityVerificationResultUpdate$Outbound; } export function identityVerificationResultUpdateToJSON( identityVerificationResultUpdate: IdentityVerificationResultUpdate, ): string { return JSON.stringify( IdentityVerificationResultUpdate$outboundSchema.parse( identityVerificationResultUpdate, ), ); } export function identityVerificationResultUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IdentityVerificationResultUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IdentityVerificationResultUpdate' from JSON`, ); }