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