2019-12-08 22:43:49 +01:00
|
|
|
from typing import List, Any, Dict
|
|
|
|
|
|
|
|
from bemani.api.exceptions import APIException
|
2021-08-19 21:21:41 +02:00
|
|
|
from bemani.common import APIConstants, GameConstants
|
2019-12-08 22:43:49 +01:00
|
|
|
from bemani.data import Data
|
|
|
|
|
|
|
|
|
|
|
|
class BaseObject:
|
|
|
|
"""
|
|
|
|
A base class which represents a fetchable API object. Every fetchable object
|
|
|
|
will subclass from this and implement one or more version fetches. These
|
|
|
|
are dynamically looked up by the version number provided by the client, so
|
|
|
|
objects can control which versions they reply to by subclassing or ignoring
|
|
|
|
various fetch versions.
|
|
|
|
"""
|
|
|
|
|
2022-10-15 20:56:30 +02:00
|
|
|
def __init__(
|
|
|
|
self, data: Data, game: GameConstants, version: int, omnimix: bool
|
|
|
|
) -> None:
|
2019-12-08 22:43:49 +01:00
|
|
|
self.data = data
|
|
|
|
self.game = game
|
|
|
|
self.version = version
|
|
|
|
self.omnimix = omnimix
|
|
|
|
|
2022-10-15 20:56:30 +02:00
|
|
|
def fetch_v1(
|
|
|
|
self, idtype: APIConstants, ids: List[str], params: Dict[str, Any]
|
|
|
|
) -> Any:
|
|
|
|
raise APIException("Object fetch not supported for this version!")
|