createEventSubscription method

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

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);
}