describeScalingPlanResources method

Future<DescribeScalingPlanResourcesResponse> describeScalingPlanResources({
  1. required String scalingPlanName,
  2. required int scalingPlanVersion,
  3. int? maxResults,
  4. String? nextToken,
})

Describes the scalable resources in the specified scaling plan.

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

Parameter scalingPlanName : The name of the scaling plan.

Parameter scalingPlanVersion : The version number of the scaling plan.

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

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

Implementation

Future<DescribeScalingPlanResourcesResponse> describeScalingPlanResources({
  required String scalingPlanName,
  required int scalingPlanVersion,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(scalingPlanName, 'scalingPlanName');
  _s.validateStringLength(
    'scalingPlanName',
    scalingPlanName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(scalingPlanVersion, 'scalingPlanVersion');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ScalingPlanName': scalingPlanName,
      'ScalingPlanVersion': scalingPlanVersion,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeScalingPlanResourcesResponse.fromJson(jsonResponse.body);
}