createConfigurationSetEventDestination method

Future<void> createConfigurationSetEventDestination({
  1. required String configurationSetName,
  2. required EventDestinationDefinition eventDestination,
  3. required String eventDestinationName,
})

Create an event destination. In Amazon Pinpoint, events include message sends, deliveries, opens, clicks, bounces, and complaints. Event destinations are places that you can send information about these events to. For example, you can send event data to Amazon SNS to receive notifications when you receive bounces or complaints, or you can use Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.

A single configuration set can include more than one event destination.

May throw NotFoundException. May throw AlreadyExistsException. May throw LimitExceededException. May throw TooManyRequestsException. May throw BadRequestException.

Parameter configurationSetName : The name of the configuration set that you want to add an event destination to.

Parameter eventDestination : An object that defines the event destination.

Parameter eventDestinationName : A name that identifies the event destination within the configuration set.

Implementation

Future<void> createConfigurationSetEventDestination({
  required String configurationSetName,
  required EventDestinationDefinition eventDestination,
  required String eventDestinationName,
}) async {
  ArgumentError.checkNotNull(configurationSetName, 'configurationSetName');
  ArgumentError.checkNotNull(eventDestination, 'eventDestination');
  ArgumentError.checkNotNull(eventDestinationName, 'eventDestinationName');
  final $payload = <String, dynamic>{
    'EventDestination': eventDestination,
    'EventDestinationName': eventDestinationName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v1/email/configuration-sets/${Uri.encodeComponent(configurationSetName)}/event-destinations',
    exceptionFnMap: _exceptionFns,
  );
}