publish method
Submit the item to be published in the store.
The item will be submitted for review unless skip_review is set to true,
or the item is staged from a previous submission with publish_type set
to STAGED_PUBLISH.
request - The metadata request object.
Request parameters:
name - Required. Name of the item in the form
publishers/{publisherId}/items/{itemId}
Value must have pattern ^publishers/\[^/\]+/items/\[^/\]+$.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a PublishItemResponse.
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<PublishItemResponse> publish(
PublishItemRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$name') + ':publish';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return PublishItemResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}