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