listSolutionVersions method

Future<ListSolutionVersionsResponse> listSolutionVersions({
  1. int? maxResults,
  2. String? nextToken,
  3. String? solutionArn,
})

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

May throw InvalidInputException. May throw ResourceNotFoundException. May throw InvalidNextTokenException.

Parameter maxResults : The maximum number of solution versions to return.

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

Parameter solutionArn : The Amazon Resource Name (ARN) of the solution.

Implementation

Future<ListSolutionVersionsResponse> listSolutionVersions({
  int? maxResults,
  String? nextToken,
  String? solutionArn,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    1300,
  );
  _s.validateStringLength(
    'solutionArn',
    solutionArn,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonPersonalize.ListSolutionVersions'
  };
  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,
      if (solutionArn != null) 'solutionArn': solutionArn,
    },
  );

  return ListSolutionVersionsResponse.fromJson(jsonResponse.body);
}