/* * 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 V3UnifyResponse = { /** * The one-time use JWT for the client-side SDK. */ authToken?: string | undefined; /** * The unique ID that Prove generates for the flow. To continue the flow, the field will also be used for each of the subsequent API calls in the same flow - it cannot be reused outside of a single flow. */ correlationId: string; /** * The status of the Unify request. */ success: string; }; /** @internal */ export const V3UnifyResponse$inboundSchema: z.ZodType< V3UnifyResponse, z.ZodTypeDef, unknown > = z.object({ authToken: z.string().optional(), correlationId: z.string(), success: z.string(), }); /** @internal */ export type V3UnifyResponse$Outbound = { authToken?: string | undefined; correlationId: string; success: string; }; /** @internal */ export const V3UnifyResponse$outboundSchema: z.ZodType< V3UnifyResponse$Outbound, z.ZodTypeDef, V3UnifyResponse > = z.object({ authToken: z.string().optional(), correlationId: z.string(), 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 V3UnifyResponse$ { /** @deprecated use `V3UnifyResponse$inboundSchema` instead. */ export const inboundSchema = V3UnifyResponse$inboundSchema; /** @deprecated use `V3UnifyResponse$outboundSchema` instead. */ export const outboundSchema = V3UnifyResponse$outboundSchema; /** @deprecated use `V3UnifyResponse$Outbound` instead. */ export type Outbound = V3UnifyResponse$Outbound; } export function v3UnifyResponseToJSON( v3UnifyResponse: V3UnifyResponse, ): string { return JSON.stringify(V3UnifyResponse$outboundSchema.parse(v3UnifyResponse)); } export function v3UnifyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3UnifyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3UnifyResponse' from JSON`, ); }