modifyEventSubscription method
Modifies an existing Amazon Redshift event notification subscription.
May throw SubscriptionNotFoundFault. May throw SNSInvalidTopicFault. May throw SNSNoAuthorizationFault. May throw SNSTopicArnNotFoundFault. May throw SubscriptionEventIdNotFoundFault. May throw SubscriptionCategoryNotFoundFault. May throw SubscriptionSeverityNotFoundFault. May throw SourceNotFoundFault. May throw InvalidSubscriptionStateFault.
Parameter subscriptionName
:
The name of the modified Amazon Redshift event notification subscription.
Parameter enabled
:
A Boolean value indicating if the subscription is enabled.
true
indicates the subscription is enabled
Parameter eventCategories
:
Specifies the Amazon Redshift event categories to be published by the
event notification subscription.
Values: configuration, management, monitoring, security
Parameter severity
:
Specifies the Amazon Redshift event severity to be published by the event
notification subscription.
Values: ERROR, INFO
Parameter snsTopicArn
:
The Amazon Resource Name (ARN) of the SNS topic to be used by the event
notification subscription.
Parameter sourceIds
:
A list of one or more identifiers of Amazon Redshift source objects. All
of the objects must be of the same type as was specified in the source
type parameter. The event subscription will return only events generated
by the specified objects. If not specified, then events are returned for
all objects within the source type specified.
Example: my-cluster-1, my-cluster-2
Example: my-snapshot-20131010
Parameter sourceType
:
The type of source that will be generating the events. For example, if you
want to be notified of events generated by a cluster, you would set this
parameter to cluster. If this value is not specified, events are returned
for all Amazon Redshift objects in your AWS account. You must specify a
source type in order to specify source IDs.
Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.
Implementation
Future<ModifyEventSubscriptionResult> modifyEventSubscription({
required String subscriptionName,
bool? enabled,
List<String>? eventCategories,
String? severity,
String? snsTopicArn,
List<String>? sourceIds,
String? sourceType,
}) async {
ArgumentError.checkNotNull(subscriptionName, 'subscriptionName');
_s.validateStringLength(
'subscriptionName',
subscriptionName,
0,
2147483647,
isRequired: true,
);
_s.validateStringLength(
'severity',
severity,
0,
2147483647,
);
_s.validateStringLength(
'snsTopicArn',
snsTopicArn,
0,
2147483647,
);
_s.validateStringLength(
'sourceType',
sourceType,
0,
2147483647,
);
final $request = <String, dynamic>{};
$request['SubscriptionName'] = subscriptionName;
enabled?.also((arg) => $request['Enabled'] = arg);
eventCategories?.also((arg) => $request['EventCategories'] = arg);
severity?.also((arg) => $request['Severity'] = arg);
snsTopicArn?.also((arg) => $request['SnsTopicArn'] = arg);
sourceIds?.also((arg) => $request['SourceIds'] = arg);
sourceType?.also((arg) => $request['SourceType'] = arg);
final $result = await _protocol.send(
$request,
action: 'ModifyEventSubscription',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ModifyEventSubscriptionMessage'],
shapes: shapes,
resultWrapper: 'ModifyEventSubscriptionResult',
);
return ModifyEventSubscriptionResult.fromXml($result);
}