from __future__ import annotations from dataclasses import dataclass from email_campaigns.rosters.enums import FanDataListType @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 @property def is_custom_list(self) -> bool: return self.type == FanDataListType.CUSTOM_LIST