patch method

Future<InAppProduct> patch(
  1. InAppProduct request,
  2. String packageName,
  3. String sku, {
  4. bool? autoConvertMissingPrices,
  5. String? latencyTolerance,
  6. String? $fields,
})

Patches an in-app product (a managed product or a subscription).

This method should no longer be used to update subscriptions. See this article for more information.

request - The metadata request object.

Request parameters:

packageName - Package name of the app.

sku - Unique identifier for the in-app product.

autoConvertMissingPrices - If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.

latencyTolerance - Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. Possible string values are:

  • "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" : Defaults to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE.
  • "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" : The update will propagate to clients within several minutes on average and up to a few hours in rare cases. Throughput is limited to 7,200 updates per app per hour.
  • "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT" : The update will propagate to clients within 24 hours. Supports high throughput of up to 720,000 updates per app per hour using batch modification methods.

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

Completes with a InAppProduct.

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<InAppProduct> patch(
  InAppProduct request,
  core.String packageName,
  core.String sku, {
  core.bool? autoConvertMissingPrices,
  core.String? latencyTolerance,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (autoConvertMissingPrices != null)
      'autoConvertMissingPrices': ['${autoConvertMissingPrices}'],
    if (latencyTolerance != null) 'latencyTolerance': [latencyTolerance],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'androidpublisher/v3/applications/' +
      commons.escapeVariable('$packageName') +
      '/inappproducts/' +
      commons.escapeVariable('$sku');

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