deleteLabels method
Deletes the specified list of labels from a resource.
May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.
Parameter resourceId
:
The ID of the resource.
Parameter authenticationToken
:
Amazon WorkDocs authentication token. Not required when using AWS
administrator credentials to access the API.
Parameter deleteAll
:
Flag to request removal of all labels from the specified resource.
Parameter labels
:
List of labels to delete from the resource.
Implementation
Future<void> deleteLabels({
required String resourceId,
String? authenticationToken,
bool? deleteAll,
List<String>? labels,
}) async {
ArgumentError.checkNotNull(resourceId, 'resourceId');
_s.validateStringLength(
'resourceId',
resourceId,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (deleteAll != null) 'deleteAll': [deleteAll.toString()],
if (labels != null) 'labels': labels,
};
final response = await _protocol.send(
payload: null,
method: 'DELETE',
requestUri: '/api/v1/resources/${Uri.encodeComponent(resourceId)}/labels',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
}