updateAutomationRuleV2 method

Future<void> updateAutomationRuleV2({
  1. required String identifier,
  2. List<AutomationRulesActionV2>? actions,
  3. Criteria? criteria,
  4. String? description,
  5. String? ruleName,
  6. double? ruleOrder,
  7. RuleStatusV2? ruleStatus,
})

Updates a V2 automation rule.

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

Parameter identifier : The ARN of the automation rule.

Parameter actions : A list of actions to be performed when the rule criteria is met.

Parameter criteria : The filtering type and configuration of the automation rule.

Parameter description : A description of the automation rule.

Parameter ruleName : The name of the automation rule.

Parameter ruleOrder : Represents a value for the rule priority.

Parameter ruleStatus : The status of the automation rule.

Implementation

Future<void> updateAutomationRuleV2({
  required String identifier,
  List<AutomationRulesActionV2>? actions,
  Criteria? criteria,
  String? description,
  String? ruleName,
  double? ruleOrder,
  RuleStatusV2? ruleStatus,
}) async {
  _s.validateNumRange(
    'ruleOrder',
    ruleOrder,
    1.0,
    1000.0,
  );
  final $payload = <String, dynamic>{
    if (actions != null) 'Actions': actions,
    if (criteria != null) 'Criteria': criteria,
    if (description != null) 'Description': description,
    if (ruleName != null) 'RuleName': ruleName,
    if (ruleOrder != null) 'RuleOrder': ruleOrder,
    if (ruleStatus != null) 'RuleStatus': ruleStatus.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/automationrulesv2/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
}