/* * 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 { AuthenticationResults, AuthenticationResults$inboundSchema, AuthenticationResults$Outbound, AuthenticationResults$outboundSchema, } from "./authenticationresults.js"; export type V3UnifyStatusResponse = { authenticationResults?: AuthenticationResults | undefined; /** * A client-generated unique ID to identify a specific customer across business lines. * * @remarks * Required if success=true. */ clientHumanId?: string | undefined; /** * A client-generated unique ID for a specific session. This can be used to identify specific requests. * * @remarks * 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; /** * The unique identifier for the Prove Key on the device. * * @remarks * Required if success=true. */ deviceId?: string | undefined; /** * The evaluation result for the policy. This will contain keys titled "authentication" and "risk" that encompass the different evaluation categories. */ evaluation?: { [k: string]: any } | undefined; /** * The number of the mobile phone used during the process. * * @remarks * * Required except when MobileAuth is used in US or a valid ProveID is provided. */ phoneNumber?: string | undefined; /** * A unique ID to identify a specific customer obtained from a successful possession check. * * @remarks * If an existing value is available (e.g. from a previous successful possession check) then it should be returned, otherwise a new value should be generated if success=true. * Required if success=true. */ proveId?: string | undefined; /** * The result of the possession check. * * @remarks * Possible values are `true`, `false`, `pending`, and `possession_required`. */ success: string; }; /** @internal */ export const V3UnifyStatusResponse$inboundSchema: z.ZodType< V3UnifyStatusResponse, z.ZodTypeDef, unknown > = z.object({ authenticationResults: AuthenticationResults$inboundSchema.optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), deviceId: z.string().optional(), evaluation: z.record(z.any()).optional(), phoneNumber: z.string().optional(), proveId: z.string().optional(), success: z.string(), }); /** @internal */ export type V3UnifyStatusResponse$Outbound = { authenticationResults?: AuthenticationResults$Outbound | undefined; clientHumanId?: string | undefined; clientRequestId?: string | undefined; deviceId?: string | undefined; evaluation?: { [k: string]: any } | undefined; phoneNumber?: string | undefined; proveId?: string | undefined; success: string; }; /** @internal */ export const V3UnifyStatusResponse$outboundSchema: z.ZodType< V3UnifyStatusResponse$Outbound, z.ZodTypeDef, V3UnifyStatusResponse > = z.object({ authenticationResults: AuthenticationResults$outboundSchema.optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), deviceId: z.string().optional(), evaluation: z.record(z.any()).optional(), phoneNumber: z.string().optional(), proveId: z.string().optional(), success: 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 V3UnifyStatusResponse$ { /** @deprecated use `V3UnifyStatusResponse$inboundSchema` instead. */ export const inboundSchema = V3UnifyStatusResponse$inboundSchema; /** @deprecated use `V3UnifyStatusResponse$outboundSchema` instead. */ export const outboundSchema = V3UnifyStatusResponse$outboundSchema; /** @deprecated use `V3UnifyStatusResponse$Outbound` instead. */ export type Outbound = V3UnifyStatusResponse$Outbound; } export function v3UnifyStatusResponseToJSON( v3UnifyStatusResponse: V3UnifyStatusResponse, ): string { return JSON.stringify( V3UnifyStatusResponse$outboundSchema.parse(v3UnifyStatusResponse), ); } export function v3UnifyStatusResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3UnifyStatusResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3UnifyStatusResponse' from JSON`, ); }