"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from dub.types import BaseModel
from enum import Enum
from typing import Any, Optional
from typing_extensions import NotRequired, TypedDict


class Code(str, Enum):
    r"""The error code."""

    BAD_REQUEST = "bad_request"
    NOT_FOUND = "not_found"
    INTERNAL_SERVER_ERROR = "internal_server_error"
    UNAUTHORIZED = "unauthorized"
    FORBIDDEN = "forbidden"
    RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
    INVITE_EXPIRED = "invite_expired"
    INVITE_PENDING = "invite_pending"
    EXCEEDED_LIMIT = "exceeded_limit"
    CONFLICT = "conflict"
    UNPROCESSABLE_ENTITY = "unprocessable_entity"


class LinkErrorSchemaTypedDict(TypedDict):
    error: str
    r"""The error message."""
    code: Code
    r"""The error code."""
    link: NotRequired[Any]
    r"""The link that caused the error."""


class LinkErrorSchema(BaseModel):
    error: str
    r"""The error message."""

    code: Code
    r"""The error code."""

    link: Optional[Any] = None
    r"""The link that caused the error."""
