getParameterHistory method

Future<GetParameterHistoryResult> getParameterHistory({
  1. required String name,
  2. int? maxResults,
  3. String? nextToken,
  4. bool? withDecryption,
})

Retrieves the history of all changes to a parameter.

Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a ValidationException error.

May throw InternalServerError. May throw InvalidKeyId. May throw InvalidNextToken. May throw ParameterNotFound.

Parameter name : The name or Amazon Resource Name (ARN) of the parameter for which you want to review history. For parameters shared with you from another account, you must use the full 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.)

Parameter withDecryption : Return decrypted values for secure string parameters. This flag is ignored for String and StringList parameter types.

Implementation

Future<GetParameterHistoryResult> getParameterHistory({
  required String name,
  int? maxResults,
  String? nextToken,
  bool? withDecryption,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetParameterHistory'
  };
  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,
      if (withDecryption != null) 'WithDecryption': withDecryption,
    },
  );

  return GetParameterHistoryResult.fromJson(jsonResponse.body);
}