@@ -1158,33 +1158,65 @@ instance ToJSON APKListing where
1159-- /See:/ 'subscriptionPurchase' smart constructor.
1159-- /See:/ 'subscriptionPurchase' smart constructor.
1160data SubscriptionPurchase = SubscriptionPurchase'
1160data SubscriptionPurchase = SubscriptionPurchase'
1161+ { _spPaymentState :: !(Maybe (Textual Int32))
1161− { _spKind :: !Text
1162+ , _spKind :: !Text
1162− , _spExpiryTimeMillis :: !(Maybe (Textual Int64))
1163+ , _spExpiryTimeMillis :: !(Maybe (Textual Int64))
1163− , _spAutoRenewing :: !(Maybe Bool)
1164+ , _spAutoRenewing :: !(Maybe Bool)
1165+ , _spPriceCurrencyCode :: !(Maybe Text)
1166+ , _spCancelReason :: !(Maybe (Textual Int32))
1167+ , _spCountryCode :: !(Maybe Text)
1168+ , _spDeveloperPayload :: !(Maybe Text)
1169+ , _spPriceAmountMicros :: !(Maybe (Textual Int64))
1164− , _spStartTimeMillis :: !(Maybe (Textual Int64))
1170+ , _spStartTimeMillis :: !(Maybe (Textual Int64))
1165 } deriving (Eq,Show,Data,Typeable,Generic)
1171 } deriving (Eq,Show,Data,Typeable,Generic)
1167-- | Creates a value of 'SubscriptionPurchase' with the minimum fields required to make a request.
1173-- | Creates a value of 'SubscriptionPurchase' with the minimum fields required to make a request.
1169-- Use one of the following lenses to modify other fields as desired:
1175-- Use one of the following lenses to modify other fields as desired:
1177+-- * 'spPaymentState'
1171-- * 'spKind'
1179-- * 'spKind'
1173-- * 'spExpiryTimeMillis'
1181-- * 'spExpiryTimeMillis'
1175-- * 'spAutoRenewing'
1183-- * 'spAutoRenewing'
1185+-- * 'spPriceCurrencyCode'
1187+-- * 'spCancelReason'
1189+-- * 'spCountryCode'
1191+-- * 'spDeveloperPayload'
1193+-- * 'spPriceAmountMicros'
1177-- * 'spStartTimeMillis'
1195-- * 'spStartTimeMillis'
1178subscriptionPurchase
1196subscriptionPurchase
1179 :: SubscriptionPurchase
1197 :: SubscriptionPurchase
1180subscriptionPurchase =
1198subscriptionPurchase =
1181 SubscriptionPurchase'
1199 SubscriptionPurchase'
1200+ { _spPaymentState = Nothing
1182− { _spKind = "androidpublisher#subscriptionPurchase"
1201+ , _spKind = "androidpublisher#subscriptionPurchase"
1183 , _spExpiryTimeMillis = Nothing
1202 , _spExpiryTimeMillis = Nothing
1184 , _spAutoRenewing = Nothing
1203 , _spAutoRenewing = Nothing
1204+ , _spPriceCurrencyCode = Nothing
1205+ , _spCancelReason = Nothing
1206+ , _spCountryCode = Nothing
1207+ , _spDeveloperPayload = Nothing
1208+ , _spPriceAmountMicros = Nothing
1185 , _spStartTimeMillis = Nothing
1209 , _spStartTimeMillis = Nothing
1212+-- | The payment state of the subscription. Possible values are: - Payment
1213+-- pending - Payment received
1214+spPaymentState :: Lens' SubscriptionPurchase (Maybe Int32)
1216+ = lens _spPaymentState
1217+ (\ s a -> s{_spPaymentState = a})
1188-- | This kind represents a subscriptionPurchase object in the
1220-- | This kind represents a subscriptionPurchase object in the
1189-- androidpublisher service.
1221-- androidpublisher service.
1190spKind :: Lens' SubscriptionPurchase Text
1222spKind :: Lens' SubscriptionPurchase Text
@@ -1204,6 +1236,48 @@ spAutoRenewing
1204 = lens _spAutoRenewing
1236 = lens _spAutoRenewing
1205 (\ s a -> s{_spAutoRenewing = a})
1237 (\ s a -> s{_spAutoRenewing = a})
1239+-- | ISO 4217 currency code for the subscription price. For example, if the
1240+-- price is specified in British pounds sterling, price_currency_code is
1242+spPriceCurrencyCode :: Lens' SubscriptionPurchase (Maybe Text)
1244+ = lens _spPriceCurrencyCode
1245+ (\ s a -> s{_spPriceCurrencyCode = a})
1247+-- | The cancel reason of the subscription, if the subscription is not auto
1248+-- renewing. Possible values are: - User cancelled the subscription -
1249+-- Subscription was cancelled by the system, for example because of a
1251+spCancelReason :: Lens' SubscriptionPurchase (Maybe Int32)
1253+ = lens _spCancelReason
1254+ (\ s a -> s{_spCancelReason = a})
1257+-- | ISO 3166-1 alpha-2 billing country\/region code of the user at the time
1258+-- the subscription was granted.
1259+spCountryCode :: Lens' SubscriptionPurchase (Maybe Text)
1261+ = lens _spCountryCode
1262+ (\ s a -> s{_spCountryCode = a})
1264+-- | A developer-specified string that contains supplemental information
1266+spDeveloperPayload :: Lens' SubscriptionPurchase (Maybe Text)
1268+ = lens _spDeveloperPayload
1269+ (\ s a -> s{_spDeveloperPayload = a})
1271+-- | Price of the subscription, not including tax. Price is expressed in
1272+-- micro-units, where 1,000,000 micro-units equal one unit of the currency.
1273+-- For example, if the subscription price is €1.99, price_amount_micros is
1275+spPriceAmountMicros :: Lens' SubscriptionPurchase (Maybe Int64)
1277+ = lens _spPriceAmountMicros
1278+ (\ s a -> s{_spPriceAmountMicros = a})
1207-- | Time at which the subscription was granted, in milliseconds since Epoch.
1281-- | Time at which the subscription was granted, in milliseconds since Epoch.
1208spStartTimeMillis :: Lens' SubscriptionPurchase (Maybe Int64)
1282spStartTimeMillis :: Lens' SubscriptionPurchase (Maybe Int64)
1209spStartTimeMillis
1283spStartTimeMillis
@@ -1216,19 +1290,31 @@ instance FromJSON SubscriptionPurchase where
1216 = withObject "SubscriptionPurchase"
1290 = withObject "SubscriptionPurchase"
1218 SubscriptionPurchase' <$>
1292 SubscriptionPurchase' <$>
1293+ (o .:? "paymentState") <*>
1219− (o .:? "kind" .!=
1294+ (o .:? "kind" .!=
1220− "androidpublisher#subscriptionPurchase")
1295+ "androidpublisher#subscriptionPurchase")
1221 <*> (o .:? "expiryTimeMillis")
1296 <*> (o .:? "expiryTimeMillis")
1222 <*> (o .:? "autoRenewing")
1297 <*> (o .:? "autoRenewing")
1298+ <*> (o .:? "priceCurrencyCode")
1299+ <*> (o .:? "cancelReason")
1300+ <*> (o .:? "countryCode")
1301+ <*> (o .:? "developerPayload")
1302+ <*> (o .:? "priceAmountMicros")
1223 <*> (o .:? "startTimeMillis"))
1303 <*> (o .:? "startTimeMillis"))
1225instance ToJSON SubscriptionPurchase where
1305instance ToJSON SubscriptionPurchase where
1226 toJSON SubscriptionPurchase'{..}
1306 toJSON SubscriptionPurchase'{..}
1227 = object
1307 = object
1228 (catMaybes
1308 (catMaybes
1309+ [("paymentState" .=) <$> _spPaymentState,
1229− [Just ("kind" .= _spKind),
1310+ Just ("kind" .= _spKind),
1230 ("expiryTimeMillis" .=) <$> _spExpiryTimeMillis,
1311 ("expiryTimeMillis" .=) <$> _spExpiryTimeMillis,
1231 ("autoRenewing" .=) <$> _spAutoRenewing,
1312 ("autoRenewing" .=) <$> _spAutoRenewing,
1313+ ("priceCurrencyCode" .=) <$> _spPriceCurrencyCode,
1314+ ("cancelReason" .=) <$> _spCancelReason,
1315+ ("countryCode" .=) <$> _spCountryCode,
1316+ ("developerPayload" .=) <$> _spDeveloperPayload,
1317+ ("priceAmountMicros" .=) <$> _spPriceAmountMicros,
1232 ("startTimeMillis" .=) <$> _spStartTimeMillis])
1318 ("startTimeMillis" .=) <$> _spStartTimeMillis])