listSolutions method

Future<ListSolutionsResponse> listSolutions({
  1. String? datasetGroupArn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of solutions that use the given dataset group. When a dataset group is not specified, all the solutions associated with the account are listed. The response provides the properties for each solution, including the Amazon Resource Name (ARN). For more information on solutions, see CreateSolution.

May throw InvalidInputException. May throw InvalidNextTokenException.

Parameter datasetGroupArn : The Amazon Resource Name (ARN) of the dataset group.

Parameter maxResults : The maximum number of solutions to return.

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

Implementation

Future<ListSolutionsResponse> listSolutions({
  String? datasetGroupArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateStringLength(
    'datasetGroupArn',
    datasetGroupArn,
    0,
    256,
  );
  _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.ListSolutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (datasetGroupArn != null) 'datasetGroupArn': datasetGroupArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListSolutionsResponse.fromJson(jsonResponse.body);
}