module TD.Query.SetPinnedSavedMessagesTopics
(SetPinnedSavedMessagesTopics(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data SetPinnedSavedMessagesTopics
= SetPinnedSavedMessagesTopics
{ SetPinnedSavedMessagesTopics -> Maybe [Int]
saved_messages_topic_ids :: Maybe [Int]
}
deriving (SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool
(SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool)
-> (SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool)
-> Eq SetPinnedSavedMessagesTopics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool
== :: SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool
$c/= :: SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool
/= :: SetPinnedSavedMessagesTopics
-> SetPinnedSavedMessagesTopics -> Bool
Eq, Int -> SetPinnedSavedMessagesTopics -> ShowS
[SetPinnedSavedMessagesTopics] -> ShowS
SetPinnedSavedMessagesTopics -> String
(Int -> SetPinnedSavedMessagesTopics -> ShowS)
-> (SetPinnedSavedMessagesTopics -> String)
-> ([SetPinnedSavedMessagesTopics] -> ShowS)
-> Show SetPinnedSavedMessagesTopics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetPinnedSavedMessagesTopics -> ShowS
showsPrec :: Int -> SetPinnedSavedMessagesTopics -> ShowS
$cshow :: SetPinnedSavedMessagesTopics -> String
show :: SetPinnedSavedMessagesTopics -> String
$cshowList :: [SetPinnedSavedMessagesTopics] -> ShowS
showList :: [SetPinnedSavedMessagesTopics] -> ShowS
Show)
instance I.ShortShow SetPinnedSavedMessagesTopics where
shortShow :: SetPinnedSavedMessagesTopics -> String
shortShow
SetPinnedSavedMessagesTopics
{ saved_messages_topic_ids :: SetPinnedSavedMessagesTopics -> Maybe [Int]
saved_messages_topic_ids = Maybe [Int]
saved_messages_topic_ids_
}
= String
"SetPinnedSavedMessagesTopics"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"saved_messages_topic_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
saved_messages_topic_ids_
]
instance AT.ToJSON SetPinnedSavedMessagesTopics where
toJSON :: SetPinnedSavedMessagesTopics -> Value
toJSON
SetPinnedSavedMessagesTopics
{ saved_messages_topic_ids :: SetPinnedSavedMessagesTopics -> Maybe [Int]
saved_messages_topic_ids = Maybe [Int]
saved_messages_topic_ids_
}
= [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
"setPinnedSavedMessagesTopics"
, Key
"saved_messages_topic_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
saved_messages_topic_ids_
]