modifyRule method

Future<ModifyRuleOutput> modifyRule({
  1. required String ruleArn,
  2. List<Action>? actions,
  3. List<RuleCondition>? conditions,
  4. bool? resetTransforms,
  5. List<RuleTransform>? transforms,
})

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 IncompatibleProtocolsException. May throw InvalidLoadBalancerActionException. May throw OperationNotPermittedException. May throw RuleNotFoundException. May throw TargetGroupAssociationLimitException. May throw TargetGroupNotFoundException. May throw TooManyActionsException. May throw TooManyRegistrationsForTargetIdException. May throw TooManyTargetsException. May throw TooManyUniqueTargetGroupsPerLoadBalancerException. May throw UnsupportedProtocolException.

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

Parameter actions : The actions.

Parameter conditions : The conditions.

Parameter resetTransforms : Indicates whether to remove all transforms from the rule. If you specify ResetTransforms, you can't specify Transforms.

Parameter transforms : The transforms to apply to requests that match this rule. You can add one host header rewrite transform and one URL rewrite transform. If you specify Transforms, you can't specify ResetTransforms.

Implementation

Future<ModifyRuleOutput> modifyRule({
  required String ruleArn,
  List<Action>? actions,
  List<RuleCondition>? conditions,
  bool? resetTransforms,
  List<RuleTransform>? transforms,
}) async {
  final $request = <String, String>{
    'RuleArn': ruleArn,
    if (actions != null)
      if (actions.isEmpty)
        'Actions': ''
      else
        for (var i1 = 0; i1 < actions.length; i1++)
          for (var e3 in actions[i1].toQueryMap().entries)
            'Actions.member.${i1 + 1}.${e3.key}': e3.value,
    if (conditions != null)
      if (conditions.isEmpty)
        'Conditions': ''
      else
        for (var i1 = 0; i1 < conditions.length; i1++)
          for (var e3 in conditions[i1].toQueryMap().entries)
            'Conditions.member.${i1 + 1}.${e3.key}': e3.value,
    if (resetTransforms != null)
      'ResetTransforms': resetTransforms.toString(),
    if (transforms != null)
      if (transforms.isEmpty)
        'Transforms': ''
      else
        for (var i1 = 0; i1 < transforms.length; i1++)
          for (var e3 in transforms[i1].toQueryMap().entries)
            'Transforms.member.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'ModifyRule',
    version: '2015-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'ModifyRuleResult',
  );
  return ModifyRuleOutput.fromXml($result);
}