/* * 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 { IdentityAttribute, IdentityAttribute$inboundSchema, IdentityAttribute$Outbound, IdentityAttribute$outboundSchema, } from "./identityattribute.js"; /** * Request body for the V3 Enroll Identity API. */ export type V3EnrollIdentityRequest = { /** * 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. 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; /** * A string that is the unique identifier for the Prove Key on the device. Only applicable if you are leveraging Prove Unify. */ deviceId?: string | undefined; /** * Attributes is a list of objects contains attribute Type and Value. */ identityAttributes?: Array | undefined; /** * The number of the consumer being enrolled. 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. Acceptable characters are: alphanumeric with symbols '+'. */ phoneNumber: string; }; /** @internal */ export const V3EnrollIdentityRequest$inboundSchema: z.ZodType< V3EnrollIdentityRequest, z.ZodTypeDef, unknown > = z.object({ clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), deviceId: z.string().optional(), identityAttributes: z.array(IdentityAttribute$inboundSchema).optional(), phoneNumber: z.string(), }); /** @internal */ export type V3EnrollIdentityRequest$Outbound = { clientCustomerId?: string | undefined; clientHumanId?: string | undefined; clientRequestId?: string | undefined; deviceId?: string | undefined; identityAttributes?: Array | undefined; phoneNumber: string; }; /** @internal */ export const V3EnrollIdentityRequest$outboundSchema: z.ZodType< V3EnrollIdentityRequest$Outbound, z.ZodTypeDef, V3EnrollIdentityRequest > = z.object({ clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), deviceId: z.string().optional(), identityAttributes: z.array(IdentityAttribute$outboundSchema).optional(), phoneNumber: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3EnrollIdentityRequest$ { /** @deprecated use `V3EnrollIdentityRequest$inboundSchema` instead. */ export const inboundSchema = V3EnrollIdentityRequest$inboundSchema; /** @deprecated use `V3EnrollIdentityRequest$outboundSchema` instead. */ export const outboundSchema = V3EnrollIdentityRequest$outboundSchema; /** @deprecated use `V3EnrollIdentityRequest$Outbound` instead. */ export type Outbound = V3EnrollIdentityRequest$Outbound; } export function v3EnrollIdentityRequestToJSON( v3EnrollIdentityRequest: V3EnrollIdentityRequest, ): string { return JSON.stringify( V3EnrollIdentityRequest$outboundSchema.parse(v3EnrollIdentityRequest), ); } export function v3EnrollIdentityRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3EnrollIdentityRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3EnrollIdentityRequest' from JSON`, ); }