listIndex method

Future<ListIndexResponse> listIndex({
  1. required String directoryArn,
  2. required ObjectReference indexReference,
  3. ConsistencyLevel? consistencyLevel,
  4. int? maxResults,
  5. String? nextToken,
  6. List<ObjectAttributeRange>? rangesOnIndexedValues,
})

Lists objects attached to the specified index.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw FacetValidationException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw InvalidNextTokenException. May throw ResourceNotFoundException. May throw NotIndexException.

Parameter directoryArn : The ARN of the directory that the index exists in.

Parameter indexReference : The reference to the index to list.

Parameter consistencyLevel : The consistency level to execute the request at.

Parameter maxResults : The maximum number of objects in a single page to retrieve from the index during a request. For more information, see AWS Directory Service Limits.

Parameter nextToken : The pagination token.

Parameter rangesOnIndexedValues : Specifies the ranges of indexed values that you want to query.

Implementation

Future<ListIndexResponse> listIndex({
  required String directoryArn,
  required ObjectReference indexReference,
  ConsistencyLevel? consistencyLevel,
  int? maxResults,
  String? nextToken,
  List<ObjectAttributeRange>? rangesOnIndexedValues,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(indexReference, 'indexReference');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
    if (consistencyLevel != null)
      'x-amz-consistency-level': consistencyLevel.toValue(),
  };
  final $payload = <String, dynamic>{
    'IndexReference': indexReference,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (rangesOnIndexedValues != null)
      'RangesOnIndexedValues': rangesOnIndexedValues,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/amazonclouddirectory/2017-01-11/index/targets',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ListIndexResponse.fromJson(response);
}