deleteRecommendationPreferences method
- required List<
RecommendationPreferenceName> recommendationPreferenceNames, - required ResourceType resourceType,
- Scope? scope,
Deletes a recommendation preference, such as enhanced infrastructure metrics.
For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
May throw AccessDeniedException.
May throw InternalServerException.
May throw InvalidParameterValueException.
May throw MissingAuthenticationToken.
May throw OptInRequiredException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter recommendationPreferenceNames :
The name of the recommendation preference to delete.
Parameter resourceType :
The target resource type of the recommendation preference to delete.
The Ec2Instance option encompasses standalone instances and
instances that are part of Auto Scaling groups. The
AutoScalingGroup option encompasses only instances that are
part of an Auto Scaling group.
Parameter scope :
An object that describes the scope of the recommendation preference to
delete.
You can delete recommendation preferences that are created at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
Implementation
Future<void> deleteRecommendationPreferences({
required List<RecommendationPreferenceName> recommendationPreferenceNames,
required ResourceType resourceType,
Scope? scope,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'ComputeOptimizerService.DeleteRecommendationPreferences'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'recommendationPreferenceNames':
recommendationPreferenceNames.map((e) => e.value).toList(),
'resourceType': resourceType.value,
if (scope != null) 'scope': scope,
},
);
}