modifyRule method

Future<ModifyRuleOutput> modifyRule({
  1. required String ruleArn,
  2. List<Action>? actions,
  3. List<RuleCondition>? conditions,
})

Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

May throw TargetGroupAssociationLimitException. May throw IncompatibleProtocolsException. May throw RuleNotFoundException. May throw OperationNotPermittedException. May throw TooManyRegistrationsForTargetIdException. May throw TooManyTargetsException. May throw TargetGroupNotFoundException. May throw UnsupportedProtocolException. May throw TooManyActionsException. May throw InvalidLoadBalancerActionException. May throw TooManyUniqueTargetGroupsPerLoadBalancerException.

Parameter ruleArn : The Amazon Resource Name (ARN) of the rule.

Parameter actions : The actions.

Parameter conditions : The conditions.

Implementation

Future<ModifyRuleOutput> modifyRule({
  required String ruleArn,
  List<Action>? actions,
  List<RuleCondition>? conditions,
}) async {
  ArgumentError.checkNotNull(ruleArn, 'ruleArn');
  final $request = <String, dynamic>{};
  $request['RuleArn'] = ruleArn;
  actions?.also((arg) => $request['Actions'] = arg);
  conditions?.also((arg) => $request['Conditions'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyRule',
    version: '2015-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyRuleInput'],
    shapes: shapes,
    resultWrapper: 'ModifyRuleResult',
  );
  return ModifyRuleOutput.fromXml($result);
}