modifyEventSubscription method

Future<ModifyEventSubscriptionResult> modifyEventSubscription({
  1. required String subscriptionName,
  2. bool? enabled,
  3. List<String>? eventCategories,
  4. String? snsTopicArn,
  5. String? sourceType,
})

Modifies an existing event notification subscription. Note that you can't modify the source identifiers using this call; to change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription calls.

You can see a list of the event categories for a given SourceType by using the DescribeEventCategories action.

May throw EventSubscriptionQuotaExceededFault. May throw SubscriptionNotFoundFault. May throw SNSInvalidTopicFault. May throw SNSNoAuthorizationFault. May throw SNSTopicArnNotFoundFault. May throw SubscriptionCategoryNotFoundFault.

Parameter subscriptionName : The name of the event notification subscription.

Parameter enabled : A Boolean value; set to true to activate the subscription.

Parameter eventCategories : A list of event categories for a SourceType that you want to subscribe to. You can see a list of the categories for a given SourceType by using the DescribeEventCategories action.

Parameter snsTopicArn : The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

Parameter sourceType : The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all events are returned.

Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot

Implementation

Future<ModifyEventSubscriptionResult> modifyEventSubscription({
  required String subscriptionName,
  bool? enabled,
  List<String>? eventCategories,
  String? snsTopicArn,
  String? sourceType,
}) async {
  ArgumentError.checkNotNull(subscriptionName, 'subscriptionName');
  final $request = <String, dynamic>{};
  $request['SubscriptionName'] = subscriptionName;
  enabled?.also((arg) => $request['Enabled'] = arg);
  eventCategories?.also((arg) => $request['EventCategories'] = arg);
  snsTopicArn?.also((arg) => $request['SnsTopicArn'] = arg);
  sourceType?.also((arg) => $request['SourceType'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyEventSubscription',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyEventSubscriptionMessage'],
    shapes: shapes,
    resultWrapper: 'ModifyEventSubscriptionResult',
  );
  return ModifyEventSubscriptionResult.fromXml($result);
}