module TD.Data.SupergroupFullInfo
  (SupergroupFullInfo(..)) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.ChatPhoto as ChatPhoto
import qualified Data.Text as T
import qualified TD.Data.ChatLocation as ChatLocation
import qualified TD.Data.ChatInviteLink as ChatInviteLink
import qualified TD.Data.BotCommands as BotCommands

data SupergroupFullInfo
  = SupergroupFullInfo -- ^ Contains full information about a supergroup or channel
    { SupergroupFullInfo -> Maybe ChatPhoto
photo                            :: Maybe ChatPhoto.ChatPhoto           -- ^ Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
    , SupergroupFullInfo -> Maybe Text
description                      :: Maybe T.Text                        -- ^ Supergroup or channel description
    , SupergroupFullInfo -> Maybe Int
member_count                     :: Maybe Int                           -- ^ Number of members in the supergroup or channel; 0 if unknown
    , SupergroupFullInfo -> Maybe Int
administrator_count              :: Maybe Int                           -- ^ Number of privileged users in the supergroup or channel; 0 if unknown
    , SupergroupFullInfo -> Maybe Int
restricted_count                 :: Maybe Int                           -- ^ Number of restricted users in the supergroup; 0 if unknown
    , SupergroupFullInfo -> Maybe Int
banned_count                     :: Maybe Int                           -- ^ Number of users banned from chat; 0 if unknown
    , SupergroupFullInfo -> Maybe Int
linked_chat_id                   :: Maybe Int                           -- ^ Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
    , SupergroupFullInfo -> Maybe Int
slow_mode_delay                  :: Maybe Int                           -- ^ Delay between consecutive sent messages for non-administrator supergroup members, in seconds
    , SupergroupFullInfo -> Maybe Double
slow_mode_delay_expires_in       :: Maybe Double                        -- ^ Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
    , SupergroupFullInfo -> Maybe Bool
can_enable_paid_reaction         :: Maybe Bool                          -- ^ True, if paid reaction can be enabled in the channel chat; for channels only
    , SupergroupFullInfo -> Maybe Bool
can_get_members                  :: Maybe Bool                          -- ^ True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers
    , SupergroupFullInfo -> Maybe Bool
has_hidden_members               :: Maybe Bool                          -- ^ True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers
    , SupergroupFullInfo -> Maybe Bool
can_hide_members                 :: Maybe Bool                          -- ^ True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators
    , SupergroupFullInfo -> Maybe Bool
can_set_sticker_set              :: Maybe Bool                          -- ^ True, if the supergroup sticker set can be changed
    , SupergroupFullInfo -> Maybe Bool
can_set_location                 :: Maybe Bool                          -- ^ True, if the supergroup location can be changed
    , SupergroupFullInfo -> Maybe Bool
can_get_statistics               :: Maybe Bool                          -- ^ True, if the supergroup or channel statistics are available
    , SupergroupFullInfo -> Maybe Bool
can_get_revenue_statistics       :: Maybe Bool                          -- ^ True, if the supergroup or channel revenue statistics are available
    , SupergroupFullInfo -> Maybe Bool
can_get_star_revenue_statistics  :: Maybe Bool                          -- ^ True, if the supergroup or channel Telegram Star revenue statistics are available
    , SupergroupFullInfo -> Maybe Bool
can_toggle_aggressive_anti_spam  :: Maybe Bool                          -- ^ True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
    , SupergroupFullInfo -> Maybe Bool
is_all_history_available         :: Maybe Bool                          -- ^ True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators
    , SupergroupFullInfo -> Maybe Bool
can_have_sponsored_messages      :: Maybe Bool                          -- ^ True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat
    , SupergroupFullInfo -> Maybe Bool
has_aggressive_anti_spam_enabled :: Maybe Bool                          -- ^ True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators
    , SupergroupFullInfo -> Maybe Bool
has_paid_media_allowed           :: Maybe Bool                          -- ^ True, if paid media can be sent and forwarded to the channel chat; for channels only
    , SupergroupFullInfo -> Maybe Bool
has_pinned_stories               :: Maybe Bool                          -- ^ True, if the supergroup or channel has pinned stories
    , SupergroupFullInfo -> Maybe Int
my_boost_count                   :: Maybe Int                           -- ^ Number of times the current user boosted the supergroup or channel
    , SupergroupFullInfo -> Maybe Int
unrestrict_boost_count           :: Maybe Int                           -- ^ Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified
    , SupergroupFullInfo -> Maybe Int
sticker_set_id                   :: Maybe Int                           -- ^ Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none
    , SupergroupFullInfo -> Maybe Int
custom_emoji_sticker_set_id      :: Maybe Int                           -- ^ Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none
    , SupergroupFullInfo -> Maybe ChatLocation
location                         :: Maybe ChatLocation.ChatLocation     -- ^ Location to which the supergroup is connected; may be null if none
    , SupergroupFullInfo -> Maybe ChatInviteLink
invite_link                      :: Maybe ChatInviteLink.ChatInviteLink -- ^ Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
    , SupergroupFullInfo -> Maybe [BotCommands]
bot_commands                     :: Maybe [BotCommands.BotCommands]     -- ^ List of commands of bots in the group
    , SupergroupFullInfo -> Maybe Int
upgraded_from_basic_group_id     :: Maybe Int                           -- ^ Identifier of the basic group from which supergroup was upgraded; 0 if none
    , SupergroupFullInfo -> Maybe Int
upgraded_from_max_message_id     :: Maybe Int                           -- ^ Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
    }
  deriving (SupergroupFullInfo -> SupergroupFullInfo -> Bool
(SupergroupFullInfo -> SupergroupFullInfo -> Bool)
-> (SupergroupFullInfo -> SupergroupFullInfo -> Bool)
-> Eq SupergroupFullInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SupergroupFullInfo -> SupergroupFullInfo -> Bool
== :: SupergroupFullInfo -> SupergroupFullInfo -> Bool
$c/= :: SupergroupFullInfo -> SupergroupFullInfo -> Bool
/= :: SupergroupFullInfo -> SupergroupFullInfo -> Bool
Eq, Int -> SupergroupFullInfo -> ShowS
[SupergroupFullInfo] -> ShowS
SupergroupFullInfo -> String
(Int -> SupergroupFullInfo -> ShowS)
-> (SupergroupFullInfo -> String)
-> ([SupergroupFullInfo] -> ShowS)
-> Show SupergroupFullInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SupergroupFullInfo -> ShowS
showsPrec :: Int -> SupergroupFullInfo -> ShowS
$cshow :: SupergroupFullInfo -> String
show :: SupergroupFullInfo -> String
$cshowList :: [SupergroupFullInfo] -> ShowS
showList :: [SupergroupFullInfo] -> ShowS
Show)

