module TD.Query.CheckBotUsername
(CheckBotUsername(..)
) 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 CheckBotUsername
= CheckBotUsername
{ CheckBotUsername -> Maybe Text
username :: Maybe T.Text
}
deriving (CheckBotUsername -> CheckBotUsername -> Bool
(CheckBotUsername -> CheckBotUsername -> Bool)
-> (CheckBotUsername -> CheckBotUsername -> Bool)
-> Eq CheckBotUsername
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CheckBotUsername -> CheckBotUsername -> Bool
== :: CheckBotUsername -> CheckBotUsername -> Bool
$c/= :: CheckBotUsername -> CheckBotUsername -> Bool
/= :: CheckBotUsername -> CheckBotUsername -> Bool
Eq, Int -> CheckBotUsername -> ShowS
[CheckBotUsername] -> ShowS
CheckBotUsername -> String
(Int -> CheckBotUsername -> ShowS)
-> (CheckBotUsername -> String)
-> ([CheckBotUsername] -> ShowS)
-> Show CheckBotUsername
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CheckBotUsername -> ShowS
showsPrec :: Int -> CheckBotUsername -> ShowS
$cshow :: CheckBotUsername -> String
show :: CheckBotUsername -> String
$cshowList :: [CheckBotUsername] -> ShowS
showList :: [CheckBotUsername] -> ShowS
Show)
instance I.ShortShow CheckBotUsername where
shortShow :: CheckBotUsername -> String
shortShow
CheckBotUsername
{ username :: CheckBotUsername -> Maybe Text
username = Maybe Text
username_
}
= String
"CheckBotUsername"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
username_
]
instance AT.ToJSON CheckBotUsername where
toJSON :: CheckBotUsername -> Value
toJSON
CheckBotUsername
{ username :: CheckBotUsername -> Maybe Text
username = Maybe Text
username_
}
= [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
"checkBotUsername"
, Key
"username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
username_
]