module TD.Query.DeleteCommands
(DeleteCommands(..)
, defaultDeleteCommands
) 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.BotCommandScope as BotCommandScope
import qualified Data.Text as T
data DeleteCommands
= DeleteCommands
{ DeleteCommands -> Maybe BotCommandScope
scope :: Maybe BotCommandScope.BotCommandScope
, DeleteCommands -> Maybe Text
language_code :: Maybe T.Text
}
deriving (DeleteCommands -> DeleteCommands -> Bool
(DeleteCommands -> DeleteCommands -> Bool)
-> (DeleteCommands -> DeleteCommands -> Bool) -> Eq DeleteCommands
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteCommands -> DeleteCommands -> Bool
== :: DeleteCommands -> DeleteCommands -> Bool
$c/= :: DeleteCommands -> DeleteCommands -> Bool
/= :: DeleteCommands -> DeleteCommands -> Bool
Eq, Int -> DeleteCommands -> ShowS
[DeleteCommands] -> ShowS
DeleteCommands -> String
(Int -> DeleteCommands -> ShowS)
-> (DeleteCommands -> String)
-> ([DeleteCommands] -> ShowS)
-> Show DeleteCommands
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteCommands -> ShowS
showsPrec :: Int -> DeleteCommands -> ShowS
$cshow :: DeleteCommands -> String
show :: DeleteCommands -> String
$cshowList :: [DeleteCommands] -> ShowS
showList :: [DeleteCommands] -> ShowS
Show)
instance I.ShortShow DeleteCommands where
shortShow :: DeleteCommands -> String
shortShow
DeleteCommands
{ scope :: DeleteCommands -> Maybe BotCommandScope
scope = Maybe BotCommandScope
scope_
, language_code :: DeleteCommands -> Maybe Text
language_code = Maybe Text
language_code_
}
= String
"DeleteCommands"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"scope" String -> Maybe BotCommandScope -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe BotCommandScope
scope_
, String
"language_code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
language_code_
]
instance AT.ToJSON DeleteCommands where
toJSON :: DeleteCommands -> Value
toJSON
DeleteCommands
{ scope :: DeleteCommands -> Maybe BotCommandScope
scope = Maybe BotCommandScope
scope_
, language_code :: DeleteCommands -> Maybe Text
language_code = Maybe Text
language_code_
}
= [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
"deleteCommands"
, Key
"scope" Key -> Maybe BotCommandScope -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe BotCommandScope
scope_
, Key
"language_code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
language_code_
]
defaultDeleteCommands :: DeleteCommands
defaultDeleteCommands :: DeleteCommands
defaultDeleteCommands =
DeleteCommands
{ scope :: Maybe BotCommandScope
scope = Maybe BotCommandScope
forall a. Maybe a
Nothing
, language_code :: Maybe Text
language_code = Maybe Text
forall a. Maybe a
Nothing
}