instance I.ShortShow SupergroupFullInfo where
  shortShow :: SupergroupFullInfo -> String
shortShow SupergroupFullInfo
    { photo :: SupergroupFullInfo -> Maybe ChatPhoto
photo                            = Maybe ChatPhoto
photo_
    , description :: SupergroupFullInfo -> Maybe Text
description                      = Maybe Text
description_
    , member_count :: SupergroupFullInfo -> Maybe Int
member_count                     = Maybe Int
member_count_
    , administrator_count :: SupergroupFullInfo -> Maybe Int
administrator_count              = Maybe Int
administrator_count_
    , restricted_count :: SupergroupFullInfo -> Maybe Int
restricted_count                 = Maybe Int
restricted_count_
    , banned_count :: SupergroupFullInfo -> Maybe Int
banned_count                     = Maybe Int
banned_count_
    , linked_chat_id :: SupergroupFullInfo -> Maybe Int
linked_chat_id                   = Maybe Int
linked_chat_id_
    , slow_mode_delay :: SupergroupFullInfo -> Maybe Int
slow_mode_delay                  = Maybe Int
slow_mode_delay_
    , slow_mode_delay_expires_in :: SupergroupFullInfo -> Maybe Double
slow_mode_delay_expires_in       = Maybe Double
slow_mode_delay_expires_in_
    , can_enable_paid_reaction :: SupergroupFullInfo -> Maybe Bool
can_enable_paid_reaction         = Maybe Bool
can_enable_paid_reaction_
    , can_get_members :: SupergroupFullInfo -> Maybe Bool
can_get_members                  = Maybe Bool
can_get_members_
    , has_hidden_members :: SupergroupFullInfo -> Maybe Bool
has_hidden_members               = Maybe Bool
has_hidden_members_
    , can_hide_members :: SupergroupFullInfo -> Maybe Bool
can_hide_members                 = Maybe Bool
can_hide_members_
    , can_set_sticker_set :: SupergroupFullInfo -> Maybe Bool
can_set_sticker_set              = Maybe Bool
can_set_sticker_set_
    , can_set_location :: SupergroupFullInfo -> Maybe Bool
can_set_location                 = Maybe Bool
can_set_location_
    , can_get_statistics :: SupergroupFullInfo -> Maybe Bool
can_get_statistics               = Maybe Bool
can_get_statistics_
    , can_get_revenue_statistics :: SupergroupFullInfo -> Maybe Bool
can_get_revenue_statistics       = Maybe Bool
can_get_revenue_statistics_
    , can_get_star_revenue_statistics :: SupergroupFullInfo -> Maybe Bool
can_get_star_revenue_statistics  = Maybe Bool
can_get_star_revenue_statistics_
    , can_toggle_aggressive_anti_spam :: SupergroupFullInfo -> Maybe Bool
can_toggle_aggressive_anti_spam  = Maybe Bool
can_toggle_aggressive_anti_spam_
    , is_all_history_available :: SupergroupFullInfo -> Maybe Bool
is_all_history_available         = Maybe Bool
is_all_history_available_
    , can_have_sponsored_messages :: SupergroupFullInfo -> Maybe Bool
can_have_sponsored_messages      = Maybe Bool
can_have_sponsored_messages_
    , has_aggressive_anti_spam_enabled :: SupergroupFullInfo -> Maybe Bool
has_aggressive_anti_spam_enabled = Maybe Bool
has_aggressive_anti_spam_enabled_
    , has_paid_media_allowed :: SupergroupFullInfo -> Maybe Bool
has_paid_media_allowed           = Maybe Bool
has_paid_media_allowed_
    , has_pinned_stories :: SupergroupFullInfo -> Maybe Bool
has_pinned_stories               = Maybe Bool
has_pinned_stories_
    , my_boost_count :: SupergroupFullInfo -> Maybe Int
my_boost_count                   = Maybe Int
my_boost_count_
    , unrestrict_boost_count :: SupergroupFullInfo -> Maybe Int
unrestrict_boost_count           = Maybe Int
unrestrict_boost_count_
    , sticker_set_id :: SupergroupFullInfo -> Maybe Int
sticker_set_id                   = Maybe Int
sticker_set_id_
    , custom_emoji_sticker_set_id :: SupergroupFullInfo -> Maybe Int
custom_emoji_sticker_set_id      = Maybe Int
custom_emoji_sticker_set_id_
    , location :: SupergroupFullInfo -> Maybe ChatLocation
location                         = Maybe ChatLocation
location_
    , invite_link :: SupergroupFullInfo -> Maybe ChatInviteLink
invite_link                      = Maybe ChatInviteLink
invite_link_
    , bot_commands :: SupergroupFullInfo -> Maybe [BotCommands]
bot_commands                     = Maybe [BotCommands]
bot_commands_
    , upgraded_from_basic_group_id :: SupergroupFullInfo -> Maybe Int
upgraded_from_basic_group_id     = Maybe Int
upgraded_from_basic_group_id_
    , upgraded_from_max_message_id :: SupergroupFullInfo -> Maybe Int
upgraded_from_max_message_id     = Maybe Int
upgraded_from_max_message_id_
    }
      = String
