createFolder method

Future<CreateFolderResponse> createFolder({
  1. required String parentFolderId,
  2. String? authenticationToken,
  3. String? name,
})

Creates a folder with the specified name and parent folder.

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 parentFolderId : The ID of the parent 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 new folder.

Implementation

Future<CreateFolderResponse> createFolder({
  required String parentFolderId,
  String? authenticationToken,
  String? name,
}) async {
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $payload = <String, dynamic>{
    'ParentFolderId': parentFolderId,
    if (name != null) 'Name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/api/v1/folders',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return CreateFolderResponse.fromJson(response);
}