module TD.Query.ToggleChatIsMarkedAsUnread
(ToggleChatIsMarkedAsUnread(..)
, defaultToggleChatIsMarkedAsUnread
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ToggleChatIsMarkedAsUnread
= ToggleChatIsMarkedAsUnread
{ ToggleChatIsMarkedAsUnread -> Maybe Int
chat_id :: Maybe Int
, ToggleChatIsMarkedAsUnread -> Maybe Bool
is_marked_as_unread :: Maybe Bool
}
deriving (ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool
(ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool)
-> (ToggleChatIsMarkedAsUnread
-> ToggleChatIsMarkedAsUnread -> Bool)
-> Eq ToggleChatIsMarkedAsUnread
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool
== :: ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool
$c/= :: ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool
/= :: ToggleChatIsMarkedAsUnread -> ToggleChatIsMarkedAsUnread -> Bool
Eq, Int -> ToggleChatIsMarkedAsUnread -> ShowS
[ToggleChatIsMarkedAsUnread] -> ShowS
ToggleChatIsMarkedAsUnread -> String
(Int -> ToggleChatIsMarkedAsUnread -> ShowS)
-> (ToggleChatIsMarkedAsUnread -> String)
-> ([ToggleChatIsMarkedAsUnread] -> ShowS)
-> Show ToggleChatIsMarkedAsUnread
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleChatIsMarkedAsUnread -> ShowS
showsPrec :: Int -> ToggleChatIsMarkedAsUnread -> ShowS
$cshow :: ToggleChatIsMarkedAsUnread -> String
show :: ToggleChatIsMarkedAsUnread -> String
$cshowList :: [ToggleChatIsMarkedAsUnread] -> ShowS
showList :: [ToggleChatIsMarkedAsUnread] -> ShowS
Show)
instance I.ShortShow ToggleChatIsMarkedAsUnread where
shortShow :: ToggleChatIsMarkedAsUnread -> String
shortShow
ToggleChatIsMarkedAsUnread
{ chat_id :: ToggleChatIsMarkedAsUnread -> Maybe Int
chat_id = Maybe Int
chat_id_
, is_marked_as_unread :: ToggleChatIsMarkedAsUnread -> Maybe Bool
is_marked_as_unread = Maybe Bool
is_marked_as_unread_
}
= String
"ToggleChatIsMarkedAsUnread"
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_
, String
"is_marked_as_unread" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_marked_as_unread_
]
instance AT.ToJSON ToggleChatIsMarkedAsUnread where
toJSON :: ToggleChatIsMarkedAsUnread -> Value
toJSON
ToggleChatIsMarkedAsUnread
{ chat_id :: ToggleChatIsMarkedAsUnread -> Maybe Int
chat_id = Maybe Int
chat_id_
, is_marked_as_unread :: ToggleChatIsMarkedAsUnread -> Maybe Bool
is_marked_as_unread = Maybe Bool
is_marked_as_unread_
}
= [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
"toggleChatIsMarkedAsUnread"
, 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_
, Key
"is_marked_as_unread" 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_marked_as_unread_
]
defaultToggleChatIsMarkedAsUnread :: ToggleChatIsMarkedAsUnread
defaultToggleChatIsMarkedAsUnread :: ToggleChatIsMarkedAsUnread
defaultToggleChatIsMarkedAsUnread =
ToggleChatIsMarkedAsUnread
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, is_marked_as_unread :: Maybe Bool
is_marked_as_unread = Maybe Bool
forall a. Maybe a
Nothing
}