"""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 (
    postbyorgbyrepoanalyticsrefreshop as models_postbyorgbyrepoanalyticsrefreshop,
)
from mesa_sdk.types import BaseModel
from typing import Optional


class PostByOrgByRepoAnalyticsRefreshInternalServerErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshInternalServerErrorError


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

    data: PostByOrgByRepoAnalyticsRefreshInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshInternalServerErrorData,
        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 PostByOrgByRepoAnalyticsRefreshConflictErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshConflictError


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

    data: PostByOrgByRepoAnalyticsRefreshConflictErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshConflictErrorData,
        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 PostByOrgByRepoAnalyticsRefreshNotAcceptableErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshNotAcceptableError


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

    data: PostByOrgByRepoAnalyticsRefreshNotAcceptableErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshNotAcceptableErrorData,
        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 PostByOrgByRepoAnalyticsRefreshNotFoundErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshNotFoundError


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

    data: PostByOrgByRepoAnalyticsRefreshNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshNotFoundErrorData,
        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 PostByOrgByRepoAnalyticsRefreshForbiddenErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshForbiddenError


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

    data: PostByOrgByRepoAnalyticsRefreshForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshForbiddenErrorData,
        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 PostByOrgByRepoAnalyticsRefreshUnauthorizedErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshUnauthorizedError


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

    data: PostByOrgByRepoAnalyticsRefreshUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: PostByOrgByRepoAnalyticsRefreshUnauthorizedErrorData,
        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 PostByOrgByRepoAnalyticsRefreshBadRequestErrorData(BaseModel):
    error: models_postbyorgbyrepoanalyticsrefreshop.PostByOrgByRepoAnalyticsRefreshBadRequestError


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

    data: PostByOrgByRepoAnalyticsRefreshBadRequestErrorData = field(hash=False)

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