describeScalingPlans method

Future<DescribeScalingPlansResponse> describeScalingPlans({
  1. List<ApplicationSource>? applicationSources,
  2. int? maxResults,
  3. String? nextToken,
  4. List<String>? scalingPlanNames,
  5. int? scalingPlanVersion,
})

Describes one or more of your scaling plans.

May throw ValidationException. May throw InvalidNextTokenException. May throw ConcurrentUpdateException. May throw InternalServiceException.

Parameter applicationSources : The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application sources.

Parameter maxResults : The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.

Parameter nextToken : The token for the next set of results.

Parameter scalingPlanNames : The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan names.

Parameter scalingPlanVersion : The version number of the scaling plan. If you specify a scaling plan version, you must also specify a scaling plan name.

Implementation

Future<DescribeScalingPlansResponse> describeScalingPlans({
  List<ApplicationSource>? applicationSources,
  int? maxResults,
  String? nextToken,
  List<String>? scalingPlanNames,
  int? scalingPlanVersion,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AnyScaleScalingPlannerFrontendService.DescribeScalingPlans'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (applicationSources != null)
        'ApplicationSources': applicationSources,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (scalingPlanNames != null) 'ScalingPlanNames': scalingPlanNames,
      if (scalingPlanVersion != null)
        'ScalingPlanVersion': scalingPlanVersion,
    },
  );

  return DescribeScalingPlansResponse.fromJson(jsonResponse.body);
}