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

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


class InviteExpiredCode(str, Enum):
    r"""A short code indicating the error code returned."""

    INVITE_EXPIRED = "invite_expired"


class InviteExpiredErrorTypedDict(TypedDict):
    code: InviteExpiredCode
    r"""A short code indicating the error code returned."""
    message: str
    r"""A human readable explanation of what went wrong."""
    doc_url: NotRequired[str]
    r"""A link to our documentation with more details about this error code"""


class InviteExpiredError(BaseModel):
    code: InviteExpiredCode
    r"""A short code indicating the error code returned."""

    message: str
    r"""A human readable explanation of what went wrong."""

    doc_url: Optional[str] = None
    r"""A link to our documentation with more details about this error code"""


class InviteExpiredData(BaseModel):
    error: InviteExpiredError


class InviteExpired(Exception):
    r"""This response is sent when the requested content has been permanently deleted from server, with no forwarding address."""

    data: InviteExpiredData

    def __init__(self, data: InviteExpiredData):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(self.data, InviteExpiredData)
