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