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


class DeleteByOrgByRepoInternalServerErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoInternalServerErrorError


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

    data: DeleteByOrgByRepoInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoInternalServerErrorData,
        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 DeleteByOrgByRepoConflictErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoConflictError


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

    data: DeleteByOrgByRepoConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoConflictErrorData,
        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 DeleteByOrgByRepoNotAcceptableErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoNotAcceptableError


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

    data: DeleteByOrgByRepoNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoNotAcceptableErrorData,
        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 DeleteByOrgByRepoNotFoundErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoNotFoundError


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

    data: DeleteByOrgByRepoNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoNotFoundErrorData,
        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 DeleteByOrgByRepoForbiddenErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoForbiddenError


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

    data: DeleteByOrgByRepoForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoForbiddenErrorData,
        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 DeleteByOrgByRepoUnauthorizedErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoUnauthorizedError


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

    data: DeleteByOrgByRepoUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoUnauthorizedErrorData,
        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 DeleteByOrgByRepoBadRequestErrorData(BaseModel):
    error: models_deletebyorgbyrepoop.DeleteByOrgByRepoBadRequestError


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

    data: DeleteByOrgByRepoBadRequestErrorData = field(hash=False)

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