module TD.Data.ChatBoostLevelFeatures
  (ChatBoostLevelFeatures(..)) where

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

data ChatBoostLevelFeatures
  = ChatBoostLevelFeatures -- ^ Contains a list of features available on a specific chat boost level
    { ChatBoostLevelFeatures -> Maybe Int
level                                   :: Maybe Int  -- ^ Target chat boost level
    , ChatBoostLevelFeatures -> Maybe Int
story_per_day_count                     :: Maybe Int  -- ^ Number of stories that the chat can publish daily
    , ChatBoostLevelFeatures -> Maybe Int
custom_emoji_reaction_count             :: Maybe Int  -- ^ Number of custom emoji reactions that can be added to the list of available reactions
    , ChatBoostLevelFeatures -> Maybe Int
title_color_count                       :: Maybe Int  -- ^ Number of custom colors for chat title
    , ChatBoostLevelFeatures -> Maybe Int
profile_accent_color_count              :: Maybe Int  -- ^ Number of custom colors for profile photo background
    , ChatBoostLevelFeatures -> Maybe Bool
can_set_profile_background_custom_emoji :: Maybe Bool -- ^ True, if custom emoji for profile background can be set
    , ChatBoostLevelFeatures -> Maybe Int
accent_color_count                      :: Maybe Int  -- ^ Number of custom colors for background of empty chat photo, replies to messages and link previews
    , ChatBoostLevelFeatures -> Maybe Bool
can_set_background_custom_emoji         :: Maybe Bool -- ^ True, if custom emoji for reply header and link preview background can be set
    , ChatBoostLevelFeatures -> Maybe Bool
can_set_emoji_status                    :: Maybe Bool -- ^ True, if emoji status can be set
    , ChatBoostLevelFeatures -> Maybe Int
chat_theme_background_count             :: Maybe Int  -- ^ Number of chat theme backgrounds that can be set as chat background
    , ChatBoostLevelFeatures -> Maybe Bool
can_set_custom_background               :: Maybe Bool -- ^ True, if custom background can be set in the chat for all users
    , ChatBoostLevelFeatures -> Maybe Bool
can_set_custom_emoji_sticker_set        :: Maybe Bool -- ^ True, if custom emoji sticker set can be set for the chat
    , ChatBoostLevelFeatures -> Maybe Bool
can_recognize_speech                    :: Maybe Bool -- ^ True, if speech recognition can be used for video note and voice note messages by all users
    , ChatBoostLevelFeatures -> Maybe Bool
can_disable_sponsored_messages          :: Maybe Bool -- ^ True, if sponsored messages can be disabled in the chat
    }
  deriving (ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool
(ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool)
-> (ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool)
-> Eq ChatBoostLevelFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool
== :: ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool
$c/= :: ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool
/= :: ChatBoostLevelFeatures -> ChatBoostLevelFeatures -> Bool
Eq, Int -> ChatBoostLevelFeatures -> ShowS
[ChatBoostLevelFeatures] -> ShowS
ChatBoostLevelFeatures -> String
(Int -> ChatBoostLevelFeatures -> ShowS)
-> (ChatBoostLevelFeatures -> String)
-> ([ChatBoostLevelFeatures] -> ShowS)
-> Show ChatBoostLevelFeatures
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatBoostLevelFeatures -> ShowS
showsPrec :: Int -> ChatBoostLevelFeatures -> ShowS
$cshow :: ChatBoostLevelFeatures -> String
show :: ChatBoostLevelFeatures -> String
$cshowList :: [ChatBoostLevelFeatures] -> ShowS
showList :: [ChatBoostLevelFeatures] -> ShowS
Show)

instance I.ShortShow ChatBoostLevelFeatures where
  shortShow :: ChatBoostLevelFeatures -> String
