modifyEventSubscription method

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

Modifies an existing DMS event notification subscription.

May throw AccessDeniedFault. May throw KMSAccessDeniedFault. May throw KMSDisabledFault. May throw KMSInvalidStateFault. May throw KMSNotFoundFault. May throw KMSThrottlingFault. May throw ResourceNotFoundFault. May throw ResourceQuotaExceededFault. May throw SNSInvalidTopicFault. May throw SNSNoAuthorizationFault.

Parameter subscriptionName : The name of the 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 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 {
  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);
}