createEventSubscription method
May throw EventSubscriptionQuotaExceededFault. May throw SubscriptionAlreadyExistFault. May throw SNSInvalidTopicFault. May throw SNSNoAuthorizationFault. May throw SNSTopicArnNotFoundFault. May throw SubscriptionCategoryNotFoundFault. May throw SourceNotFoundFault.
Implementation
Future<CreateEventSubscriptionResult> createEventSubscription({
required String snsTopicArn,
required String subscriptionName,
bool? enabled,
List<String>? eventCategories,
List<String>? sourceIds,
String? sourceType,
}) async {
ArgumentError.checkNotNull(snsTopicArn, 'snsTopicArn');
ArgumentError.checkNotNull(subscriptionName, 'subscriptionName');
final $request = <String, dynamic>{};
$request['SnsTopicArn'] = snsTopicArn;
$request['SubscriptionName'] = subscriptionName;
enabled?.also((arg) => $request['Enabled'] = arg);
eventCategories?.also((arg) => $request['EventCategories'] = arg);
sourceIds?.also((arg) => $request['SourceIds'] = arg);
sourceType?.also((arg) => $request['SourceType'] = arg);
final $result = await _protocol.send(
$request,
action: 'CreateEventSubscription',
version: '2013-02-12',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateEventSubscriptionMessage'],
shapes: shapes,
resultWrapper: 'CreateEventSubscriptionResult',
);
return CreateEventSubscriptionResult.fromXml($result);
}