updateGatewayRule method

Future<UpdateGatewayRuleResponse> updateGatewayRule({
  1. required String gatewayIdentifier,
  2. required String ruleId,
  3. List<Action>? actions,
  4. List<Condition>? conditions,
  5. String? description,
  6. int? priority,
})

Updates a gateway rule's priority, conditions, actions, or description.

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

Parameter gatewayIdentifier : The identifier of the gateway containing the rule.

Parameter ruleId : The unique identifier of the rule to update.

Parameter actions : The updated actions for the rule.

Parameter conditions : The updated conditions for the rule.

Parameter description : The updated description of the rule.

Parameter priority : The updated priority of the rule.

Implementation

Future<UpdateGatewayRuleResponse> updateGatewayRule({
  required String gatewayIdentifier,
  required String ruleId,
  List<Action>? actions,
  List<Condition>? conditions,
  String? description,
  int? priority,
}) async {
  _s.validateNumRange(
    'priority',
    priority,
    1,
    1000000,
  );
  final $payload = <String, dynamic>{
    if (actions != null) 'actions': actions,
    if (conditions != null) 'conditions': conditions,
    if (description != null) 'description': description,
    if (priority != null) 'priority': priority,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/gateways/${Uri.encodeComponent(gatewayIdentifier)}/rules/${Uri.encodeComponent(ruleId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateGatewayRuleResponse.fromJson(response);
}