module TD.Query.ToggleUsernameIsActive
(ToggleUsernameIsActive(..)
, defaultToggleUsernameIsActive
) 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 ToggleUsernameIsActive
= ToggleUsernameIsActive
{ ToggleUsernameIsActive -> Maybe Text
username :: Maybe T.Text
, ToggleUsernameIsActive -> Maybe Bool
is_active :: Maybe Bool
}
deriving (ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool
(ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool)
-> (ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool)
-> Eq ToggleUsernameIsActive
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool
== :: ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool
$c/= :: ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool
/= :: ToggleUsernameIsActive -> ToggleUsernameIsActive -> Bool
Eq, Int -> ToggleUsernameIsActive -> ShowS
[ToggleUsernameIsActive] -> ShowS
ToggleUsernameIsActive -> String
(Int -> ToggleUsernameIsActive -> ShowS)
-> (ToggleUsernameIsActive -> String)
-> ([ToggleUsernameIsActive] -> ShowS)
-> Show ToggleUsernameIsActive
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleUsernameIsActive -> ShowS
showsPrec :: Int -> ToggleUsernameIsActive -> ShowS
$cshow :: ToggleUsernameIsActive -> String
show :: ToggleUsernameIsActive -> String
$cshowList :: [ToggleUsernameIsActive] -> ShowS
showList :: [ToggleUsernameIsActive] -> ShowS
Show)
instance I.ShortShow ToggleUsernameIsActive where
shortShow :: ToggleUsernameIsActive -> String
shortShow
ToggleUsernameIsActive
{ username :: ToggleUsernameIsActive -> Maybe Text
username = Maybe Text
username_
, is_active :: ToggleUsernameIsActive -> Maybe Bool
is_active = Maybe Bool
is_active_
}
= String
"ToggleUsernameIsActive"
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_
, String
"is_active" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_active_
]
instance AT.ToJSON ToggleUsernameIsActive where
toJSON :: ToggleUsernameIsActive -> Value
toJSON
ToggleUsernameIsActive
{ username :: ToggleUsernameIsActive -> Maybe Text
username = Maybe Text
username_
, is_active :: ToggleUsernameIsActive -> 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
"toggleUsernameIsActive"
, 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_
]
defaultToggleUsernameIsActive :: ToggleUsernameIsActive
defaultToggleUsernameIsActive :: ToggleUsernameIsActive
defaultToggleUsernameIsActive =
ToggleUsernameIsActive
{ username :: Maybe Text
username = Maybe Text
forall a. Maybe a
Nothing
, is_active :: Maybe Bool
is_active = Maybe Bool
forall a. Maybe a
Nothing
}