/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 44b2b6ab528a
 */
import * as z from "zod/v4";
import * as components from "../components/index.js";
import { MistralError } from "./mistralerror.js";
export class HTTPValidationError extends MistralError {
    detail;
    /** The original data that was passed to this error instance. */
    data$;
    constructor(err, httpMeta) {
        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.detail != null)
            this.detail = err.detail;
        this.name = "HTTPValidationError";
    }
}
/** @internal */
export const HTTPValidationError$inboundSchema = z.object({
    detail: z.array(components.ValidationError$inboundSchema).optional(),
    request$: z.custom(x => x instanceof Request),
    response$: z.custom(x => x instanceof Response),
    body$: z.string(),
})
    .transform((v) => {
    return new HTTPValidationError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
//# sourceMappingURL=httpvalidationerror.js.map