/* * 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 { FetchResult, FetchResult$inboundSchema, FetchResult$Outbound, FetchResult$outboundSchema, } from "./fetchresult.js"; /** * Response body for the Fetch API GET method. */ export type V3FetchResponse = { /** * Array of identity attribute results containing attributeId, issuerId, and attributeValue. */ results: Array; }; /** @internal */ export const V3FetchResponse$inboundSchema: z.ZodType< V3FetchResponse, z.ZodTypeDef, unknown > = z.object({ results: z.array(FetchResult$inboundSchema), }); /** @internal */ export type V3FetchResponse$Outbound = { results: Array; }; /** @internal */ export const V3FetchResponse$outboundSchema: z.ZodType< V3FetchResponse$Outbound, z.ZodTypeDef, V3FetchResponse > = z.object({ results: z.array(FetchResult$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3FetchResponse$ { /** @deprecated use `V3FetchResponse$inboundSchema` instead. */ export const inboundSchema = V3FetchResponse$inboundSchema; /** @deprecated use `V3FetchResponse$outboundSchema` instead. */ export const outboundSchema = V3FetchResponse$outboundSchema; /** @deprecated use `V3FetchResponse$Outbound` instead. */ export type Outbound = V3FetchResponse$Outbound; } export function v3FetchResponseToJSON( v3FetchResponse: V3FetchResponse, ): string { return JSON.stringify(V3FetchResponse$outboundSchema.parse(v3FetchResponse)); } export function v3FetchResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3FetchResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3FetchResponse' from JSON`, ); }