shortShow ChatBoostLevelFeatures
    { level :: ChatBoostLevelFeatures -> Maybe Int
level                                   = Maybe Int
level_
    , story_per_day_count :: ChatBoostLevelFeatures -> Maybe Int
story_per_day_count                     = Maybe Int
story_per_day_count_
    , custom_emoji_reaction_count :: ChatBoostLevelFeatures -> Maybe Int
custom_emoji_reaction_count             = Maybe Int
custom_emoji_reaction_count_
    , title_color_count :: ChatBoostLevelFeatures -> Maybe Int
title_color_count                       = Maybe Int
title_color_count_
    , profile_accent_color_count :: ChatBoostLevelFeatures -> Maybe Int
profile_accent_color_count              = Maybe Int
profile_accent_color_count_
    , can_set_profile_background_custom_emoji :: ChatBoostLevelFeatures -> Maybe Bool
can_set_profile_background_custom_emoji = Maybe Bool
can_set_profile_background_custom_emoji_
    , accent_color_count :: ChatBoostLevelFeatures -> Maybe Int
accent_color_count                      = Maybe Int
accent_color_count_
    , can_set_background_custom_emoji :: ChatBoostLevelFeatures -> Maybe Bool
can_set_background_custom_emoji         = Maybe Bool
can_set_background_custom_emoji_
    , can_set_emoji_status :: ChatBoostLevelFeatures -> Maybe Bool
can_set_emoji_status                    = Maybe Bool
can_set_emoji_status_
    , chat_theme_background_count :: ChatBoostLevelFeatures -> Maybe Int
chat_theme_background_count             = Maybe Int
chat_theme_background_count_
    , can_set_custom_background :: ChatBoostLevelFeatures -> Maybe Bool
can_set_custom_background               = Maybe Bool
can_set_custom_background_
    , can_set_custom_emoji_sticker_set :: ChatBoostLevelFeatures -> Maybe Bool
can_set_custom_emoji_sticker_set        = Maybe Bool
can_set_custom_emoji_sticker_set_
    , can_recognize_speech :: ChatBoostLevelFeatures -> Maybe Bool
can_recognize_speech                    = Maybe Bool
can_recognize_speech_
    , can_disable_sponsored_messages :: ChatBoostLevelFeatures -> Maybe Bool
can_disable_sponsored_messages          = Maybe Bool
can_disable_sponsored_messages_
    }
      = String
"ChatBoostLevelFeatures"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"level"                                   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
level_
        , String
"story_per_day_count"                     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_per_day_count_
        , String
"custom_emoji_reaction_count"             String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
custom_emoji_reaction_count_
        , String
"title_color_count"                       String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
title_color_count_
        , String
"profile_accent_color_count"              String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
profile_accent_color_count_
        , String
"can_set_profile_background_custom_emoji" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_profile_background_custom_emoji_
        , String
"accent_color_count"                      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
accent_color_count_
        , String
"can_set_background_custom_emoji"         String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_background_custom_emoji_
        , String
"can_set_emoji_status"                    String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_emoji_status_
        , String
"chat_theme_background_count"             String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_theme_background_count_
        , String
"can_set_custom_background"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_custom_background_
        , String
"can_set_custom_emoji_sticker_set"        String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_custom_emoji_sticker_set_
        , String
"can_recognize_speech"                    String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_recognize_speech_
        , String
"can_disable_sponsored_messages"          String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_disable_sponsored_messages_
        ]

instance AT.FromJSON ChatBoostLevelFeatures where
  parseJSON :: Value -> Parser ChatBoostLevelFeatures
parseJSON v :: Value
v@(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
"chatBoostLevelFeatures" -> Value -> Parser ChatBoostLevelFeatures
parseChatBoostLevelFeatures Value
v
      String
_                        -> Parser ChatBoostLevelFeatures
forall a. Monoid a => a
mempty
    
    where
      parseChatBoostLevelFeatures :: A.Value -> AT.Parser ChatBoostLevelFeatures
      parseChatBoostLevelFeatures :: Value -> Parser ChatBoostLevelFeatures
parseChatBoostLevelFeatures = String
-> (Object -> Parser ChatBoostLevelFeatures)
-> Value
-> Parser ChatBoostLevelFeatures
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatBoostLevelFeatures" ((Object -> Parser ChatBoostLevelFeatures)
 -> Value -> Parser ChatBoostLevelFeatures)
