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


class GetByOrgByRepoContentInternalServerErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentInternalServerErrorError


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

    data: GetByOrgByRepoContentInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentInternalServerErrorData,
        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 GetByOrgByRepoContentConflictErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentConflictError


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

    data: GetByOrgByRepoContentConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentConflictErrorData,
        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 GetByOrgByRepoContentNotAcceptableErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentNotAcceptableError


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

    data: GetByOrgByRepoContentNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentNotAcceptableErrorData,
        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 GetByOrgByRepoContentNotFoundErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentNotFoundError


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

    data: GetByOrgByRepoContentNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentNotFoundErrorData,
        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 GetByOrgByRepoContentForbiddenErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentForbiddenError


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

    data: GetByOrgByRepoContentForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentForbiddenErrorData,
        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 GetByOrgByRepoContentUnauthorizedErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentUnauthorizedError


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

    data: GetByOrgByRepoContentUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoContentUnauthorizedErrorData,
        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 GetByOrgByRepoContentBadRequestErrorData(BaseModel):
    error: models_getbyorgbyrepocontentop.GetByOrgByRepoContentBadRequestError


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

    data: GetByOrgByRepoContentBadRequestErrorData = field(hash=False)

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