module TD.Data.PremiumFeature
  (PremiumFeature(..)) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Describes a feature available to Premium users
data PremiumFeature
  = PremiumFeatureIncreasedLimits -- ^ Increased limits
  | PremiumFeatureIncreasedUploadFileSize -- ^ Increased maximum upload file size
  | PremiumFeatureImprovedDownloadSpeed -- ^ Improved download speed
  | PremiumFeatureVoiceRecognition -- ^ The ability to convert voice notes to text
  | PremiumFeatureDisabledAds -- ^ Disabled ads
  | PremiumFeatureUniqueReactions -- ^ Allowed to use more reactions
  | PremiumFeatureUniqueStickers -- ^ Allowed to use premium stickers with unique effects
  | PremiumFeatureCustomEmoji -- ^ Allowed to use custom emoji stickers in message texts and captions
  | PremiumFeatureAdvancedChatManagement -- ^ Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram
  | PremiumFeatureProfileBadge -- ^ A badge in the user's profile
  | PremiumFeatureEmojiStatus -- ^ The ability to show an emoji status along with the user's name
  | PremiumFeatureAnimatedProfilePhoto -- ^ Profile photo animation on message and chat screens
  | PremiumFeatureForumTopicIcon -- ^ The ability to set a custom emoji as a forum topic icon
  | PremiumFeatureAppIcons -- ^ Allowed to set a premium application icons
  | PremiumFeatureRealTimeChatTranslation -- ^ Allowed to translate chat messages real-time
  | PremiumFeatureUpgradedStories -- ^ Allowed to use many additional features for stories
  | PremiumFeatureChatBoost -- ^ The ability to boost chats
  | PremiumFeatureAccentColor -- ^ The ability to choose accent color for replies and user profile
  | PremiumFeatureBackgroundForBoth -- ^ The ability to set private chat background for both users
  | PremiumFeatureSavedMessagesTags -- ^ The ability to use tags in Saved Messages
  | PremiumFeatureMessagePrivacy -- ^ The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict incoming messages from non-contacts using setNewChatPrivacySettings
  | PremiumFeatureLastSeenTimes -- ^ The ability to view last seen and read times of other users even they can't view last seen or read time for the current user
  | PremiumFeatureBusiness -- ^ The ability to use Business features
  | PremiumFeatureMessageEffects -- ^ The ability to use all available message effects
  deriving (PremiumFeature -> PremiumFeature -> Bool
(PremiumFeature -> PremiumFeature -> Bool)
-> (PremiumFeature -> PremiumFeature -> Bool) -> Eq PremiumFeature
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PremiumFeature -> PremiumFeature -> Bool
== :: PremiumFeature -> PremiumFeature -> Bool
$c/= :: PremiumFeature -> PremiumFeature -> Bool
/= :: PremiumFeature -> PremiumFeature -> Bool
Eq, Int -> PremiumFeature -> ShowS
[PremiumFeature] -> ShowS
PremiumFeature -> String
(Int -> PremiumFeature -> ShowS)
-> (PremiumFeature -> String)
-> ([PremiumFeature] -> ShowS)
-> Show PremiumFeature
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PremiumFeature -> ShowS
showsPrec :: Int -> PremiumFeature -> ShowS
$cshow :: PremiumFeature -> String
show :: PremiumFeature -> String
$cshowList :: [PremiumFeature] -> ShowS
showList :: [PremiumFeature] -> ShowS
Show)

instance I.ShortShow PremiumFeature where
  shortShow :: PremiumFeature -> String
shortShow PremiumFeature
PremiumFeatureIncreasedLimits
      = String
"PremiumFeatureIncreasedLimits"
  shortShow PremiumFeature
PremiumFeatureIncreasedUploadFileSize
      = String
"PremiumFeatureIncreasedUploadFileSize"
  shortShow PremiumFeature
PremiumFeatureImprovedDownloadSpeed
      = String
"PremiumFeatureImprovedDownloadSpeed"
  shortShow PremiumFeature
PremiumFeatureVoiceRecognition
      = String