"SupergroupFullInfo"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"photo"                            String -> Maybe ChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhoto
photo_
        , String
"description"                      String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
description_
        , String
"member_count"                     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
member_count_
        , String
"administrator_count"              String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
administrator_count_
        , String
"restricted_count"                 String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
restricted_count_
        , String
"banned_count"                     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
banned_count_
        , String
"linked_chat_id"                   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
linked_chat_id_
        , String
"slow_mode_delay"                  String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
slow_mode_delay_
        , String
"slow_mode_delay_expires_in"       String -> Maybe Double -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Double
slow_mode_delay_expires_in_
        , String
"can_enable_paid_reaction"         String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_enable_paid_reaction_
        , String
"can_get_members"                  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_members_
        , String
"has_hidden_members"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_hidden_members_
        , String
"can_hide_members"                 String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_hide_members_
        , String
"can_set_sticker_set"              String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_sticker_set_
        , String
"can_set_location"                 String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_location_
        , String
"can_get_statistics"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_statistics_
        , String
"can_get_revenue_statistics"       String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_revenue_statistics_
        , String
"can_get_star_revenue_statistics"  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_star_revenue_statistics_
        , String
"can_toggle_aggressive_anti_spam"  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_toggle_aggressive_anti_spam_
        , String
"is_all_history_available"         String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_all_history_available_
        , String
"can_have_sponsored_messages"      String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_have_sponsored_messages_
        , String
"has_aggressive_anti_spam_enabled" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_aggressive_anti_spam_enabled_
        , String
"has_paid_media_allowed"           String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_paid_media_allowed_
        , String
"has_pinned_stories"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_pinned_stories_
        , String
"my_boost_count"                   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
my_boost_count_
        , String
