updatePricingRule method

Future<UpdatePricingRuleOutput> updatePricingRule({
  1. required String arn,
  2. String? description,
  3. double? modifierPercentage,
  4. String? name,
  5. UpdateTieringInput? tiering,
  6. PricingRuleType? type,
})

Updates an existing pricing rule.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter arn : The Amazon Resource Name (ARN) of the pricing rule to update.

Parameter description : The new description for the pricing rule.

Parameter modifierPercentage : The new modifier to show pricing plan rates as a percentage. Your entry will be rounded to the nearest 2 decimal places.

Parameter name : The new name of the pricing rule. The name must be unique to each pricing rule.

Parameter tiering : The set of tiering configurations for the pricing rule.

Parameter type : The new pricing rule type.

Implementation

Future<UpdatePricingRuleOutput> updatePricingRule({
  required String arn,
  String? description,
  double? modifierPercentage,
  String? name,
  UpdateTieringInput? tiering,
  PricingRuleType? type,
}) async {
  _s.validateNumRange(
    'modifierPercentage',
    modifierPercentage,
    0,
    1152921504606846976,
  );
  final $payload = <String, dynamic>{
    'Arn': arn,
    if (description != null) 'Description': description,
    if (modifierPercentage != null) 'ModifierPercentage': modifierPercentage,
    if (name != null) 'Name': name,
    if (tiering != null) 'Tiering': tiering,
    if (type != null) 'Type': type.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/update-pricing-rule',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePricingRuleOutput.fromJson(response);
}