getParametersByPath method

Future<GetParametersByPathResult> getParametersByPath({
  1. required String path,
  2. int? maxResults,
  3. String? nextToken,
  4. List<ParameterStringFilter>? parameterFilters,
  5. bool? recursive,
  6. bool? withDecryption,
})

Retrieve information about one or more parameters in a specific hierarchy.

May throw InternalServerError. May throw InvalidFilterKey. May throw InvalidFilterOption. May throw InvalidFilterValue. May throw InvalidKeyId. May throw InvalidNextToken.

Parameter path : The hierarchy for the parameter. Hierarchies start with a forward slash (/) and end with the parameter name. A parameter name hierarchy can have a maximum of 15 levels. Here is an example of a hierarchy: /Finance/Prod/IAD/WinServ2016/license33

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 : A token to start the list. Use this token to get the next set of results.

Parameter parameterFilters : Filters to limit the request results.

The following Key values are not supported for GetParametersByPath: tag, Name, Path, and Tier.

Parameter recursive : Retrieve all parameters within a hierarchy.

Parameter withDecryption : Retrieve all parameters in a hierarchy with their value decrypted.

Implementation

Future<GetParametersByPathResult> getParametersByPath({
  required String path,
  int? maxResults,
  String? nextToken,
  List<ParameterStringFilter>? parameterFilters,
  bool? recursive,
  bool? withDecryption,
}) async {
  ArgumentError.checkNotNull(path, 'path');
  _s.validateStringLength(
    'path',
    path,
    1,
    2048,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetParametersByPath'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Path': path,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (parameterFilters != null) 'ParameterFilters': parameterFilters,
      if (recursive != null) 'Recursive': recursive,
      if (withDecryption != null) 'WithDecryption': withDecryption,
    },
  );

  return GetParametersByPathResult.fromJson(jsonResponse.body);
}