import enum from collections.abc import Sequence from dmp.fandata.enums import ( AcquisitionCampaign, AcquisitionChannel, AcquisitionCountry, FanSegment, HeavyRotation, ) class ArtistFanDataType(enum.StrEnum): ACQUISITION_CHANNEL = "ACQUISITION_CHANNEL" HEAVY_ROTATION = "HEAVY_ROTATION" FAN_SEGMENT = "FAN_SEGMENT" ACQUISITION_COUNTRY = "ACQUISITION_COUNTRY" ACQUISITION_CAMPAIGN = "ACQUISITION_CAMPAIGN" @property def enum_type(self) -> type[enum.Enum]: if self == ArtistFanDataType.ACQUISITION_CHANNEL: return AcquisitionChannel elif self == ArtistFanDataType.HEAVY_ROTATION: return HeavyRotation elif self == ArtistFanDataType.FAN_SEGMENT: return FanSegment elif self == ArtistFanDataType.ACQUISITION_COUNTRY: return AcquisitionCountry elif self == ArtistFanDataType.ACQUISITION_CAMPAIGN: return AcquisitionCampaign raise ValueError(f"Unsupported ArtistFanDataType: {self}") class SocialsStatsOrderBy(enum.StrEnum): SPOTIFY_MONTHLY_LISTENERS_ASC = "spotifyMonthlyListeners.asc" SPOTIFY_MONTHLY_LISTENERS_DESC = "spotifyMonthlyListeners.desc" INSTAGRAM_FOLLOWERS_ASC = "instagramFollowers.asc" INSTAGRAM_FOLLOWERS_DESC = "instagramFollowers.desc" TIKTOK_FOLLOWERS_ASC = "tiktokFollowers.asc" TIKTOK_FOLLOWERS_DESC = "tiktokFollowers.desc" SPOTIFY_FOLLOWERS_ASC = "spotifyFollowers.asc" SPOTIFY_FOLLOWERS_DESC = "spotifyFollowers.desc" FACEBOOK_FOLLOWERS_ASC = "facebookFollowers.asc" FACEBOOK_FOLLOWERS_DESC = "facebookFollowers.desc" YOUTUBE_FOLLOWERS_ASC = "youtubeFollowers.asc" YOUTUBE_FOLLOWERS_DESC = "youtubeFollowers.desc" TWITTER_FOLLOWERS_ASC = "twitterFollowers.asc" TWITTER_FOLLOWERS_DESC = "twitterFollowers.desc" SOUNDCLOUD_FOLLOWERS_ASC = "soundcloudFollowers.asc" SOUNDCLOUD_FOLLOWERS_DESC = "soundcloudFollowers.desc" DEEZER_FOLLOWERS_ASC = "deezerFollowers.asc" DEEZER_FOLLOWERS_DESC = "deezerFollowers.desc" @classmethod def list(cls) -> list[str]: return [c.value for c in cls] @classmethod def has_intersection(cls, values: Sequence[str]) -> bool: return bool(set(cls.list()).intersection(set(values))) class VirtualParticipantType(enum.StrEnum): PENDING_ARTIST = "PENDING_ARTIST" CUSTOM_LIST = "CUSTOM_LIST" class ParticipantType(enum.StrEnum): ARTIST = "ARTIST" CUSTOM_LIST = "CUSTOM_LIST"