patch method

Future<SubscriptionOffer> patch(
  1. SubscriptionOffer request,
  2. String packageName,
  3. String productId,
  4. String basePlanId,
  5. String offerId, {
  6. String? regionsVersion_version,
  7. String? updateMask,
  8. String? $fields,
})

Updates an existing subscription offer.

request - The metadata request object.

Request parameters:

packageName - Required. Immutable. The package name of the app the parent subscription belongs to.

productId - Required. Immutable. The ID of the parent subscription this offer belongs to.

basePlanId - Required. Immutable. The ID of the base plan to which this offer is an extension.

offerId - Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.

regionsVersion_version - Required. A string representing the version of available regions being used for the specified resource. Regional prices for the resource have to be specified according to the information published in this article. Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available. The latest version is 2022/02.

updateMask - Required. The list of fields to be updated.

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

Completes with a SubscriptionOffer.

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<SubscriptionOffer> patch(
  SubscriptionOffer request,
  core.String packageName,
  core.String productId,
  core.String basePlanId,
  core.String offerId, {
  core.String? regionsVersion_version,
  core.String? updateMask,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (regionsVersion_version != null)
      'regionsVersion.version': [regionsVersion_version],
    if (updateMask != null) 'updateMask': [updateMask],
    if ($fields != null) 'fields': [$fields],
  };

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

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