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

from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from mesa_sdk.errors import MesaError
from mesa_sdk.models import deletebyorgapikeysbyidop as models_deletebyorgapikeysbyidop
from mesa_sdk.types import BaseModel
from typing import Optional


class DeleteByOrgAPIKeysByIDInternalServerErrorData(BaseModel):
    error: (
        models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDInternalServerErrorError
    )


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDInternalServerError(MesaError):
    r"""Internal error"""

    data: DeleteByOrgAPIKeysByIDInternalServerErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDConflictErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDConflictError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDConflictError(MesaError):
    r"""Conflict"""

    data: DeleteByOrgAPIKeysByIDConflictErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDNotAcceptableErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDNotAcceptableError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDNotAcceptableError(MesaError):
    r"""Not acceptable"""

    data: DeleteByOrgAPIKeysByIDNotAcceptableErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDNotFoundErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDNotFoundError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDNotFoundError(MesaError):
    r"""Not found"""

    data: DeleteByOrgAPIKeysByIDNotFoundErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDForbiddenErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDForbiddenError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDForbiddenError(MesaError):
    r"""Forbidden"""

    data: DeleteByOrgAPIKeysByIDForbiddenErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDUnauthorizedErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDUnauthorizedError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDUnauthorizedError(MesaError):
    r"""Unauthorized"""

    data: DeleteByOrgAPIKeysByIDUnauthorizedErrorData = field(hash=False)

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


class DeleteByOrgAPIKeysByIDBadRequestErrorData(BaseModel):
    error: models_deletebyorgapikeysbyidop.DeleteByOrgAPIKeysByIDBadRequestError


@dataclass(unsafe_hash=True)
class DeleteByOrgAPIKeysByIDBadRequestError(MesaError):
    r"""Invalid request"""

    data: DeleteByOrgAPIKeysByIDBadRequestErrorData = field(hash=False)

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