modifyEventSubscription method
Modifies an existing AWS DMS event notification subscription.
May throw ResourceQuotaExceededFault. May throw ResourceNotFoundFault. May throw SNSInvalidTopicFault. May throw SNSNoAuthorizationFault. May throw KMSAccessDeniedFault. May throw KMSDisabledFault. May throw KMSInvalidStateFault. May throw KMSNotFoundFault. May throw KMSThrottlingFault.
Parameter subscriptionName
:
The name of the AWS DMS event notification subscription to be modified.
Parameter enabled
:
A Boolean value; set to true to activate the subscription.
Parameter eventCategories
:
A list of event categories for a source type that you want to subscribe
to. Use the DescribeEventCategories
action to see a list of
event categories.
Parameter snsTopicArn
:
The Amazon Resource Name (ARN) of the Amazon 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 AWS DMS resource that generates the events you want to
subscribe to.
Valid values: replication-instance | replication-task
Implementation
Future<ModifyEventSubscriptionResponse> modifyEventSubscription({
required String subscriptionName,
bool? enabled,
List<String>? eventCategories,
String? snsTopicArn,
String? sourceType,
}) async {
ArgumentError.checkNotNull(subscriptionName, 'subscriptionName');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonDMSv20160101.ModifyEventSubscription'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'SubscriptionName': subscriptionName,
if (enabled != null) 'Enabled': enabled,
if (eventCategories != null) 'EventCategories': eventCategories,
if (snsTopicArn != null) 'SnsTopicArn': snsTopicArn,
if (sourceType != null) 'SourceType': sourceType,
},
);
return ModifyEventSubscriptionResponse.fromJson(jsonResponse.body);
}