listDatasetGroups method

Future<ListDatasetGroupsResponse> listDatasetGroups({
  1. int? maxResults,
  2. String? nextToken,
})

Returns a list of dataset groups. The response provides the properties for each dataset group, including the Amazon Resource Name (ARN). For more information on dataset groups, see CreateDatasetGroup.

May throw InvalidNextTokenException.

Parameter maxResults : The maximum number of dataset groups to return.

Parameter nextToken : A token returned from the previous call to ListDatasetGroups for getting the next set of dataset groups (if they exist).

Implementation

Future<ListDatasetGroupsResponse> listDatasetGroups({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    1300,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonPersonalize.ListDatasetGroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListDatasetGroupsResponse.fromJson(jsonResponse.body);
}