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