updateFolder method
- required String folderId,
- String? authenticationToken,
- String? name,
- String? parentFolderId,
- 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 EntityNotExistsException. May throw EntityAlreadyExistsException. May throw ProhibitedStateException. May throw ConflictingOperationException. May throw ConcurrentModificationException. May throw LimitExceededException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.
Parameter folderId
:
The ID of the folder.
Parameter authenticationToken
:
Amazon WorkDocs authentication token. Not required when using AWS
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 {
ArgumentError.checkNotNull(folderId, 'folderId');
_s.validateStringLength(
'folderId',
folderId,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
_s.validateStringLength(
'name',
name,
1,
255,
);
_s.validateStringLength(
'parentFolderId',
parentFolderId,
1,
128,
);
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.toValue(),
};
await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri: '/api/v1/folders/${Uri.encodeComponent(folderId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}