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

from __future__ import annotations
import httpx
from typing import Optional
from unstructured_client.models.errors import UnstructuredClientError
from unstructured_client.types import BaseModel


class ServerErrorData(BaseModel):
    detail: Optional[str] = None


class ServerError(UnstructuredClientError):
    data: ServerErrorData

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