2022-06-19 06:45:36 +12:00
|
|
|
from dataclasses import dataclass
|
|
|
|
from typing import Optional, List, Dict
|
|
|
|
|
2023-02-06 20:45:30 +13:00
|
|
|
from legendary.models.game import Game, SaveGameFile
|
|
|
|
|
2022-06-19 06:45:36 +12:00
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class ApiResults:
|
2023-02-06 20:45:30 +13:00
|
|
|
game_list: Optional[List[Game]] = None
|
|
|
|
dlcs: Optional[Dict[str, List[Game]]] = None
|
2022-06-19 06:45:36 +12:00
|
|
|
bit32_games: Optional[List] = None
|
|
|
|
mac_games: Optional[List] = None
|
2023-02-06 20:45:30 +13:00
|
|
|
no_asset_games: Optional[List[Game]] = None
|
|
|
|
saves: Optional[List[SaveGameFile]] = None
|
2022-06-19 06:45:36 +12:00
|
|
|
|
|
|
|
def __bool__(self):
|
|
|
|
return (
|
|
|
|
self.game_list is not None
|
|
|
|
and self.dlcs is not None
|
|
|
|
and self.bit32_games is not None
|
|
|
|
and self.mac_games is not None
|
|
|
|
and self.no_asset_games is not None
|
|
|
|
and self.saves is not None
|
|
|
|
)
|