/* * 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"; export type V3UnifyBindResponse = { /** * 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 is an upcoming field but is not yet enabled. */ evaluation?: { [k: string]: any } | undefined; /** * The number of the mobile phone used during the process. * * @remarks * * Required */ 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 V3UnifyBindResponse$inboundSchema: z.ZodType< V3UnifyBindResponse, z.ZodTypeDef, unknown > = z.object({ 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 V3UnifyBindResponse$Outbound = { 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 V3UnifyBindResponse$outboundSchema: z.ZodType< V3UnifyBindResponse$Outbound, z.ZodTypeDef, V3UnifyBindResponse > = z.object({ 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 V3UnifyBindResponse$ { /** @deprecated use `V3UnifyBindResponse$inboundSchema` instead. */ export const inboundSchema = V3UnifyBindResponse$inboundSchema; /** @deprecated use `V3UnifyBindResponse$outboundSchema` instead. */ export const outboundSchema = V3UnifyBindResponse$outboundSchema; /** @deprecated use `V3UnifyBindResponse$Outbound` instead. */ export type Outbound = V3UnifyBindResponse$Outbound; } export function v3UnifyBindResponseToJSON( v3UnifyBindResponse: V3UnifyBindResponse, ): string { return JSON.stringify( V3UnifyBindResponse$outboundSchema.parse(v3UnifyBindResponse), ); } export function v3UnifyBindResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3UnifyBindResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3UnifyBindResponse' from JSON`, ); }