updateProxyRule method

Future<UpdateProxyRuleResponse> updateProxyRule({
  1. required String proxyRuleName,
  2. required String updateToken,
  3. ProxyRulePhaseAction? action,
  4. List<ProxyRuleCondition>? addConditions,
  5. String? description,
  6. String? proxyRuleGroupArn,
  7. String? proxyRuleGroupName,
  8. List<ProxyRuleCondition>? removeConditions,
})

Updates the properties of the specified proxy rule.

May throw InternalServerError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter proxyRuleName : The descriptive name of the proxy rule. You can't change the name of a proxy rule after you create it.

Parameter updateToken : A token used for optimistic locking. Network Firewall returns a token to your requests that access the proxy rule. The token marks the state of the proxy rule resource at the time of the request.

To make changes to the proxy rule, you provide the token in your request. Network Firewall uses the token to ensure that the proxy rule hasn't changed since you last retrieved it. If it has changed, the operation fails with an InvalidTokenException. If this happens, retrieve the proxy rule again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.

Parameter action : Depending on the match action, the proxy either stops the evaluation (if the action is terminal - allow or deny), or continues it (if the action is alert) until it matches a rule with a terminal action.

Parameter addConditions : Proxy rule conditions to add. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.

Parameter description : A description of the proxy rule.

Parameter proxyRuleGroupArn : The Amazon Resource Name (ARN) of a proxy rule group.

You must specify the ARN or the name, and you can specify both.

Parameter proxyRuleGroupName : The descriptive name of the proxy rule group. You can't change the name of a proxy rule group after you create it.

You must specify the ARN or the name, and you can specify both.

Parameter removeConditions : Proxy rule conditions to remove. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.

Implementation

Future<UpdateProxyRuleResponse> updateProxyRule({
  required String proxyRuleName,
  required String updateToken,
  ProxyRulePhaseAction? action,
  List<ProxyRuleCondition>? addConditions,
  String? description,
  String? proxyRuleGroupArn,
  String? proxyRuleGroupName,
  List<ProxyRuleCondition>? removeConditions,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.UpdateProxyRule'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProxyRuleName': proxyRuleName,
      'UpdateToken': updateToken,
      if (action != null) 'Action': action.value,
      if (addConditions != null) 'AddConditions': addConditions,
      if (description != null) 'Description': description,
      if (proxyRuleGroupArn != null) 'ProxyRuleGroupArn': proxyRuleGroupArn,
      if (proxyRuleGroupName != null)
        'ProxyRuleGroupName': proxyRuleGroupName,
      if (removeConditions != null) 'RemoveConditions': removeConditions,
    },
  );

  return UpdateProxyRuleResponse.fromJson(jsonResponse.body);
}