"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from mistralai.azure.client.errors import MistralAzureError
from mistralai.azure.client.models import validationerror as models_validationerror
from mistralai.azure.client.types import BaseModel
from typing import List, Optional


class HTTPValidationErrorData(BaseModel):
    detail: Optional[List[models_validationerror.ValidationError]] = None


@dataclass(unsafe_hash=True)
class HTTPValidationError(MistralAzureError):
    data: HTTPValidationErrorData = field(hash=False)

    def __init__(
        self,
        data: HTTPValidationErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)
