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


class DeleteByOrgByRepoWebhooksByWebhookIDInternalServerErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDInternalServerErrorError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDInternalServerErrorData = field(
        hash=False
    )

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDInternalServerErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDConflictErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDConflictError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDConflictErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDNotAcceptableErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDNotAcceptableError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDNotAcceptableErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDNotFoundErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDNotFoundError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDNotFoundErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDForbiddenErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDForbiddenError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDForbiddenErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDUnauthorizedErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDUnauthorizedError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoWebhooksByWebhookIDUnauthorizedErrorData,
        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 DeleteByOrgByRepoWebhooksByWebhookIDBadRequestErrorData(BaseModel):
    error: models_deletebyorgbyrepowebhooksbywebhookidop.DeleteByOrgByRepoWebhooksByWebhookIDBadRequestError


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

    data: DeleteByOrgByRepoWebhooksByWebhookIDBadRequestErrorData = field(hash=False)

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