/* * 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 { DateCreate, DateCreate$inboundSchema, DateCreate$Outbound, DateCreate$outboundSchema, } from "./datecreate.js"; /** * An identity verification result that clients may supply. This result represents data and confirmation attesting to identity verification. */ export type IdentityVerificationResultCreate = { /** * Attestation that external result and review have verified the supplied investor's address has been verified in conjunction with other PII */ addressVerified: boolean; /** * 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; /** * 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: DateCreate; /** * Client-generated identifier associated with the KYC results for the appropriate case */ externalCaseId: string; /** * 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; /** * 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; /** * The name(s) of the vendor(s) used to externally verify and screen a natural person; relates to the identity_verification_result */ vendor: string; }; /** @internal */ export const IdentityVerificationResultCreate$inboundSchema: z.ZodType< IdentityVerificationResultCreate, z.ZodTypeDef, unknown > = z.object({ address_verified: z.boolean(), birth_date_verified: z.boolean(), execution_date: DateCreate$inboundSchema, external_case_id: z.string(), identity_verification_document_ids: z.array(z.string()).optional(), name_verified: z.boolean(), raw_vendor_data_document_id: z.string().optional(), tax_id_verified: z.boolean(), vendor: z.string(), }).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 IdentityVerificationResultCreate$Outbound = { address_verified: boolean; birth_date_verified: boolean; execution_date: DateCreate$Outbound; external_case_id: string; identity_verification_document_ids?: Array | undefined; name_verified: boolean; raw_vendor_data_document_id?: string | undefined; tax_id_verified: boolean; vendor: string; }; /** @internal */ export const IdentityVerificationResultCreate$outboundSchema: z.ZodType< IdentityVerificationResultCreate$Outbound, z.ZodTypeDef, IdentityVerificationResultCreate > = z.object({ addressVerified: z.boolean(), birthDateVerified: z.boolean(), executionDate: DateCreate$outboundSchema, externalCaseId: z.string(), identityVerificationDocumentIds: z.array(z.string()).optional(), nameVerified: z.boolean(), rawVendorDataDocumentId: z.string().optional(), taxIdVerified: z.boolean(), vendor: z.string(), }).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 IdentityVerificationResultCreate$ { /** @deprecated use `IdentityVerificationResultCreate$inboundSchema` instead. */ export const inboundSchema = IdentityVerificationResultCreate$inboundSchema; /** @deprecated use `IdentityVerificationResultCreate$outboundSchema` instead. */ export const outboundSchema = IdentityVerificationResultCreate$outboundSchema; /** @deprecated use `IdentityVerificationResultCreate$Outbound` instead. */ export type Outbound = IdentityVerificationResultCreate$Outbound; } export function identityVerificationResultCreateToJSON( identityVerificationResultCreate: IdentityVerificationResultCreate, ): string { return JSON.stringify( IdentityVerificationResultCreate$outboundSchema.parse( identityVerificationResultCreate, ), ); } export function identityVerificationResultCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IdentityVerificationResultCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IdentityVerificationResultCreate' from JSON`, ); }