module TD.Query.DeletePassportElement
(DeletePassportElement(..)
) 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
data DeletePassportElement
= DeletePassportElement
{ DeletePassportElement -> Maybe PassportElementType
_type :: Maybe PassportElementType.PassportElementType
}
deriving (DeletePassportElement -> DeletePassportElement -> Bool
(DeletePassportElement -> DeletePassportElement -> Bool)
-> (DeletePassportElement -> DeletePassportElement -> Bool)
-> Eq DeletePassportElement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeletePassportElement -> DeletePassportElement -> Bool
== :: DeletePassportElement -> DeletePassportElement -> Bool
$c/= :: DeletePassportElement -> DeletePassportElement -> Bool
/= :: DeletePassportElement -> DeletePassportElement -> Bool
Eq, Int -> DeletePassportElement -> ShowS
[DeletePassportElement] -> ShowS
DeletePassportElement -> String
(Int -> DeletePassportElement -> ShowS)
-> (DeletePassportElement -> String)
-> ([DeletePassportElement] -> ShowS)
-> Show DeletePassportElement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeletePassportElement -> ShowS
showsPrec :: Int -> DeletePassportElement -> ShowS
$cshow :: DeletePassportElement -> String
show :: DeletePassportElement -> String
$cshowList :: [DeletePassportElement] -> ShowS
showList :: [DeletePassportElement] -> ShowS
Show)
instance I.ShortShow DeletePassportElement where
shortShow :: DeletePassportElement -> String
shortShow
DeletePassportElement
{ _type :: DeletePassportElement -> Maybe PassportElementType
_type = Maybe PassportElementType
_type_
}
= String
"DeletePassportElement"
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_
]
instance AT.ToJSON DeletePassportElement where
toJSON :: DeletePassportElement -> Value
toJSON
DeletePassportElement
{ _type :: DeletePassportElement -> Maybe PassportElementType
_type = Maybe PassportElementType
_type_
}
= [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
"deletePassportElement"
, 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_
]