listDatasets method

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

Retrieves a paginated list of datasets for a specific target resource.

May throw InternalFailureException. May throw InvalidRequestException. May throw ThrottlingException.

Parameter sourceType : The type of data source for the dataset.

Parameter maxResults : The maximum number of results to return for each paginated request.

Parameter nextToken : The token for the next set of results, or null if there are no additional results.

Implementation

Future<ListDatasetsResponse> listDatasets({
  required DatasetSourceType sourceType,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    'sourceType': [sourceType.value],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/datasets',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDatasetsResponse.fromJson(response);
}