patch method
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.
allowMissing
- Optional. If set to true, and the subscription offer with
the given package_name, product_id, base_plan_id and offer_id doesn't
exist, an offer will be created. If a new offer is created, update_mask is
ignored.
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.
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.bool? allowMissing,
core.String? latencyTolerance,
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 (allowMissing != null) 'allowMissing': ['${allowMissing}'],
if (latencyTolerance != null) 'latencyTolerance': [latencyTolerance],
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>);
}