module TD.Data.PremiumLimitType
  (PremiumLimitType(..)) where

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

-- | Describes type of limit, increased for Premium users
data PremiumLimitType
  = PremiumLimitTypeSupergroupCount -- ^ The maximum number of joined supergroups and channels
  | PremiumLimitTypePinnedChatCount -- ^ The maximum number of pinned chats in the main chat list
  | PremiumLimitTypeCreatedPublicChatCount -- ^ The maximum number of created public chats
  | PremiumLimitTypeSavedAnimationCount -- ^ The maximum number of saved animations
  | PremiumLimitTypeFavoriteStickerCount -- ^ The maximum number of favorite stickers
  | PremiumLimitTypeChatFolderCount -- ^ The maximum number of chat folders
  | PremiumLimitTypeChatFolderChosenChatCount -- ^ The maximum number of pinned and always included, or always excluded chats in a chat folder
  | PremiumLimitTypePinnedArchivedChatCount -- ^ The maximum number of pinned chats in the archive chat list
  | PremiumLimitTypePinnedSavedMessagesTopicCount -- ^ The maximum number of pinned Saved Messages topics
  | PremiumLimitTypeCaptionLength -- ^ The maximum length of sent media caption
  | PremiumLimitTypeBioLength -- ^ The maximum length of the user's bio
  | PremiumLimitTypeChatFolderInviteLinkCount -- ^ The maximum number of invite links for a chat folder
  | PremiumLimitTypeShareableChatFolderCount -- ^ The maximum number of added shareable chat folders
  | PremiumLimitTypeActiveStoryCount -- ^ The maximum number of active stories
  | PremiumLimitTypeWeeklySentStoryCount -- ^ The maximum number of stories sent per week
  | PremiumLimitTypeMonthlySentStoryCount -- ^ The maximum number of stories sent per month
  | PremiumLimitTypeStoryCaptionLength -- ^ The maximum length of captions of sent stories
  | PremiumLimitTypeStorySuggestedReactionAreaCount -- ^ The maximum number of suggested reaction areas on a story
  | PremiumLimitTypeSimilarChatCount -- ^ The maximum number of received similar chats
  deriving (PremiumLimitType -> PremiumLimitType -> Bool
(PremiumLimitType -> PremiumLimitType -> Bool)
-> (PremiumLimitType -> PremiumLimitType -> Bool)
-> Eq PremiumLimitType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PremiumLimitType -> PremiumLimitType -> Bool
== :: PremiumLimitType -> PremiumLimitType -> Bool
$c/= :: PremiumLimitType -> PremiumLimitType -> Bool
/= :: PremiumLimitType -> PremiumLimitType -> Bool
Eq, Int -> PremiumLimitType -> ShowS
[PremiumLimitType] -> ShowS
PremiumLimitType -> String
(Int -> PremiumLimitType -> ShowS)
-> (PremiumLimitType -> String)
-> ([PremiumLimitType] -> ShowS)
-> Show PremiumLimitType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PremiumLimitType -> ShowS
showsPrec :: Int -> PremiumLimitType -> ShowS
$cshow :: PremiumLimitType -> String
show :: PremiumLimitType -> String
$cshowList :: [PremiumLimitType] -> ShowS
showList :: [PremiumLimitType] -> ShowS
Show)

instance I.ShortShow PremiumLimitType where
  shortShow :: PremiumLimitType -> String
shortShow PremiumLimitType
PremiumLimitTypeSupergroupCount
      = String
"PremiumLimitTypeSupergroupCount"
  shortShow PremiumLimitType
PremiumLimitTypePinnedChatCount
      = String
"PremiumLimitTypePinnedChatCount"
  shortShow PremiumLimitType
PremiumLimitTypeCreatedPublicChatCount
      = String
"PremiumLimitTypeCreatedPublicChatCount"
  shortShow PremiumLimitType
PremiumLimitTypeSavedAnimationCount
      = String
"PremiumLimitTypeSavedAnimationCount"
  shortShow PremiumLimitType
PremiumLimitTypeFavoriteStickerCount
      = String
"PremiumLimitTypeFavoriteStickerCount"
  shortShow PremiumLimitType
PremiumLimitTypeChatFolderCount
      = String
"PremiumLimitTypeChatFolderCount"
  shortShow PremiumLimitType
PremiumLimitTypeChatFolderChosenChatCount
      = String
"PremiumLimitTypeChatFolderChosenChatCount"
  shortShow PremiumLimitType
PremiumLimitTypePinnedArchivedChatCount
      = String
"PremiumLimitTypePinnedArchivedChatCount"
  shortShow PremiumLimitType
PremiumLimitTypePinnedSavedMessagesTopicCount
      = String
"PremiumLimitTypePinnedSavedMessagesTopicCount"
  shortShow PremiumLimitType
PremiumLimitTypeCaptionLength
      = String
"PremiumLimitTypeCaptionLength"
  shortShow PremiumLimitType
PremiumLimitTypeBioLength
      = String
"PremiumLimitTypeBioLength"
  shortShow PremiumLimitType
PremiumLimitTypeChatFolderInviteLinkCount
      = String
"PremiumLimitTypeChatFolderInviteLinkCount"
  shortShow PremiumLimitType
PremiumLimitTypeShareableChatFolderCount
      = String
