publish method
- GoogleAppsDriveLabelsV2PublishLabelRequest request,
- String name, {
- String? $fields,
Publish all draft changes to the label.
Once published, the label may not return to its draft state. For more information, see Create and publish a label. Publishing a label will result in a new published revision. All previous draft revisions will be deleted. Previous published revisions will be kept but are subject to automated deletion as needed. For more information, see Label lifecycle. Once published, some changes are no longer permitted. Generally, any change that would invalidate or cause new restrictions on existing metadata related to the label will be rejected. For example, the following changes to a label will be rejected after the label is published: * The label cannot be directly deleted. It must be disabled first, then deleted.
Field.FieldType
cannot be changed. * Changes to field validation options cannot reject something that was previously accepted. * Reducing the maximum entries.
request
- The metadata request object.
Request parameters:
name
- Required. Label resource name.
Value must have pattern ^labels/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleAppsDriveLabelsV2Label.
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<GoogleAppsDriveLabelsV2Label> publish(
GoogleAppsDriveLabelsV2PublishLabelRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$name') + ':publish';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleAppsDriveLabelsV2Label.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}