@@ -1158,33 +1158,65 @@ instance ToJSON APKListing where
11581158--
11591159-- /See:/ 'subscriptionPurchase' smart constructor.
11601160data SubscriptionPurchase = SubscriptionPurchase'
1161− { _spKind :: !Text
1162− , _spExpiryTimeMillis :: !(Maybe (Textual Int64))
1163− , _spAutoRenewing :: !(Maybe Bool)
1164− , _spStartTimeMillis :: !(Maybe (Textual Int64))
1161+ { _spPaymentState :: !(Maybe (Textual Int32))
1162+ , _spKind :: !Text
1163+ , _spExpiryTimeMillis :: !(Maybe (Textual Int64))
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))
1170+ , _spStartTimeMillis :: !(Maybe (Textual Int64))
11651171 } deriving (Eq,Show,Data,Typeable,Generic)
11661172
11671173-- | Creates a value of 'SubscriptionPurchase' with the minimum fields required to make a request.
11681174--
11691175-- Use one of the following lenses to modify other fields as desired:
11701176--
1177+-- * 'spPaymentState'
1178+--
11711179-- * 'spKind'
11721180--
11731181-- * 'spExpiryTimeMillis'
11741182--
11751183-- * 'spAutoRenewing'
11761184--
1185+-- * 'spPriceCurrencyCode'
1186+--
1187+-- * 'spCancelReason'
1188+--
1189+-- * 'spCountryCode'
1190+--
1191+-- * 'spDeveloperPayload'
1192+--
1193+-- * 'spPriceAmountMicros'
1194+--
11771195-- * 'spStartTimeMillis'
11781196subscriptionPurchase
11791197 :: SubscriptionPurchase
11801198subscriptionPurchase =
11811199 SubscriptionPurchase'
1182− { _spKind = "androidpublisher#subscriptionPurchase"
1200+ { _spPaymentState = Nothing
1201+ , _spKind = "androidpublisher#subscriptionPurchase"
11831202 , _spExpiryTimeMillis = Nothing
11841203 , _spAutoRenewing = Nothing
1204+ , _spPriceCurrencyCode = Nothing
1205+ , _spCancelReason = Nothing
1206+ , _spCountryCode = Nothing
1207+ , _spDeveloperPayload = Nothing
1208+ , _spPriceAmountMicros = Nothing
11851209 , _spStartTimeMillis = Nothing
11861210 }
11871211
1212+-- | The payment state of the subscription. Possible values are: - Payment
1213+-- pending - Payment received
1214+spPaymentState :: Lens' SubscriptionPurchase (Maybe Int32)
1215+spPaymentState
1216+ = lens _spPaymentState
1217+ (\ s a -> s{_spPaymentState = a})
1218+ . mapping _Coerce
1219+
11881220-- | This kind represents a subscriptionPurchase object in the
11891221-- androidpublisher service.
11901222spKind :: Lens' SubscriptionPurchase Text
@@ -1204,6 +1236,48 @@ spAutoRenewing
12041236 = lens _spAutoRenewing
12051237 (\ s a -> s{_spAutoRenewing = a})
12061238
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
1241+-- \"GBP\".
1242+spPriceCurrencyCode :: Lens' SubscriptionPurchase (Maybe Text)
1243+spPriceCurrencyCode
1244+ = lens _spPriceCurrencyCode
1245+ (\ s a -> s{_spPriceCurrencyCode = a})
1246+
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
1250+-- billing problem
1251+spCancelReason :: Lens' SubscriptionPurchase (Maybe Int32)
1252+spCancelReason
1253+ = lens _spCancelReason
1254+ (\ s a -> s{_spCancelReason = a})
1255+ . mapping _Coerce
1256+
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)
1260+spCountryCode
1261+ = lens _spCountryCode
1262+ (\ s a -> s{_spCountryCode = a})
1263+
1264+-- | A developer-specified string that contains supplemental information
1265+-- about an order.
1266+spDeveloperPayload :: Lens' SubscriptionPurchase (Maybe Text)
1267+spDeveloperPayload
1268+ = lens _spDeveloperPayload
1269+ (\ s a -> s{_spDeveloperPayload = a})
1270+
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
1274+-- 1990000.
1275+spPriceAmountMicros :: Lens' SubscriptionPurchase (Maybe Int64)
1276+spPriceAmountMicros
1277+ = lens _spPriceAmountMicros
1278+ (\ s a -> s{_spPriceAmountMicros = a})
1279+ . mapping _Coerce
1280+
12071281-- | Time at which the subscription was granted, in milliseconds since Epoch.
12081282spStartTimeMillis :: Lens' SubscriptionPurchase (Maybe Int64)
12091283spStartTimeMillis
@@ -1216,19 +1290,31 @@ instance FromJSON SubscriptionPurchase where
12161290 = withObject "SubscriptionPurchase"
12171291 (\ o ->
12181292 SubscriptionPurchase' <$>
1219− (o .:? "kind" .!=
1220− "androidpublisher#subscriptionPurchase")
1293+ (o .:? "paymentState") <*>
1294+ (o .:? "kind" .!=
1295+ "androidpublisher#subscriptionPurchase")
12211296 <*> (o .:? "expiryTimeMillis")
12221297 <*> (o .:? "autoRenewing")
1298+ <*> (o .:? "priceCurrencyCode")
1299+ <*> (o .:? "cancelReason")
1300+ <*> (o .:? "countryCode")
1301+ <*> (o .:? "developerPayload")
1302+ <*> (o .:? "priceAmountMicros")
12231303 <*> (o .:? "startTimeMillis"))
12241304
12251305instance ToJSON SubscriptionPurchase where
12261306 toJSON SubscriptionPurchase'{..}
12271307 = object
12281308 (catMaybes
1229− [Just ("kind" .= _spKind),
1309+ [("paymentState" .=) <$> _spPaymentState,
1310+ Just ("kind" .= _spKind),
12301311 ("expiryTimeMillis" .=) <$> _spExpiryTimeMillis,
12311312 ("autoRenewing" .=) <$> _spAutoRenewing,
1313+ ("priceCurrencyCode" .=) <$> _spPriceCurrencyCode,
1314+ ("cancelReason" .=) <$> _spCancelReason,
1315+ ("countryCode" .=) <$> _spCountryCode,
1316+ ("developerPayload" .=) <$> _spDeveloperPayload,
1317+ ("priceAmountMicros" .=) <$> _spPriceAmountMicros,
12321318 ("startTimeMillis" .=) <$> _spStartTimeMillis])
12331319
12341320--