/* * 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 V3ValidateResponse = { /** * True if a DOB or SSN needs to be passed in on the next step. Only applicable to Pre-Fill. If implementing Prove Identity ignore this field. * * @remarks * It will always return false for this use case. */ challengeMissing: boolean; /** * The evaluation result for the policy. This is an upcoming field but is not yet enabled. */ evaluation?: { [k: string]: any } | undefined; /** * The next set of allowed calls in the same flow. */ next: { [k: string]: string }; /** * The number of the mobile phone for which validation was performed. */ phoneNumber?: string | undefined; /** * True if the phone number was validated. */ success: boolean; }; /** @internal */ export const V3ValidateResponse$inboundSchema: z.ZodType< V3ValidateResponse, z.ZodTypeDef, unknown > = z.object({ challengeMissing: z.boolean(), evaluation: z.record(z.any()).optional(), next: z.record(z.string()), phoneNumber: z.string().optional(), success: z.boolean(), }); /** @internal */ export type V3ValidateResponse$Outbound = { challengeMissing: boolean; evaluation?: { [k: string]: any } | undefined; next: { [k: string]: string }; phoneNumber?: string | undefined; success: boolean; }; /** @internal */ export const V3ValidateResponse$outboundSchema: z.ZodType< V3ValidateResponse$Outbound, z.ZodTypeDef, V3ValidateResponse > = z.object({ challengeMissing: z.boolean(), evaluation: z.record(z.any()).optional(), next: z.record(z.string()), phoneNumber: z.string().optional(), success: z.boolean(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3ValidateResponse$ { /** @deprecated use `V3ValidateResponse$inboundSchema` instead. */ export const inboundSchema = V3ValidateResponse$inboundSchema; /** @deprecated use `V3ValidateResponse$outboundSchema` instead. */ export const outboundSchema = V3ValidateResponse$outboundSchema; /** @deprecated use `V3ValidateResponse$Outbound` instead. */ export type Outbound = V3ValidateResponse$Outbound; } export function v3ValidateResponseToJSON( v3ValidateResponse: V3ValidateResponse, ): string { return JSON.stringify( V3ValidateResponse$outboundSchema.parse(v3ValidateResponse), ); } export function v3ValidateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3ValidateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3ValidateResponse' from JSON`, ); }