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


class GetByOrgByRepoSyncInternalServerErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncInternalServerErrorError


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

    data: GetByOrgByRepoSyncInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncInternalServerErrorData,
        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 GetByOrgByRepoSyncConflictErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncConflictError


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

    data: GetByOrgByRepoSyncConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncConflictErrorData,
        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 GetByOrgByRepoSyncNotAcceptableErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncNotAcceptableError


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

    data: GetByOrgByRepoSyncNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncNotAcceptableErrorData,
        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 GetByOrgByRepoSyncNotFoundErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncNotFoundError


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

    data: GetByOrgByRepoSyncNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncNotFoundErrorData,
        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 GetByOrgByRepoSyncForbiddenErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncForbiddenError


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

    data: GetByOrgByRepoSyncForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncForbiddenErrorData,
        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 GetByOrgByRepoSyncUnauthorizedErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncUnauthorizedError


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

    data: GetByOrgByRepoSyncUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoSyncUnauthorizedErrorData,
        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 GetByOrgByRepoSyncBadRequestErrorData(BaseModel):
    error: models_getbyorgbyreposyncop.GetByOrgByRepoSyncBadRequestError


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

    data: GetByOrgByRepoSyncBadRequestErrorData = field(hash=False)

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