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


class GetByOrgByRepoCommitsInternalServerErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsInternalServerErrorError


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

    data: GetByOrgByRepoCommitsInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsInternalServerErrorData,
        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 GetByOrgByRepoCommitsConflictErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsConflictError


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

    data: GetByOrgByRepoCommitsConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsConflictErrorData,
        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 GetByOrgByRepoCommitsNotAcceptableErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsNotAcceptableError


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

    data: GetByOrgByRepoCommitsNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsNotAcceptableErrorData,
        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 GetByOrgByRepoCommitsNotFoundErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsNotFoundError


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

    data: GetByOrgByRepoCommitsNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsNotFoundErrorData,
        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 GetByOrgByRepoCommitsForbiddenErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsForbiddenError


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

    data: GetByOrgByRepoCommitsForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsForbiddenErrorData,
        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 GetByOrgByRepoCommitsUnauthorizedErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsUnauthorizedError


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

    data: GetByOrgByRepoCommitsUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoCommitsUnauthorizedErrorData,
        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 GetByOrgByRepoCommitsBadRequestErrorData(BaseModel):
    error: models_getbyorgbyrepocommitsop.GetByOrgByRepoCommitsBadRequestError


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

    data: GetByOrgByRepoCommitsBadRequestErrorData = field(hash=False)

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