module TD.Query.GetForumTopicPopularIcons
  (GetForumTopicPopularIcons(..)
  ) where

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

-- | Returns the list of custom emoji that are most often used as icons of recent topics in a forum supergroup chat. Returns 'TD.Data.Stickers.Stickers'
data GetForumTopicPopularIcons
  = GetForumTopicPopularIcons
    { GetForumTopicPopularIcons -> Maybe Int
chat_id :: Maybe Int -- ^ Identifier of the chat
    }
  deriving (GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool
(GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool)
-> (GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool)
-> Eq GetForumTopicPopularIcons
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool
== :: GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool
$c/= :: GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool
/= :: GetForumTopicPopularIcons -> GetForumTopicPopularIcons -> Bool
Eq, Int -> GetForumTopicPopularIcons -> ShowS
[GetForumTopicPopularIcons] -> ShowS
GetForumTopicPopularIcons -> String
(Int -> GetForumTopicPopularIcons -> ShowS)
-> (GetForumTopicPopularIcons -> String)
-> ([GetForumTopicPopularIcons] -> ShowS)
-> Show GetForumTopicPopularIcons
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetForumTopicPopularIcons -> ShowS
showsPrec :: Int -> GetForumTopicPopularIcons -> ShowS
$cshow :: GetForumTopicPopularIcons -> String
show :: GetForumTopicPopularIcons -> String
$cshowList :: [GetForumTopicPopularIcons] -> ShowS
showList :: [GetForumTopicPopularIcons] -> ShowS
Show)

instance I.ShortShow GetForumTopicPopularIcons where
  shortShow :: GetForumTopicPopularIcons -> String
shortShow
    GetForumTopicPopularIcons
      { chat_id :: GetForumTopicPopularIcons -> Maybe Int
chat_id = Maybe Int
chat_id_
      }
        = String
"GetForumTopicPopularIcons"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
          ]

instance AT.ToJSON GetForumTopicPopularIcons where
  toJSON :: GetForumTopicPopularIcons -> Value
toJSON
    GetForumTopicPopularIcons
      { chat_id :: GetForumTopicPopularIcons -> Maybe Int
chat_id = Maybe Int
chat_id_
      }
        = [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
"getForumTopicPopularIcons"
          , Key
"chat_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
          ]