/* * 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 Result = { /** * The unique ID for the attribute value. */ attributeId?: string | undefined; /** * The human-readable name for the issuer of the attribute. */ issuerId?: string | undefined; }; /** @internal */ export const Result$inboundSchema: z.ZodType = z .object({ attributeId: z.string().optional(), issuerId: z.string().optional(), }); /** @internal */ export type Result$Outbound = { attributeId?: string | undefined; issuerId?: string | undefined; }; /** @internal */ export const Result$outboundSchema: z.ZodType< Result$Outbound, z.ZodTypeDef, Result > = z.object({ attributeId: z.string().optional(), issuerId: 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 Result$ { /** @deprecated use `Result$inboundSchema` instead. */ export const inboundSchema = Result$inboundSchema; /** @deprecated use `Result$outboundSchema` instead. */ export const outboundSchema = Result$outboundSchema; /** @deprecated use `Result$Outbound` instead. */ export type Outbound = Result$Outbound; } export function resultToJSON(result: Result): string { return JSON.stringify(Result$outboundSchema.parse(result)); } export function resultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Result$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Result' from JSON`, ); }