getParameters method

Future<GetParametersResult> getParameters({
  1. required List<String> names,
  2. bool? withDecryption,
})

Get information about one or more parameters by specifying multiple parameter names. 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.

Parameter names : The names or Amazon Resource Names (ARNs) of the parameters that you want to query. For parameters shared with you from another account, you must use the full ARNs.

To query by parameter label, use "Name": "name:label". To query by parameter version, use "Name": "name:version". For information about shared parameters, see Working with shared parameters in the Amazon Web Services Systems Manager User Guide.

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

Implementation

Future<GetParametersResult> getParameters({
  required List<String> names,
  bool? withDecryption,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetParameters'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Names': names,
      if (withDecryption != null) 'WithDecryption': withDecryption,
    },
  );

  return GetParametersResult.fromJson(jsonResponse.body);
}