getResources method
Retrieves a collection of resources, including folders and documents. The
only CollectionType supported is SHARED_WITH_ME.
May throw FailedDependencyException.
May throw InvalidArgumentException.
May throw ServiceUnavailableException.
May throw UnauthorizedOperationException.
May throw UnauthorizedResourceAccessException.
Parameter authenticationToken :
The Amazon WorkDocs authentication token. Not required when using Amazon
Web Services administrator credentials to access the API.
Parameter collectionType :
The collection type.
Parameter limit :
The maximum number of resources to return.
Parameter marker :
The marker for the next set of results. This marker was received from a
previous call.
Parameter userId :
The user ID for the resource collection. This is a required field for
accessing the API operation using IAM credentials.
Implementation
Future<GetResourcesResponse> getResources({
String? authenticationToken,
ResourceCollectionType? collectionType,
int? limit,
String? marker,
String? userId,
}) async {
_s.validateNumRange(
'limit',
limit,
1,
999,
);
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (collectionType != null) 'collectionType': [collectionType.value],
if (limit != null) 'limit': [limit.toString()],
if (marker != null) 'marker': [marker],
if (userId != null) 'userId': [userId],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/api/v1/resources',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetResourcesResponse.fromJson(response);
}