describeFolderContents method

Future<DescribeFolderContentsResponse> describeFolderContents({
  1. required String folderId,
  2. String? authenticationToken,
  3. String? include,
  4. int? limit,
  5. String? marker,
  6. OrderType? order,
  7. ResourceSortType? sort,
  8. FolderContentType? type,
})

Describes the contents of the specified folder, including its documents and subfolders.

By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more results, the response includes a marker that you can use to request the next set of results. You can also request initialized documents.

May throw EntityNotExistsException. 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 include : The contents to include. Specify "INITIALIZED" to include initialized documents.

Parameter limit : The maximum number of items to return with this call.

Parameter marker : The marker for the next set of results. This marker was received from a previous call.

Parameter order : The order for the contents of the folder.

Parameter sort : The sorting criteria.

Parameter type : The type of items.

Implementation

Future<DescribeFolderContentsResponse> describeFolderContents({
  required String folderId,
  String? authenticationToken,
  String? include,
  int? limit,
  String? marker,
  OrderType? order,
  ResourceSortType? sort,
  FolderContentType? type,
}) async {
  ArgumentError.checkNotNull(folderId, 'folderId');
  _s.validateStringLength(
    'folderId',
    folderId,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
  );
  _s.validateStringLength(
    'include',
    include,
    1,
    256,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    999,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    2048,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $query = <String, List<String>>{
    if (include != null) 'include': [include],
    if (limit != null) 'limit': [limit.toString()],
    if (marker != null) 'marker': [marker],
    if (order != null) 'order': [order.toValue()],
    if (sort != null) 'sort': [sort.toValue()],
    if (type != null) 'type': [type.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/api/v1/folders/${Uri.encodeComponent(folderId)}/contents',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeFolderContentsResponse.fromJson(response);
}