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


class GetByOrgReposInternalServerErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposInternalServerErrorError


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

    data: GetByOrgReposInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposInternalServerErrorData,
        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 GetByOrgReposConflictErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposConflictError


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

    data: GetByOrgReposConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposConflictErrorData,
        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 GetByOrgReposNotAcceptableErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposNotAcceptableError


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

    data: GetByOrgReposNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposNotAcceptableErrorData,
        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 GetByOrgReposNotFoundErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposNotFoundError


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

    data: GetByOrgReposNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposNotFoundErrorData,
        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 GetByOrgReposForbiddenErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposForbiddenError


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

    data: GetByOrgReposForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposForbiddenErrorData,
        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 GetByOrgReposUnauthorizedErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposUnauthorizedError


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

    data: GetByOrgReposUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgReposUnauthorizedErrorData,
        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 GetByOrgReposBadRequestErrorData(BaseModel):
    error: models_getbyorgreposop.GetByOrgReposBadRequestError


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

    data: GetByOrgReposBadRequestErrorData = field(hash=False)

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