listDatasets method

Future<ListDatasetsResponse> listDatasets({
  1. DatasetFilter? filter,
  2. String? flywheelArn,
  3. int? maxResults,
  4. String? nextToken,
})

List the datasets that you have configured in this Region. For more information about datasets, see Flywheel overview in the Amazon Comprehend Developer Guide.

May throw InternalServerException. May throw InvalidFilterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter filter : Filters the datasets to be returned in the response.

Parameter flywheelArn : The Amazon Resource Number (ARN) of the flywheel.

Parameter maxResults : Maximum number of results to return in a response. The default is 100.

Parameter nextToken : Identifies the next page of results to return.

Implementation

Future<ListDatasetsResponse> listDatasets({
  DatasetFilter? filter,
  String? flywheelArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Comprehend_20171127.ListDatasets'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filter != null) 'Filter': filter,
      if (flywheelArn != null) 'FlywheelArn': flywheelArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListDatasetsResponse.fromJson(jsonResponse.body);
}