"PremiumLimitTypeShareableChatFolderCount"
  shortShow PremiumLimitType
PremiumLimitTypeActiveStoryCount
      = String
"PremiumLimitTypeActiveStoryCount"
  shortShow PremiumLimitType
PremiumLimitTypeWeeklySentStoryCount
      = String
"PremiumLimitTypeWeeklySentStoryCount"
  shortShow PremiumLimitType
PremiumLimitTypeMonthlySentStoryCount
      = String
"PremiumLimitTypeMonthlySentStoryCount"
  shortShow PremiumLimitType
PremiumLimitTypeStoryCaptionLength
      = String
"PremiumLimitTypeStoryCaptionLength"
  shortShow PremiumLimitType
PremiumLimitTypeStorySuggestedReactionAreaCount
      = String
"PremiumLimitTypeStorySuggestedReactionAreaCount"
  shortShow PremiumLimitType
PremiumLimitTypeSimilarChatCount
      = String
"PremiumLimitTypeSimilarChatCount"

instance AT.FromJSON PremiumLimitType where
  parseJSON :: Value -> Parser PremiumLimitType
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
"premiumLimitTypeSupergroupCount"                 -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeSupergroupCount
      String
"premiumLimitTypePinnedChatCount"                 -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypePinnedChatCount
      String
"premiumLimitTypeCreatedPublicChatCount"          -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeCreatedPublicChatCount
      String
"premiumLimitTypeSavedAnimationCount"             -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeSavedAnimationCount
      String
"premiumLimitTypeFavoriteStickerCount"            -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeFavoriteStickerCount
      String
"premiumLimitTypeChatFolderCount"                 -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeChatFolderCount
      String
"premiumLimitTypeChatFolderChosenChatCount"       -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeChatFolderChosenChatCount
      String
"premiumLimitTypePinnedArchivedChatCount"         -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypePinnedArchivedChatCount
      String
"premiumLimitTypePinnedSavedMessagesTopicCount"   -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypePinnedSavedMessagesTopicCount
      String
"premiumLimitTypeCaptionLength"                   -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeCaptionLength
      String
"premiumLimitTypeBioLength"                       -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeBioLength
      String
"premiumLimitTypeChatFolderInviteLinkCount"       -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeChatFolderInviteLinkCount
      String
"premiumLimitTypeShareableChatFolderCount"        -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeShareableChatFolderCount
      String
"premiumLimitTypeActiveStoryCount"                -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeActiveStoryCount
      String
"premiumLimitTypeWeeklySentStoryCount"            -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeWeeklySentStoryCount
      String
"premiumLimitTypeMonthlySentStoryCount"           -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeMonthlySentStoryCount
      String
"premiumLimitTypeStoryCaptionLength"              -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeStoryCaptionLength
      String
"premiumLimitTypeStorySuggestedReactionAreaCount" -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeStorySuggestedReactionAreaCount
      String
"premiumLimitTypeSimilarChatCount"                -> PremiumLimitType -> Parser PremiumLimitType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumLimitType
PremiumLimitTypeSimilarChatCount
      String
_                                                 -> Parser PremiumLimitType
forall a. Monoid a => a
mempty
    
  parseJSON Value
_ = Parser PremiumLimitType
forall a. Monoid a => a
mempty

instance AT.ToJSON PremiumLimitType where
  toJSON :: PremiumLimitType -> Value
toJSON PremiumLimitType
PremiumLimitTypeSupergroupCount
      = [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
"premiumLimitTypeSupergroupCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypePinnedChatCount
      = [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
"premiumLimitTypePinnedChatCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeCreatedPublicChatCount
      = [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
"premiumLimitTypeCreatedPublicChatCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeSavedAnimationCount
      = [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
"premiumLimitTypeSavedAnimationCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeFavoriteStickerCount
      = [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
"premiumLimitTypeFavoriteStickerCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeChatFolderCount
      = [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
"premiumLimitTypeChatFolderCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeChatFolderChosenChatCount
      = [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
"premiumLimitTypeChatFolderChosenChatCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypePinnedArchivedChatCount
      = [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
"premiumLimitTypePinnedArchivedChatCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypePinnedSavedMessagesTopicCount
      = [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
"premiumLimitTypePinnedSavedMessagesTopicCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeCaptionLength
      = [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
"premiumLimitTypeCaptionLength"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeBioLength
      = [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
"premiumLimitTypeBioLength"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeChatFolderInviteLinkCount
      = [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
"premiumLimitTypeChatFolderInviteLinkCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeShareableChatFolderCount
      = [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
"premiumLimitTypeShareableChatFolderCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeActiveStoryCount
      = [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
"premiumLimitTypeActiveStoryCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeWeeklySentStoryCount
      = [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
"premiumLimitTypeWeeklySentStoryCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeMonthlySentStoryCount
      = [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
"premiumLimitTypeMonthlySentStoryCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeStoryCaptionLength
      = [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
"premiumLimitTypeStoryCaptionLength"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeStorySuggestedReactionAreaCount
      = [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
"premiumLimitTypeStorySuggestedReactionAreaCount"
        ]
  toJSON PremiumLimitType
PremiumLimitTypeSimilarChatCount
      = [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
"premiumLimitTypeSimilarChatCount"
        ]