migratePrices method

Future<MigrateBasePlanPricesResponse> migratePrices(
  1. MigrateBasePlanPricesRequest request,
  2. String packageName,
  3. String productId,
  4. String basePlanId, {
  5. String? $fields,
})

Migrates subscribers who are receiving an historical subscription price to the currently-offered price for the specified region.

Requests will cause price change notifications to be sent to users who are currently receiving an historical price older than the supplied timestamp. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.

request - The metadata request object.

Request parameters:

packageName - Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.

productId - Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.

basePlanId - Required. The unique base plan ID of the base plan to update prices on.

$fields - Selector specifying which fields to include in a partial response.

Completes with a MigrateBasePlanPricesResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<MigrateBasePlanPricesResponse> migratePrices(
  MigrateBasePlanPricesRequest request,
  core.String packageName,
  core.String productId,
  core.String basePlanId, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'androidpublisher/v3/applications/' +
      commons.escapeVariable('$packageName') +
      '/subscriptions/' +
      commons.escapeVariable('$productId') +
      '/basePlans/' +
      commons.escapeVariable('$basePlanId') +
      ':migratePrices';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return MigrateBasePlanPricesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}