describePolicies method

Future<PoliciesType> describePolicies({
  1. String? autoScalingGroupName,
  2. int? maxRecords,
  3. String? nextToken,
  4. List<String>? policyNames,
  5. List<String>? policyTypes,
})

Gets information about the scaling policies in the account and Region.

May throw InvalidNextToken. May throw ResourceContentionFault. May throw ServiceLinkedRoleFailure.

Parameter autoScalingGroupName : The name of the Auto Scaling group.

Parameter maxRecords : The maximum number of items to be returned with each call. The default value is 50 and the maximum value is 100.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Parameter policyNames : The names of one or more policies. If you omit this property, all policies are described. If a group name is provided, the results are limited to that group. If you specify an unknown policy name, it is ignored with no error.

Array Members: Maximum number of 50 items.

Parameter policyTypes : One or more policy types. The valid values are SimpleScaling, StepScaling, TargetTrackingScaling, and PredictiveScaling.

Implementation

Future<PoliciesType> describePolicies({
  String? autoScalingGroupName,
  int? maxRecords,
  String? nextToken,
  List<String>? policyNames,
  List<String>? policyTypes,
}) async {
  final $request = <String, String>{
    if (autoScalingGroupName != null)
      'AutoScalingGroupName': autoScalingGroupName,
    if (maxRecords != null) 'MaxRecords': maxRecords.toString(),
    if (nextToken != null) 'NextToken': nextToken,
    if (policyNames != null)
      if (policyNames.isEmpty)
        'PolicyNames': ''
      else
        for (var i1 = 0; i1 < policyNames.length; i1++)
          'PolicyNames.member.${i1 + 1}': policyNames[i1],
    if (policyTypes != null)
      if (policyTypes.isEmpty)
        'PolicyTypes': ''
      else
        for (var i1 = 0; i1 < policyTypes.length; i1++)
          'PolicyTypes.member.${i1 + 1}': policyTypes[i1],
  };
  final $result = await _protocol.send(
    $request,
    action: 'DescribePolicies',
    version: '2011-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DescribePoliciesResult',
  );
  return PoliciesType.fromXml($result);
}