module TD.Query.DeleteGift
(DeleteGift(..)
, defaultDeleteGift
) 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 DeleteGift
= DeleteGift
{ DeleteGift -> Maybe Text
business_connection_id :: Maybe T.Text
, DeleteGift -> Maybe Text
received_gift_id :: Maybe T.Text
}
deriving (DeleteGift -> DeleteGift -> Bool
(DeleteGift -> DeleteGift -> Bool)
-> (DeleteGift -> DeleteGift -> Bool) -> Eq DeleteGift
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteGift -> DeleteGift -> Bool
== :: DeleteGift -> DeleteGift -> Bool
$c/= :: DeleteGift -> DeleteGift -> Bool
/= :: DeleteGift -> DeleteGift -> Bool
Eq, Int -> DeleteGift -> ShowS
[DeleteGift] -> ShowS
DeleteGift -> String
(Int -> DeleteGift -> ShowS)
-> (DeleteGift -> String)
-> ([DeleteGift] -> ShowS)
-> Show DeleteGift
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteGift -> ShowS
showsPrec :: Int -> DeleteGift -> ShowS
$cshow :: DeleteGift -> String
show :: DeleteGift -> String
$cshowList :: [DeleteGift] -> ShowS
showList :: [DeleteGift] -> ShowS
Show)
instance I.ShortShow DeleteGift where
shortShow :: DeleteGift -> String
shortShow
DeleteGift
{ business_connection_id :: DeleteGift -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, received_gift_id :: DeleteGift -> Maybe Text
received_gift_id = Maybe Text
received_gift_id_
}
= String
"DeleteGift"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
, String
"received_gift_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
received_gift_id_
]
instance AT.ToJSON DeleteGift where
toJSON :: DeleteGift -> Value
toJSON
DeleteGift
{ business_connection_id :: DeleteGift -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, received_gift_id :: DeleteGift -> Maybe Text
received_gift_id = Maybe Text
received_gift_id_
}
= [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
"deleteGift"
, Key
"business_connection_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
business_connection_id_
, Key
"received_gift_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
received_gift_id_
]
defaultDeleteGift :: DeleteGift
defaultDeleteGift :: DeleteGift
defaultDeleteGift =
DeleteGift
{ business_connection_id :: Maybe Text
business_connection_id = Maybe Text
forall a. Maybe a
Nothing
, received_gift_id :: Maybe Text
received_gift_id = Maybe Text
forall a. Maybe a
Nothing
}