/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 638baed27456
 */
import * as z from "zod/v4";
import * as components from "../components/index.js";
import { MistralError } from "./mistralerror.js";
export class ObservabilityError extends MistralError {
    detail;
    /** The original data that was passed to this error instance. */
    data$;
    constructor(err, httpMeta) {
        const message = err.detail?.message
            || `API error occurred: ${JSON.stringify(err)}`;
        super(message, httpMeta);
        this.data$ = err;
        this.detail = err.detail;
        this.name = "ObservabilityError";
    }
}
/** @internal */
export const ObservabilityError$inboundSchema = z.object({
    detail: components.ObservabilityErrorDetail$inboundSchema,
    request$: z.custom(x => x instanceof Request),
    response$: z.custom(x => x instanceof Response),
    body$: z.string(),
})
    .transform((v) => {
    return new ObservabilityError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
//# sourceMappingURL=observabilityerror.js.map