updateFolder method

Future<void> updateFolder({
  1. required String folderId,
  2. String? authenticationToken,
  3. String? name,
  4. String? parentFolderId,
  5. ResourceStateType? resourceState,
})

Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.

May throw ConcurrentModificationException. May throw ConflictingOperationException. May throw EntityAlreadyExistsException. May throw EntityNotExistsException. May throw FailedDependencyException. May throw LimitExceededException. May throw ProhibitedStateException. May throw ServiceUnavailableException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException.

Parameter folderId : The ID of the folder.

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

Parameter name : The name of the folder.

Parameter parentFolderId : The ID of the parent folder.

Parameter resourceState : The resource state of the folder. Only ACTIVE and RECYCLED are accepted values from the API.

Implementation

Future<void> updateFolder({
  required String folderId,
  String? authenticationToken,
  String? name,
  String? parentFolderId,
  ResourceStateType? resourceState,
}) async {
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $payload = <String, dynamic>{
    if (name != null) 'Name': name,
    if (parentFolderId != null) 'ParentFolderId': parentFolderId,
    if (resourceState != null) 'ResourceState': resourceState.value,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/api/v1/folders/${Uri.encodeComponent(folderId)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}