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


class DeleteByOrgByRepoBranchesByBranchInternalServerErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchInternalServerErrorError


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

    data: DeleteByOrgByRepoBranchesByBranchInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchInternalServerErrorData,
        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 DeleteByOrgByRepoBranchesByBranchConflictErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchConflictError


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

    data: DeleteByOrgByRepoBranchesByBranchConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchConflictErrorData,
        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 DeleteByOrgByRepoBranchesByBranchNotAcceptableErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchNotAcceptableError


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

    data: DeleteByOrgByRepoBranchesByBranchNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchNotAcceptableErrorData,
        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 DeleteByOrgByRepoBranchesByBranchNotFoundErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchNotFoundError


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

    data: DeleteByOrgByRepoBranchesByBranchNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchNotFoundErrorData,
        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 DeleteByOrgByRepoBranchesByBranchForbiddenErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchForbiddenError


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

    data: DeleteByOrgByRepoBranchesByBranchForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchForbiddenErrorData,
        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 DeleteByOrgByRepoBranchesByBranchUnauthorizedErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchUnauthorizedError


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

    data: DeleteByOrgByRepoBranchesByBranchUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: DeleteByOrgByRepoBranchesByBranchUnauthorizedErrorData,
        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 DeleteByOrgByRepoBranchesByBranchBadRequestErrorData(BaseModel):
    error: models_deletebyorgbyrepobranchesbybranchop.DeleteByOrgByRepoBranchesByBranchBadRequestError


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

    data: DeleteByOrgByRepoBranchesByBranchBadRequestErrorData = field(hash=False)

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