/* * 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 { IDVDataInternal, IDVDataInternal$inboundSchema, IDVDataInternal$Outbound, IDVDataInternal$outboundSchema, } from "./idvdatainternal.js"; import { KYCInternal, KYCInternal$inboundSchema, KYCInternal$Outbound, KYCInternal$outboundSchema, } from "./kycinternal.js"; export type V3CompleteResponse = { /** * The evaluation result for the policy */ evaluation?: { [k: string]: any } | undefined; idv?: IDVDataInternal | undefined; kyc?: KYCInternal | undefined; /** * The next set of allowed calls in the same flow. */ next: { [k: string]: string }; /** * True if the individual was verified successfully. */ success: boolean; }; /** @internal */ export const V3CompleteResponse$inboundSchema: z.ZodType< V3CompleteResponse, z.ZodTypeDef, unknown > = z.object({ evaluation: z.record(z.any()).optional(), idv: IDVDataInternal$inboundSchema.optional(), kyc: KYCInternal$inboundSchema.optional(), next: z.record(z.string()), success: z.boolean(), }); /** @internal */ export type V3CompleteResponse$Outbound = { evaluation?: { [k: string]: any } | undefined; idv?: IDVDataInternal$Outbound | undefined; kyc?: KYCInternal$Outbound | undefined; next: { [k: string]: string }; success: boolean; }; /** @internal */ export const V3CompleteResponse$outboundSchema: z.ZodType< V3CompleteResponse$Outbound, z.ZodTypeDef, V3CompleteResponse > = z.object({ evaluation: z.record(z.any()).optional(), idv: IDVDataInternal$outboundSchema.optional(), kyc: KYCInternal$outboundSchema.optional(), next: z.record(z.string()), 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 V3CompleteResponse$ { /** @deprecated use `V3CompleteResponse$inboundSchema` instead. */ export const inboundSchema = V3CompleteResponse$inboundSchema; /** @deprecated use `V3CompleteResponse$outboundSchema` instead. */ export const outboundSchema = V3CompleteResponse$outboundSchema; /** @deprecated use `V3CompleteResponse$Outbound` instead. */ export type Outbound = V3CompleteResponse$Outbound; } export function v3CompleteResponseToJSON( v3CompleteResponse: V3CompleteResponse, ): string { return JSON.stringify( V3CompleteResponse$outboundSchema.parse(v3CompleteResponse), ); } export function v3CompleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3CompleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3CompleteResponse' from JSON`, ); }