/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { MoovError } from "./mooverror.js"; export type ImageMetadataValidationErrorData = { altText?: string | undefined; }; export class ImageMetadataValidationError extends MoovError { altText?: string | undefined; /** The original data that was passed to this error instance. */ data$: ImageMetadataValidationErrorData; constructor( err: ImageMetadataValidationErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.altText != null) this.altText = err.altText; this.name = "ImageMetadataValidationError"; } } /** @internal */ export const ImageMetadataValidationError$inboundSchema: z.ZodType< ImageMetadataValidationError, z.ZodTypeDef, unknown > = z.object({ altText: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new ImageMetadataValidationError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type ImageMetadataValidationError$Outbound = { altText?: string | undefined; }; /** @internal */ export const ImageMetadataValidationError$outboundSchema: z.ZodType< ImageMetadataValidationError$Outbound, z.ZodTypeDef, ImageMetadataValidationError > = z.instanceof(ImageMetadataValidationError) .transform(v => v.data$) .pipe(z.object({ altText: z.string().optional(), }));