listDocumentMetadataHistory method

Future<ListDocumentMetadataHistoryResponse> listDocumentMetadataHistory({
  1. required DocumentMetadataEnum metadata,
  2. required String name,
  3. String? documentVersion,
  4. int? maxResults,
  5. String? nextToken,
})

Information about approval reviews for a version of an SSM document.

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

Parameter metadata : The type of data for which details are being requested. Currently, the only supported value is DocumentReviews.

Parameter name : The name of the document.

Parameter documentVersion : The version of the document.

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<ListDocumentMetadataHistoryResponse> listDocumentMetadataHistory({
  required DocumentMetadataEnum metadata,
  required String name,
  String? documentVersion,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(metadata, 'metadata');
  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.ListDocumentMetadataHistory'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Metadata': metadata.toValue(),
      'Name': name,
      if (documentVersion != null) 'DocumentVersion': documentVersion,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListDocumentMetadataHistoryResponse.fromJson(jsonResponse.body);
}