/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type QRCode = { /** * A base64-encoded PNG image of the QR code. */ qrCode: string; }; /** @internal */ export const QRCode$inboundSchema: z.ZodType = z .object({ qrCode: z.string(), }); /** @internal */ export type QRCode$Outbound = { qrCode: string; }; /** @internal */ export const QRCode$outboundSchema: z.ZodType< QRCode$Outbound, z.ZodTypeDef, QRCode > = z.object({ qrCode: z.string(), }); export function qrCodeToJSON(qrCode: QRCode): string { return JSON.stringify(QRCode$outboundSchema.parse(qrCode)); } export function qrCodeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => QRCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QRCode' from JSON`, ); }