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