"""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
from typing_extensions import NotRequired, TypedDict


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

    NOT_FOUND = "not_found"


class NotFoundErrorTypedDict(TypedDict):
    code: NotFoundCode
    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 NotFoundError(BaseModel):
    code: NotFoundCode
    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 NotFoundData(BaseModel):
    error: NotFoundError


class NotFound(Exception):
    r"""The server cannot find the requested resource."""

    data: NotFoundData

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

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