"PremiumFeatureVoiceRecognition"
  shortShow PremiumFeature
PremiumFeatureDisabledAds
      = String
"PremiumFeatureDisabledAds"
  shortShow PremiumFeature
PremiumFeatureUniqueReactions
      = String
"PremiumFeatureUniqueReactions"
  shortShow PremiumFeature
PremiumFeatureUniqueStickers
      = String
"PremiumFeatureUniqueStickers"
  shortShow PremiumFeature
PremiumFeatureCustomEmoji
      = String
"PremiumFeatureCustomEmoji"
  shortShow PremiumFeature
PremiumFeatureAdvancedChatManagement
      = String
"PremiumFeatureAdvancedChatManagement"
  shortShow PremiumFeature
PremiumFeatureProfileBadge
      = String
"PremiumFeatureProfileBadge"
  shortShow PremiumFeature
PremiumFeatureEmojiStatus
      = String
"PremiumFeatureEmojiStatus"
  shortShow PremiumFeature
PremiumFeatureAnimatedProfilePhoto
      = String
"PremiumFeatureAnimatedProfilePhoto"
  shortShow PremiumFeature
PremiumFeatureForumTopicIcon
      = String
"PremiumFeatureForumTopicIcon"
  shortShow PremiumFeature
PremiumFeatureAppIcons
      = String
"PremiumFeatureAppIcons"
  shortShow PremiumFeature
PremiumFeatureRealTimeChatTranslation
      = String
"PremiumFeatureRealTimeChatTranslation"
  shortShow PremiumFeature
PremiumFeatureUpgradedStories
      = String
"PremiumFeatureUpgradedStories"
  shortShow PremiumFeature
PremiumFeatureChatBoost
      = String
"PremiumFeatureChatBoost"
  shortShow PremiumFeature
PremiumFeatureAccentColor
      = String
"PremiumFeatureAccentColor"
  shortShow PremiumFeature
PremiumFeatureBackgroundForBoth
      = String
"PremiumFeatureBackgroundForBoth"
  shortShow PremiumFeature
PremiumFeatureSavedMessagesTags
      = String
"PremiumFeatureSavedMessagesTags"
  shortShow PremiumFeature
PremiumFeatureMessagePrivacy
      = String
"PremiumFeatureMessagePrivacy"
  shortShow PremiumFeature
PremiumFeatureLastSeenTimes
      = String
"PremiumFeatureLastSeenTimes"
  shortShow PremiumFeature
PremiumFeatureBusiness
      = String
"PremiumFeatureBusiness"
  shortShow PremiumFeature
PremiumFeatureMessageEffects
      = String
"PremiumFeatureMessageEffects"

instance AT.FromJSON PremiumFeature where
  parseJSON :: Value -> Parser PremiumFeature
parseJSON (AT.Object Object
obj) = do
    String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String

    case String
t of
      String
"premiumFeatureIncreasedLimits"         -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureIncreasedLimits
      String
"premiumFeatureIncreasedUploadFileSize" -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureIncreasedUploadFileSize
      String
"premiumFeatureImprovedDownloadSpeed"   -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureImprovedDownloadSpeed
      String
"premiumFeatureVoiceRecognition"        -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureVoiceRecognition
      String
"premiumFeatureDisabledAds"             -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureDisabledAds
      String
"premiumFeatureUniqueReactions"         -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureUniqueReactions
      String
"premiumFeatureUniqueStickers"          -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureUniqueStickers
      String
"premiumFeatureCustomEmoji"             -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureCustomEmoji
      String
"premiumFeatureAdvancedChatManagement"  -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureAdvancedChatManagement
      String
"premiumFeatureProfileBadge"            -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureProfileBadge
      String
"premiumFeatureEmojiStatus"             -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureEmojiStatus
      String
"premiumFeatureAnimatedProfilePhoto"    -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureAnimatedProfilePhoto
      String
"premiumFeatureForumTopicIcon"          -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureForumTopicIcon
      String
