from __future__ import annotations from dataclasses import dataclass from typing import Literal from dmp.rosters.enums import FanDataListType AudiencesOrderBy = Literal[ "name.asc", "name.desc", "fanCount.asc", "fanCount.desc", "createdAt.asc", "createdAt.desc", ] @dataclass(frozen=True) class FanDataListId: id: str type: FanDataListType @classmethod def from_artist_id(cls, id: str) -> FanDataListId: return cls(id=id, type=FanDataListType.ARTIST) @classmethod def from_custom_list_id(cls, id: str) -> FanDataListId: return cls(id=id, type=FanDataListType.CUSTOM_LIST) @property def is_artist(self) -> bool: return self.type == FanDataListType.ARTIST