delete method
Permanently deletes a label and related metadata on Drive items.
For more information, see Disable, enable, and delete a label. 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 isn't 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>,
);
}