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

from __future__ import annotations
import httpx
from typing import List, Optional, Union
from typing_extensions import TypeAliasType
from unstructured_client.models.errors import UnstructuredClientError
from unstructured_client.models.shared import validationerror as shared_validationerror
from unstructured_client.types import BaseModel


DetailTypedDict = TypeAliasType(
    "DetailTypedDict", Union[List[shared_validationerror.ValidationErrorTypedDict], str]
)


Detail = TypeAliasType(
    "Detail", Union[List[shared_validationerror.ValidationError], str]
)


class HTTPValidationErrorData(BaseModel):
    detail: Optional[Detail] = None


class HTTPValidationError(UnstructuredClientError):
    data: HTTPValidationErrorData

    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)
        self.data = data