"unrestrict_boost_count"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
unrestrict_boost_count_
        , String
"sticker_set_id"                   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sticker_set_id_
        , String
"custom_emoji_sticker_set_id"      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
custom_emoji_sticker_set_id_
        , String
"location"                         String -> Maybe ChatLocation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatLocation
location_
        , String
"invite_link"                      String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
invite_link_
        , String
"bot_commands"                     String -> Maybe [BotCommands] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [BotCommands]
bot_commands_
        , String
"upgraded_from_basic_group_id"     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
upgraded_from_basic_group_id_
        , String
"upgraded_from_max_message_id"     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
upgraded_from_max_message_id_
        ]

instance AT.FromJSON SupergroupFullInfo where
  parseJSON :: Value -> Parser SupergroupFullInfo
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
"supergroupFullInfo" -> Value -> Parser SupergroupFullInfo
parseSupergroupFullInfo Value
v
      String
_                    -> Parser SupergroupFullInfo
forall a. Monoid a => a
mempty
    
    where
      parseSupergroupFullInfo :: A.Value -> AT.Parser SupergroupFullInfo
      parseSupergroupFullInfo :: Value -> Parser SupergroupFullInfo
parseSupergroupFullInfo = String
-> (Object -> Parser SupergroupFullInfo)
-> Value
-> Parser SupergroupFullInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SupergroupFullInfo" ((Object -> Parser SupergroupFullInfo)
 -> Value -> Parser SupergroupFullInfo)
-> (Object -> Parser SupergroupFullInfo)
-> Value
-> Parser SupergroupFullInfo
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatPhoto
photo_                            <- Object
o Object -> Key -> Parser (Maybe ChatPhoto)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"photo"
        Maybe Text
description_                      <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"description"
        Maybe Int
member_count_                     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"member_count"
        Maybe Int
administrator_count_              <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"administrator_count"
        Maybe Int
restricted_count_                 <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"restricted_count"
        Maybe Int
banned_count_                     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"banned_count"
        Maybe Int
linked_chat_id_                   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"linked_chat_id"
        Maybe Int
slow_mode_delay_                  <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"slow_mode_delay"
        Maybe Double
slow_mode_delay_expires_in_       <- Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"slow_mode_delay_expires_in"
        Maybe Bool
can_enable_paid_reaction_         <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_enable_paid_reaction"
        Maybe Bool
can_get_members_                  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_get_members"
        Maybe Bool
has_hidden_members_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"has_hidden_members"
        Maybe Bool
can_hide_members_                 <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_hide_members"
        Maybe Bool
can_set_sticker_set_              <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_set_sticker_set"
        Maybe Bool
can_set_location_                 <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_set_location"
        Maybe Bool
can_get_statistics_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_get_statistics"
        Maybe Bool
can_get_revenue_statistics_       <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_get_revenue_statistics"
        Maybe Bool
can_get_star_revenue_statistics_  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_get_star_revenue_statistics"
        Maybe Bool
can_toggle_aggressive_anti_spam_  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_toggle_aggressive_anti_spam"
        Maybe Bool
is_all_history_available_         <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"is_all_history_available"
        Maybe Bool
can_have_sponsored_messages_      <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"can_have_sponsored_messages"
        Maybe Bool
has_aggressive_anti_spam_enabled_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"has_aggressive_anti_spam_enabled"
        Maybe Bool
has_paid_media_allowed_           <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"has_paid_media_allowed"
        Maybe Bool
has_pinned_stories_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"has_pinned_stories"
        Maybe Int
my_boost_count_                   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"my_boost_count"
        Maybe Int
unrestrict_boost_count_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"unrestrict_boost_count"
        Maybe Int
