createLabels method

Future<void> createLabels({
  1. required List<String> labels,
  2. required String resourceId,
  3. String? authenticationToken,
})

Adds the specified list of labels to the given resource (a document or folder)

May throw EntityNotExistsException. May throw FailedDependencyException. May throw ServiceUnavailableException. May throw TooManyLabelsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException.

Parameter labels : List of labels to add to the resource.

Parameter resourceId : The ID of the resource.

Parameter authenticationToken : Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

Implementation

Future<void> createLabels({
  required List<String> labels,
  required String resourceId,
  String? authenticationToken,
}) async {
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $payload = <String, dynamic>{
    'Labels': labels,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/api/v1/resources/${Uri.encodeComponent(resourceId)}/labels',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}