module TD.Query.SetChatMessageSender
(SetChatMessageSender(..)
, defaultSetChatMessageSender
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.MessageSender as MessageSender
data SetChatMessageSender
= SetChatMessageSender
{ SetChatMessageSender -> Maybe Int
chat_id :: Maybe Int
, SetChatMessageSender -> Maybe MessageSender
message_sender_id :: Maybe MessageSender.MessageSender
}
deriving (SetChatMessageSender -> SetChatMessageSender -> Bool
(SetChatMessageSender -> SetChatMessageSender -> Bool)
-> (SetChatMessageSender -> SetChatMessageSender -> Bool)
-> Eq SetChatMessageSender
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetChatMessageSender -> SetChatMessageSender -> Bool
== :: SetChatMessageSender -> SetChatMessageSender -> Bool
$c/= :: SetChatMessageSender -> SetChatMessageSender -> Bool
/= :: SetChatMessageSender -> SetChatMessageSender -> Bool
Eq, Int -> SetChatMessageSender -> ShowS
[SetChatMessageSender] -> ShowS
SetChatMessageSender -> String
(Int -> SetChatMessageSender -> ShowS)
-> (SetChatMessageSender -> String)
-> ([SetChatMessageSender] -> ShowS)
-> Show SetChatMessageSender
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetChatMessageSender -> ShowS
showsPrec :: Int -> SetChatMessageSender -> ShowS
$cshow :: SetChatMessageSender -> String
show :: SetChatMessageSender -> String
$cshowList :: [SetChatMessageSender] -> ShowS
showList :: [SetChatMessageSender] -> ShowS
Show)
instance I.ShortShow SetChatMessageSender where
shortShow :: SetChatMessageSender -> String
shortShow
SetChatMessageSender
{ chat_id :: SetChatMessageSender -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_sender_id :: SetChatMessageSender -> Maybe MessageSender
message_sender_id = Maybe MessageSender
message_sender_id_
}
= String
"SetChatMessageSender"
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_sender_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
message_sender_id_
]
instance AT.ToJSON SetChatMessageSender where
toJSON :: SetChatMessageSender -> Value
toJSON
SetChatMessageSender
{ chat_id :: SetChatMessageSender -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_sender_id :: SetChatMessageSender -> Maybe MessageSender
message_sender_id = Maybe MessageSender
message_sender_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
"setChatMessageSender"
, 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_sender_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
message_sender_id_
]
defaultSetChatMessageSender :: SetChatMessageSender
defaultSetChatMessageSender :: SetChatMessageSender
defaultSetChatMessageSender =
SetChatMessageSender
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_sender_id :: Maybe MessageSender
message_sender_id = Maybe MessageSender
forall a. Maybe a
Nothing
}