"""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 getbyorgapikeysop as models_getbyorgapikeysop
from mesa_sdk.types import BaseModel
from typing import Optional


class GetByOrgAPIKeysInternalServerErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysInternalServerErrorError


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

    data: GetByOrgAPIKeysInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysInternalServerErrorData,
        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 GetByOrgAPIKeysConflictErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysConflictError


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

    data: GetByOrgAPIKeysConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysConflictErrorData,
        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 GetByOrgAPIKeysNotAcceptableErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysNotAcceptableError


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

    data: GetByOrgAPIKeysNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysNotAcceptableErrorData,
        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 GetByOrgAPIKeysNotFoundErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysNotFoundError


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

    data: GetByOrgAPIKeysNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysNotFoundErrorData,
        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 GetByOrgAPIKeysForbiddenErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysForbiddenError


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

    data: GetByOrgAPIKeysForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysForbiddenErrorData,
        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 GetByOrgAPIKeysUnauthorizedErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysUnauthorizedError


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

    data: GetByOrgAPIKeysUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysUnauthorizedErrorData,
        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 GetByOrgAPIKeysBadRequestErrorData(BaseModel):
    error: models_getbyorgapikeysop.GetByOrgAPIKeysBadRequestError


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

    data: GetByOrgAPIKeysBadRequestErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgAPIKeysBadRequestErrorData,
        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)
