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