getFolder method
Retrieves the metadata of the specified folder.
May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw InvalidArgumentException. May throw FailedDependencyException. May throw ServiceUnavailableException. May throw ProhibitedStateException.
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 includeCustomMetadata
:
Set to TRUE to include custom metadata in the response.
Implementation
Future<GetFolderResponse> getFolder({
required String folderId,
String? authenticationToken,
bool? includeCustomMetadata,
}) async {
ArgumentError.checkNotNull(folderId, 'folderId');
_s.validateStringLength(
'folderId',
folderId,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (includeCustomMetadata != null)
'includeCustomMetadata': [includeCustomMetadata.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/api/v1/folders/${Uri.encodeComponent(folderId)}',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetFolderResponse.fromJson(response);
}