/* * 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 FetchResult = { /** * A unique Prove-generated identifier for the identity attribute. This is a UUID that can be used to reference the attribute in future requests. */ attributeId: string; /** * The actual value of the identity attribute. For example, if the attributeType is "walletId", this would contain the actual wallet identifier from the issuer. */ attributeValue: string; /** * A human-readable name for the issuer of the attribute. This identifies the partner or service provider that issued the attribute (e.g., "Aeropay", "Google Pay", "Apple Pay"). */ issuerId: string; }; /** @internal */ export const FetchResult$inboundSchema: z.ZodType< FetchResult, z.ZodTypeDef, unknown > = z.object({ attributeId: z.string(), attributeValue: z.string(), issuerId: z.string(), }); /** @internal */ export type FetchResult$Outbound = { attributeId: string; attributeValue: string; issuerId: string; }; /** @internal */ export const FetchResult$outboundSchema: z.ZodType< FetchResult$Outbound, z.ZodTypeDef, FetchResult > = z.object({ attributeId: z.string(), attributeValue: z.string(), issuerId: 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 FetchResult$ { /** @deprecated use `FetchResult$inboundSchema` instead. */ export const inboundSchema = FetchResult$inboundSchema; /** @deprecated use `FetchResult$outboundSchema` instead. */ export const outboundSchema = FetchResult$outboundSchema; /** @deprecated use `FetchResult$Outbound` instead. */ export type Outbound = FetchResult$Outbound; } export function fetchResultToJSON(fetchResult: FetchResult): string { return JSON.stringify(FetchResult$outboundSchema.parse(fetchResult)); } export function fetchResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FetchResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FetchResult' from JSON`, ); }