publish method
Publishes an item.
request - The metadata request object.
Request parameters:
itemId - The ID of the item to publish.
deployPercentage - The deploy percentage you want to set for your item.
Valid values are [0, 100]. If set to any number less than 100, only that
many percentage of users will be allowed to get the update.
publishTarget - Provide defined publishTarget in URL (case sensitive):
publishTarget="trustedTesters" or publishTarget="default". Defaults to
publishTarget="default".
reviewExemption - Optional. The caller request to exempt the review and
directly publish because the update is within the list that we can
automatically validate. The API will check if the exemption can be granted
using real time data.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Item2.
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<Item2> publish(
PublishRequest request,
core.String itemId, {
core.int? deployPercentage,
core.String? publishTarget,
core.bool? reviewExemption,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'deployPercentage': ?deployPercentage == null
? null
: ['${deployPercentage}'],
'publishTarget': ?publishTarget == null ? null : [publishTarget],
'reviewExemption': ?reviewExemption == null
? null
: ['${reviewExemption}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'chromewebstore/v1.1/items/' +
commons.escapeVariable('$itemId') +
'/publish';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Item2.fromJson(response_ as core.Map<core.String, core.dynamic>);
}