module TD.Query.AssignGooglePlayTransaction
(AssignGooglePlayTransaction(..)
, defaultAssignGooglePlayTransaction
) 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
import qualified TD.Data.StorePaymentPurpose as StorePaymentPurpose
data AssignGooglePlayTransaction
= AssignGooglePlayTransaction
{ AssignGooglePlayTransaction -> Maybe Text
package_name :: Maybe T.Text
, AssignGooglePlayTransaction -> Maybe Text
store_product_id :: Maybe T.Text
, AssignGooglePlayTransaction -> Maybe Text
purchase_token :: Maybe T.Text
, AssignGooglePlayTransaction -> Maybe StorePaymentPurpose
purpose :: Maybe StorePaymentPurpose.StorePaymentPurpose
}
deriving (AssignGooglePlayTransaction -> AssignGooglePlayTransaction -> Bool
(AssignGooglePlayTransaction
-> AssignGooglePlayTransaction -> Bool)
-> (AssignGooglePlayTransaction
-> AssignGooglePlayTransaction -> Bool)
-> Eq AssignGooglePlayTransaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssignGooglePlayTransaction -> AssignGooglePlayTransaction -> Bool
== :: AssignGooglePlayTransaction -> AssignGooglePlayTransaction -> Bool
$c/= :: AssignGooglePlayTransaction -> AssignGooglePlayTransaction -> Bool
/= :: AssignGooglePlayTransaction -> AssignGooglePlayTransaction -> Bool
Eq, Int -> AssignGooglePlayTransaction -> ShowS
[AssignGooglePlayTransaction] -> ShowS
AssignGooglePlayTransaction -> String
(Int -> AssignGooglePlayTransaction -> ShowS)
-> (AssignGooglePlayTransaction -> String)
-> ([AssignGooglePlayTransaction] -> ShowS)
-> Show AssignGooglePlayTransaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AssignGooglePlayTransaction -> ShowS
showsPrec :: Int -> AssignGooglePlayTransaction -> ShowS
$cshow :: AssignGooglePlayTransaction -> String
show :: AssignGooglePlayTransaction -> String
$cshowList :: [AssignGooglePlayTransaction] -> ShowS
showList :: [AssignGooglePlayTransaction] -> ShowS
Show)
instance I.ShortShow AssignGooglePlayTransaction where
shortShow :: AssignGooglePlayTransaction -> String
shortShow
AssignGooglePlayTransaction
{ package_name :: AssignGooglePlayTransaction -> Maybe Text
package_name = Maybe Text
package_name_
, store_product_id :: AssignGooglePlayTransaction -> Maybe Text
store_product_id = Maybe Text
store_product_id_
, purchase_token :: AssignGooglePlayTransaction -> Maybe Text
purchase_token = Maybe Text
purchase_token_
, purpose :: AssignGooglePlayTransaction -> Maybe StorePaymentPurpose
purpose = Maybe StorePaymentPurpose
purpose_
}
= String
"AssignGooglePlayTransaction"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"package_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
package_name_
, String
"store_product_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
store_product_id_
, String
"purchase_token" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
purchase_token_
, String
"purpose" String -> Maybe StorePaymentPurpose -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StorePaymentPurpose
purpose_
]
instance AT.ToJSON AssignGooglePlayTransaction where
toJSON :: AssignGooglePlayTransaction -> Value
toJSON
AssignGooglePlayTransaction
{ package_name :: AssignGooglePlayTransaction -> Maybe Text
package_name = Maybe Text
package_name_
, store_product_id :: AssignGooglePlayTransaction -> Maybe Text
store_product_id = Maybe Text
store_product_id_
, purchase_token :: AssignGooglePlayTransaction -> Maybe Text
purchase_token = Maybe Text
purchase_token_
, purpose :: AssignGooglePlayTransaction -> Maybe StorePaymentPurpose
purpose = Maybe StorePaymentPurpose
purpose_
}
= [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
"assignGooglePlayTransaction"
, Key
"package_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
package_name_
, Key
"store_product_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
store_product_id_
, Key
"purchase_token" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
purchase_token_
, Key
"purpose" Key -> Maybe StorePaymentPurpose -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StorePaymentPurpose
purpose_
]
defaultAssignGooglePlayTransaction :: AssignGooglePlayTransaction
defaultAssignGooglePlayTransaction :: AssignGooglePlayTransaction
defaultAssignGooglePlayTransaction =
AssignGooglePlayTransaction
{ package_name :: Maybe Text
package_name = Maybe Text
forall a. Maybe a
Nothing
, store_product_id :: Maybe Text
store_product_id = Maybe Text
forall a. Maybe a
Nothing
, purchase_token :: Maybe Text
purchase_token = Maybe Text
forall a. Maybe a
Nothing
, purpose :: Maybe StorePaymentPurpose
purpose = Maybe StorePaymentPurpose
forall a. Maybe a
Nothing
}