/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3FetchRequestRequest = { /** * A unique Prove-generated identifier for the enrolled identity (UUID). */ proveId: string; /** * A unique identifier for the identity attribute (UUID), as returned by the discover endpoint. */ attributeId: string; /** * A client-generated unique ID for a specific session. This can be used to identify specific requests. 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; }; export type V3FetchRequestResponse = { httpMeta: components.HTTPMetadata; /** * V3FetchResponse */ v3FetchResponse?: components.V3FetchResponse | undefined; }; /** @internal */ export const V3FetchRequestRequest$inboundSchema: z.ZodType< V3FetchRequestRequest, z.ZodTypeDef, unknown > = z.object({ proveId: z.string(), attributeId: z.string(), clientRequestId: z.string().optional(), }); /** @internal */ export type V3FetchRequestRequest$Outbound = { proveId: string; attributeId: string; clientRequestId?: string | undefined; }; /** @internal */ export const V3FetchRequestRequest$outboundSchema: z.ZodType< V3FetchRequestRequest$Outbound, z.ZodTypeDef, V3FetchRequestRequest > = z.object({ proveId: z.string(), attributeId: z.string(), clientRequestId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3FetchRequestRequest$ { /** @deprecated use `V3FetchRequestRequest$inboundSchema` instead. */ export const inboundSchema = V3FetchRequestRequest$inboundSchema; /** @deprecated use `V3FetchRequestRequest$outboundSchema` instead. */ export const outboundSchema = V3FetchRequestRequest$outboundSchema; /** @deprecated use `V3FetchRequestRequest$Outbound` instead. */ export type Outbound = V3FetchRequestRequest$Outbound; } export function v3FetchRequestRequestToJSON( v3FetchRequestRequest: V3FetchRequestRequest, ): string { return JSON.stringify( V3FetchRequestRequest$outboundSchema.parse(v3FetchRequestRequest), ); } export function v3FetchRequestRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3FetchRequestRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3FetchRequestRequest' from JSON`, ); } /** @internal */ export const V3FetchRequestResponse$inboundSchema: z.ZodType< V3FetchRequestResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, V3FetchResponse: components.V3FetchResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "V3FetchResponse": "v3FetchResponse", }); }); /** @internal */ export type V3FetchRequestResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; V3FetchResponse?: components.V3FetchResponse$Outbound | undefined; }; /** @internal */ export const V3FetchRequestResponse$outboundSchema: z.ZodType< V3FetchRequestResponse$Outbound, z.ZodTypeDef, V3FetchRequestResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, v3FetchResponse: components.V3FetchResponse$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", v3FetchResponse: "V3FetchResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3FetchRequestResponse$ { /** @deprecated use `V3FetchRequestResponse$inboundSchema` instead. */ export const inboundSchema = V3FetchRequestResponse$inboundSchema; /** @deprecated use `V3FetchRequestResponse$outboundSchema` instead. */ export const outboundSchema = V3FetchRequestResponse$outboundSchema; /** @deprecated use `V3FetchRequestResponse$Outbound` instead. */ export type Outbound = V3FetchRequestResponse$Outbound; } export function v3FetchRequestResponseToJSON( v3FetchRequestResponse: V3FetchRequestResponse, ): string { return JSON.stringify( V3FetchRequestResponse$outboundSchema.parse(v3FetchRequestResponse), ); } export function v3FetchRequestResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3FetchRequestResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3FetchRequestResponse' from JSON`, ); }