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