listDocumentVersions method

Future<ListDocumentVersionsResult> listDocumentVersions({
  1. required String name,
  2. int? maxResults,
  3. String? nextToken,
})

List all versions for a document.

May throw InternalServerError. May throw InvalidNextToken. May throw InvalidDocument.

Parameter name : The name of the document. You can specify an Amazon Resource Name (ARN).

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<ListDocumentVersionsResult> listDocumentVersions({
  required String name,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListDocumentVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListDocumentVersionsResult.fromJson(jsonResponse.body);
}