"premiumFeatureAppIcons"                -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureAppIcons
      String
"premiumFeatureRealTimeChatTranslation" -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureRealTimeChatTranslation
      String
"premiumFeatureUpgradedStories"         -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureUpgradedStories
      String
"premiumFeatureChatBoost"               -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureChatBoost
      String
"premiumFeatureAccentColor"             -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureAccentColor
      String
"premiumFeatureBackgroundForBoth"       -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureBackgroundForBoth
      String
"premiumFeatureSavedMessagesTags"       -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureSavedMessagesTags
      String
"premiumFeatureMessagePrivacy"          -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureMessagePrivacy
      String
"premiumFeatureLastSeenTimes"           -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureLastSeenTimes
      String
"premiumFeatureBusiness"                -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureBusiness
      String
"premiumFeatureMessageEffects"          -> PremiumFeature -> Parser PremiumFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumFeature
PremiumFeatureMessageEffects
      String
_                                       -> Parser PremiumFeature
forall a. Monoid a => a
mempty
    
  parseJSON Value
_ = Parser PremiumFeature
forall a. Monoid a => a
mempty

instance AT.ToJSON PremiumFeature where
  toJSON :: PremiumFeature -> Value
toJSON PremiumFeature
PremiumFeatureIncreasedLimits
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureIncreasedLimits"
        ]
  toJSON PremiumFeature
PremiumFeatureIncreasedUploadFileSize
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureIncreasedUploadFileSize"
        ]
  toJSON PremiumFeature
PremiumFeatureImprovedDownloadSpeed
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureImprovedDownloadSpeed"
        ]
  toJSON PremiumFeature
PremiumFeatureVoiceRecognition
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureVoiceRecognition"
        ]
  toJSON PremiumFeature
PremiumFeatureDisabledAds
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureDisabledAds"
        ]
  toJSON PremiumFeature
PremiumFeatureUniqueReactions
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureUniqueReactions"
        ]
  toJSON PremiumFeature
PremiumFeatureUniqueStickers
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureUniqueStickers"
        ]
  toJSON PremiumFeature
PremiumFeatureCustomEmoji
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureCustomEmoji"
        ]
  toJSON PremiumFeature
PremiumFeatureAdvancedChatManagement
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureAdvancedChatManagement"
        ]
  toJSON PremiumFeature
PremiumFeatureProfileBadge
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureProfileBadge"
        ]
  toJSON PremiumFeature
PremiumFeatureEmojiStatus
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureEmojiStatus"
        ]
  toJSON PremiumFeature
PremiumFeatureAnimatedProfilePhoto
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureAnimatedProfilePhoto"
        ]
  toJSON PremiumFeature
PremiumFeatureForumTopicIcon
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureForumTopicIcon"
        ]
  toJSON PremiumFeature
PremiumFeatureAppIcons
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureAppIcons"
        ]
  toJSON PremiumFeature
PremiumFeatureRealTimeChatTranslation
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureRealTimeChatTranslation"
        ]
  toJSON PremiumFeature
PremiumFeatureUpgradedStories
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureUpgradedStories"
        ]
  toJSON PremiumFeature
PremiumFeatureChatBoost
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureChatBoost"
        ]
  toJSON PremiumFeature
PremiumFeatureAccentColor
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureAccentColor"
        ]
  toJSON PremiumFeature
PremiumFeatureBackgroundForBoth
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureBackgroundForBoth"
        ]
  toJSON PremiumFeature
PremiumFeatureSavedMessagesTags
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureSavedMessagesTags"
        ]
  toJSON PremiumFeature
PremiumFeatureMessagePrivacy
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureMessagePrivacy"
        ]
  toJSON PremiumFeature
PremiumFeatureLastSeenTimes
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureLastSeenTimes"
        ]
  toJSON PremiumFeature
PremiumFeatureBusiness
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureBusiness"
        ]
  toJSON PremiumFeature
PremiumFeatureMessageEffects
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumFeatureMessageEffects"
        ]