listDatasets method

Future<ListDatasetsResponse> listDatasets({
  1. String? datasetNameBeginsWith,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all datasets currently available in your account, filtering on the dataset name.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter datasetNameBeginsWith : The beginning of the name of the datasets to be listed.

Parameter maxResults : Specifies the maximum number of datasets to list.

Parameter nextToken : An opaque pagination token indicating where to continue the listing of datasets.

Implementation

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

  return ListDatasetsResponse.fromJson(jsonResponse.body);
}