sticker_set_id_                   <- (String -> Int) -> Maybe String -> Maybe Int
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> Int
I.readInt64 (Maybe String -> Maybe Int)
-> Parser (Maybe String) -> Parser (Maybe Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sticker_set_id"
        Maybe Int
custom_emoji_sticker_set_id_      <- (String -> Int) -> Maybe String -> Maybe Int
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> Int
I.readInt64 (Maybe String -> Maybe Int)
-> Parser (Maybe String) -> Parser (Maybe Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"custom_emoji_sticker_set_id"
        Maybe ChatLocation
location_                         <- Object
o Object -> Key -> Parser (Maybe ChatLocation)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"location"
        Maybe ChatInviteLink
invite_link_                      <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"invite_link"
        Maybe [BotCommands]
bot_commands_                     <- Object
o Object -> Key -> Parser (Maybe [BotCommands])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"bot_commands"
        Maybe Int
upgraded_from_basic_group_id_     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"upgraded_from_basic_group_id"
        Maybe Int
upgraded_from_max_message_id_     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"upgraded_from_max_message_id"
        SupergroupFullInfo -> Parser SupergroupFullInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SupergroupFullInfo -> Parser SupergroupFullInfo)
-> SupergroupFullInfo -> Parser SupergroupFullInfo
forall a b. (a -> b) -> a -> b
$ SupergroupFullInfo
          { photo :: Maybe ChatPhoto
photo                            = Maybe ChatPhoto
photo_
          , description :: Maybe Text
description                      = Maybe Text
description_
          , member_count :: Maybe Int
member_count                     = Maybe Int
member_count_
          , administrator_count :: Maybe Int
administrator_count              = Maybe Int
administrator_count_
          , restricted_count :: Maybe Int
restricted_count                 = Maybe Int
restricted_count_
          , banned_count :: Maybe Int
banned_count                     = Maybe Int
banned_count_
          , linked_chat_id :: Maybe Int
linked_chat_id                   = Maybe Int
linked_chat_id_
          , slow_mode_delay :: Maybe Int
slow_mode_delay                  = Maybe Int
slow_mode_delay_
          , slow_mode_delay_expires_in :: Maybe Double
slow_mode_delay_expires_in       = Maybe Double
slow_mode_delay_expires_in_
          , can_enable_paid_reaction :: Maybe Bool
can_enable_paid_reaction         = Maybe Bool
can_enable_paid_reaction_
          , can_get_members :: Maybe Bool
can_get_members                  = Maybe Bool
can_get_members_
          , has_hidden_members :: Maybe Bool
has_hidden_members               = Maybe Bool
has_hidden_members_
          , can_hide_members :: Maybe Bool
can_hide_members                 = Maybe Bool
can_hide_members_
          , can_set_sticker_set :: Maybe Bool
can_set_sticker_set              = Maybe Bool
can_set_sticker_set_
          , can_set_location :: Maybe Bool
can_set_location                 = Maybe Bool
can_set_location_
          , can_get_statistics :: Maybe Bool
can_get_statistics               = Maybe Bool
can_get_statistics_
          , can_get_revenue_statistics :: Maybe Bool
can_get_revenue_statistics       = Maybe Bool
can_get_revenue_statistics_
          , can_get_star_revenue_statistics :: Maybe Bool
can_get_star_revenue_statistics  = Maybe Bool
can_get_star_revenue_statistics_
          , can_toggle_aggressive_anti_spam :: Maybe Bool
can_toggle_aggressive_anti_spam  = Maybe Bool
can_toggle_aggressive_anti_spam_
          , is_all_history_available :: Maybe Bool
is_all_history_available         = Maybe Bool
is_all_history_available_
          , can_have_sponsored_messages :: Maybe Bool
can_have_sponsored_messages      = Maybe Bool
can_have_sponsored_messages_
          , has_aggressive_anti_spam_enabled :: Maybe Bool
has_aggressive_anti_spam_enabled = Maybe Bool
has_aggressive_anti_spam_enabled_
          , has_paid_media_allowed :: Maybe Bool
has_paid_media_allowed           = Maybe Bool
has_paid_media_allowed_
          , has_pinned_stories :: Maybe Bool
has_pinned_stories               = Maybe Bool
has_pinned_stories_
          , my_boost_count :: Maybe Int
my_boost_count                   = Maybe Int
my_boost_count_
          , unrestrict_boost_count :: Maybe Int
unrestrict_boost_count           = Maybe Int
unrestrict_boost_count_
          , sticker_set_id :: Maybe Int
sticker_set_id                   = Maybe Int
sticker_set_id_
          , custom_emoji_sticker_set_id :: Maybe Int
custom_emoji_sticker_set_id      = Maybe Int
custom_emoji_sticker_set_id_
          , location :: Maybe ChatLocation
location                         = Maybe ChatLocation
location_
          , invite_link :: Maybe ChatInviteLink
invite_link                      = Maybe ChatInviteLink
invite_link_
          , bot_commands :: Maybe [BotCommands]
bot_commands                     = Maybe [BotCommands]
bot_commands_
          , upgraded_from_basic_group_id :: Maybe Int
upgraded_from_basic_group_id     = Maybe Int
upgraded_from_basic_group_id_
          , upgraded_from_max_message_id :: Maybe Int
upgraded_from_max_message_id     = Maybe Int
upgraded_from_max_message_id_
          }
  parseJSON Value
_ = Parser SupergroupFullInfo
forall a. Monoid a => a
mempty