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


class GetByOrgByRepoDiffInternalServerErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffInternalServerErrorError


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

    data: GetByOrgByRepoDiffInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffInternalServerErrorData,
        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 GetByOrgByRepoDiffConflictErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffConflictError


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

    data: GetByOrgByRepoDiffConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffConflictErrorData,
        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 GetByOrgByRepoDiffNotAcceptableErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffNotAcceptableError


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

    data: GetByOrgByRepoDiffNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffNotAcceptableErrorData,
        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 GetByOrgByRepoDiffNotFoundErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffNotFoundError


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

    data: GetByOrgByRepoDiffNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffNotFoundErrorData,
        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 GetByOrgByRepoDiffForbiddenErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffForbiddenError


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

    data: GetByOrgByRepoDiffForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffForbiddenErrorData,
        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 GetByOrgByRepoDiffUnauthorizedErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffUnauthorizedError


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

    data: GetByOrgByRepoDiffUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: GetByOrgByRepoDiffUnauthorizedErrorData,
        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 GetByOrgByRepoDiffBadRequestErrorData(BaseModel):
    error: models_getbyorgbyrepodiffop.GetByOrgByRepoDiffBadRequestError


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

    data: GetByOrgByRepoDiffBadRequestErrorData = field(hash=False)

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