listStateMachineVersions method

Future<ListStateMachineVersionsOutput> listStateMachineVersions({
  1. required String stateMachineArn,
  2. int? maxResults,
  3. String? nextToken,
})

Lists versions for the specified state machine Amazon Resource Name (ARN).

The results are sorted in descending order of the version creation time.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Related operations:

May throw InvalidArn. May throw InvalidToken. May throw ValidationException.

Parameter stateMachineArn : The Amazon Resource Name (ARN) of the state machine.

Parameter maxResults : The maximum number of results that are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000. A value of 0 uses the default.

This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.

Parameter nextToken : If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Implementation

Future<ListStateMachineVersionsOutput> listStateMachineVersions({
  required String stateMachineArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSStepFunctions.ListStateMachineVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'stateMachineArn': stateMachineArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListStateMachineVersionsOutput.fromJson(jsonResponse.body);
}