"""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 (
    getbyorgbyrepoagentblameop as models_getbyorgbyrepoagentblameop,
)
from mesa_sdk.types import BaseModel
from typing import Optional


class GetByOrgByRepoAgentblameInternalServerErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameInternalServerErrorError


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

    data: GetByOrgByRepoAgentblameInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameInternalServerErrorData,
        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 GetByOrgByRepoAgentblameConflictErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameConflictError


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

    data: GetByOrgByRepoAgentblameConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameConflictErrorData,
        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 GetByOrgByRepoAgentblameNotAcceptableErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameNotAcceptableError


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

    data: GetByOrgByRepoAgentblameNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameNotAcceptableErrorData,
        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 GetByOrgByRepoAgentblameNotFoundErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameNotFoundError


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

    data: GetByOrgByRepoAgentblameNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameNotFoundErrorData,
        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 GetByOrgByRepoAgentblameForbiddenErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameForbiddenError


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

    data: GetByOrgByRepoAgentblameForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameForbiddenErrorData,
        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 GetByOrgByRepoAgentblameUnauthorizedErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameUnauthorizedError


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

    data: GetByOrgByRepoAgentblameUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoAgentblameUnauthorizedErrorData,
        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 GetByOrgByRepoAgentblameBadRequestErrorData(BaseModel):
    error: models_getbyorgbyrepoagentblameop.GetByOrgByRepoAgentblameBadRequestError


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

    data: GetByOrgByRepoAgentblameBadRequestErrorData = field(hash=False)

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