Source code for novauniverse.utils.search

from __future__ import annotations
from typing import overload, NoReturn
from enum import Enum

from ..errors import NovaError

# SearchBy Enum class
# ---------------------
[docs] class SearchBy(Enum): ID = 1 NAME = 2
# Errors # --------
[docs] class SearchGotNoArgs(NovaError): def __init__(self) -> None: super().__init__("'Search()' class must have either id or name passed. Like --> Search(name='UwU Dev Goldy')")
[docs] class SearchNotCompletelySupported(NovaError): def __init__(self, searched_by, interface:object) -> None: super().__init__(f"Searching by '{searched_by}' not supported by '{interface.__class__.__name__}' interface/endpoint.")
# Search class # ---------------