getParameter method

Future<GetParameterResult> getParameter({
  1. required String name,
  2. bool? withDecryption,
})

Get information about a parameter by using the parameter name. Don't confuse this API action with the GetParameters API action.

May throw InternalServerError. May throw InvalidKeyId. May throw ParameterNotFound. May throw ParameterVersionNotFound.

Parameter name : The name of the parameter you want to query.

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

Implementation

Future<GetParameterResult> getParameter({
  required String name,
  bool? withDecryption,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetParameter'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (withDecryption != null) 'WithDecryption': withDecryption,
    },
  );

  return GetParameterResult.fromJson(jsonResponse.body);
}