delete method
Permanently deletes a Label and related metadata on Drive Items.
Once deleted, the Label and related Drive item metadata will be deleted. Only draft Labels, and disabled Labels may be deleted.
Request parameters:
name
- Required. Label resource name.
Value must have pattern ^labels/\[^/\]+$
.
useAdminAccess
- Set to true
in order to use the user's admin
credentials. The server will verify the user is an admin for the Label
before allowing access.
writeControl_requiredRevisionId
- The revision_id of the label that the
write request will be applied to. If this is not the latest revision of
the label, the request will not be processed and will return a 400 Bad
Request error.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleProtobufEmpty.
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<GoogleProtobufEmpty> delete(
core.String name, {
core.bool? useAdminAccess,
core.String? writeControl_requiredRevisionId,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (useAdminAccess != null) 'useAdminAccess': ['${useAdminAccess}'],
if (writeControl_requiredRevisionId != null)
'writeControl.requiredRevisionId': [writeControl_requiredRevisionId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleProtobufEmpty.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}