/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { IdentityAttribute, IdentityAttribute$inboundSchema, IdentityAttribute$Outbound, IdentityAttribute$outboundSchema, } from "./identityattribute.js"; /** * The verification method based on the use case and authorization level. Current allowed values: "verifiedUser", "accountOpening", "humanAssurance", "prefill", "prefillForBiz", "identityResolution", "validate". */ export enum VerificationType { HumanAssurance = "humanAssurance", VerifiedUser = "verifiedUser", AccountOpening = "accountOpening", Prefill = "prefill", PrefillForBiz = "prefillForBiz", IdentityResolution = "identityResolution", Validate = "validate", } export type V3VerifyRequest = { /** * An optional list of addresses submitted by the user for validation. Used with verificationType=validate * * @remarks * to validate user-edited addresses against data-service records via SmartyStreets normalisation. */ addresses?: Array
| undefined; /** * A client-generated unique ID for a specific customer. This can be used by clients to link calls related to the same customer, across different requests or sessions. The format of this ID is defined by the client - Prove recommends using a GUID, but any format can be accepted. Prove does not offer any functionality around the Client Customer ID. Do not include personally identifiable information (PII) in this field. */ clientCustomerId?: string | undefined; /** * An optional client-generated unique ID our Enterprise customer inputs for that consumer across business lines. If the Enterprise customer has been able to identify a consumer across business lines and has a unique identifier for the consumer, they would input this value to Prove. The format of this ID is defined by the client - Prove recommends using a GUID, but any format can be accepted. Do not include personally identifiable information (PII) in this field. */ clientHumanId?: string | undefined; /** * A client-generated unique ID for a specific session. This can be used to identify specific requests. The format of this ID is defined by the client - Prove recommends using a GUID, but any format can be accepted. Do not include Personally Identifiable Information (PII) in this field. */ clientRequestId?: string | undefined; /** * Indicates whether the consumer has provided consent. Accepts true or false. Defaults to false if not provided. */ consent?: boolean | undefined; /** * The email address of the customer. Acceptable characters are: alphanumeric with symbols '@.+'. */ emailAddress?: string | undefined; /** * The first name of the individual. */ firstName?: string | undefined; /** * An optional list of identity attributes */ identityAttributes?: Array | undefined; /** * The public IP address of the session of the individual. Acceptable characters */ ipAddress?: string | undefined; /** * The last name of the individual. */ lastName?: string | undefined; /** * The mobile phone number. US and Canada phone numbers can be passed in with or without a leading `+1`. * * @remarks * International phone numbers require a leading `+` followed by the country code. Use the appropriate endpoint URL * based on the region the number originates from. Acceptable characters are: alphanumeric with symbols '+'. */ phoneNumber: string; /** * PreviousCorrelationID is the correlationId returned by the preceding prefill response. * * @remarks * When provided, it is echoed back in the validate response to link the two flows. */ previousCorrelationId?: string | undefined; /** * The User agent of the session of the individual. */ userAgent?: string | undefined; /** * The verification method based on the use case and authorization level. Current allowed values: "verifiedUser", "accountOpening", "humanAssurance", "prefill", "prefillForBiz", "identityResolution", "validate". */ verificationType: VerificationType; }; /** @internal */ export const VerificationType$inboundSchema: z.ZodNativeEnum< typeof VerificationType > = z.nativeEnum(VerificationType); /** @internal */ export const VerificationType$outboundSchema: z.ZodNativeEnum< typeof VerificationType > = VerificationType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VerificationType$ { /** @deprecated use `VerificationType$inboundSchema` instead. */ export const inboundSchema = VerificationType$inboundSchema; /** @deprecated use `VerificationType$outboundSchema` instead. */ export const outboundSchema = VerificationType$outboundSchema; } /** @internal */ export const V3VerifyRequest$inboundSchema: z.ZodType< V3VerifyRequest, z.ZodTypeDef, unknown > = z.object({ addresses: z.array(Address$inboundSchema).optional(), clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), consent: z.boolean().optional(), emailAddress: z.string().optional(), firstName: z.string().optional(), identityAttributes: z.array(IdentityAttribute$inboundSchema).optional(), ipAddress: z.string().optional(), lastName: z.string().optional(), phoneNumber: z.string(), previousCorrelationId: z.string().optional(), userAgent: z.string().optional(), verificationType: VerificationType$inboundSchema, }); /** @internal */ export type V3VerifyRequest$Outbound = { addresses?: Array | undefined; clientCustomerId?: string | undefined; clientHumanId?: string | undefined; clientRequestId?: string | undefined; consent?: boolean | undefined; emailAddress?: string | undefined; firstName?: string | undefined; identityAttributes?: Array | undefined; ipAddress?: string | undefined; lastName?: string | undefined; phoneNumber: string; previousCorrelationId?: string | undefined; userAgent?: string | undefined; verificationType: string; }; /** @internal */ export const V3VerifyRequest$outboundSchema: z.ZodType< V3VerifyRequest$Outbound, z.ZodTypeDef, V3VerifyRequest > = z.object({ addresses: z.array(Address$outboundSchema).optional(), clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), consent: z.boolean().optional(), emailAddress: z.string().optional(), firstName: z.string().optional(), identityAttributes: z.array(IdentityAttribute$outboundSchema).optional(), ipAddress: z.string().optional(), lastName: z.string().optional(), phoneNumber: z.string(), previousCorrelationId: z.string().optional(), userAgent: z.string().optional(), verificationType: VerificationType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3VerifyRequest$ { /** @deprecated use `V3VerifyRequest$inboundSchema` instead. */ export const inboundSchema = V3VerifyRequest$inboundSchema; /** @deprecated use `V3VerifyRequest$outboundSchema` instead. */ export const outboundSchema = V3VerifyRequest$outboundSchema; /** @deprecated use `V3VerifyRequest$Outbound` instead. */ export type Outbound = V3VerifyRequest$Outbound; } export function v3VerifyRequestToJSON( v3VerifyRequest: V3VerifyRequest, ): string { return JSON.stringify(V3VerifyRequest$outboundSchema.parse(v3VerifyRequest)); } export function v3VerifyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3VerifyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3VerifyRequest' from JSON`, ); }