-> (Object -> Parser ChatBoostLevelFeatures)
-> Value
-> Parser ChatBoostLevelFeatures
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
level_                                   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"level"
        Maybe Int
story_per_day_count_                     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"story_per_day_count"
        Maybe Int
custom_emoji_reaction_count_             <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"custom_emoji_reaction_count"
        Maybe Int
title_color_count_                       <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title_color_count"
        Maybe Int
profile_accent_color_count_              <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"profile_accent_color_count"
        Maybe Bool
can_set_profile_background_custom_emoji_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_set_profile_background_custom_emoji"
        Maybe Int
accent_color_count_                      <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"accent_color_count"
        Maybe Bool
can_set_background_custom_emoji_         <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_set_background_custom_emoji"
        Maybe Bool
can_set_emoji_status_                    <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_set_emoji_status"
        Maybe Int
chat_theme_background_count_             <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"chat_theme_background_count"
        Maybe Bool
can_set_custom_background_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_set_custom_background"
        Maybe Bool
can_set_custom_emoji_sticker_set_        <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_set_custom_emoji_sticker_set"
        Maybe Bool
can_recognize_speech_                    <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_recognize_speech"
        Maybe Bool
can_disable_sponsored_messages_          <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_disable_sponsored_messages"
        ChatBoostLevelFeatures -> Parser ChatBoostLevelFeatures
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatBoostLevelFeatures -> Parser ChatBoostLevelFeatures)
-> ChatBoostLevelFeatures -> Parser ChatBoostLevelFeatures
forall a b. (a -> b) -> a -> b
$ ChatBoostLevelFeatures
          { level :: Maybe Int
level                                   = Maybe Int
level_
          , story_per_day_count :: Maybe Int
story_per_day_count                     = Maybe Int
story_per_day_count_
          , custom_emoji_reaction_count :: Maybe Int
custom_emoji_reaction_count             = Maybe Int
custom_emoji_reaction_count_
          , title_color_count :: Maybe Int
title_color_count                       = Maybe Int
title_color_count_
          , profile_accent_color_count :: Maybe Int
profile_accent_color_count              = Maybe Int
profile_accent_color_count_
          , can_set_profile_background_custom_emoji :: Maybe Bool
can_set_profile_background_custom_emoji = Maybe Bool
can_set_profile_background_custom_emoji_
          , accent_color_count :: Maybe Int
accent_color_count                      = Maybe Int
accent_color_count_
          , can_set_background_custom_emoji :: Maybe Bool
can_set_background_custom_emoji         = Maybe Bool
can_set_background_custom_emoji_
          , can_set_emoji_status :: Maybe Bool
can_set_emoji_status                    = Maybe Bool
can_set_emoji_status_
          , chat_theme_background_count :: Maybe Int
chat_theme_background_count             = Maybe Int
chat_theme_background_count_
          , can_set_custom_background :: Maybe Bool
can_set_custom_background               = Maybe Bool
can_set_custom_background_
          , can_set_custom_emoji_sticker_set :: Maybe Bool
can_set_custom_emoji_sticker_set        = Maybe Bool
can_set_custom_emoji_sticker_set_
          , can_recognize_speech :: Maybe Bool
can_recognize_speech                    = Maybe Bool
can_recognize_speech_
          , can_disable_sponsored_messages :: Maybe Bool
can_disable_sponsored_messages          = Maybe Bool
can_disable_sponsored_messages_
          }
  parseJSON Value
_ = Parser ChatBoostLevelFeatures
forall a. Monoid a => a
mempty