updateEventRule method

Future<UpdateEventRuleResponse> updateEventRule({
  1. required String arn,
  2. String? eventPattern,
  3. List<String>? regions,
})

Updates an existing EventRule.

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

Parameter arn : The Amazon Resource Name (ARN) to use to update the EventRule.

Parameter eventPattern : An additional event pattern used to further filter the events this EventRule receives.

For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.

Parameter regions : A list of Amazon Web Services Regions that sends events to this EventRule.

Implementation

Future<UpdateEventRuleResponse> updateEventRule({
  required String arn,
  String? eventPattern,
  List<String>? regions,
}) async {
  final $payload = <String, dynamic>{
    if (eventPattern != null) 'eventPattern': eventPattern,
    if (regions != null) 'regions': regions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/event-rules/${Uri.encodeComponent(arn)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateEventRuleResponse.fromJson(response);
}