updateEventDestination method
Updates an existing event destination in a configuration set. You can update the IAM role ARN for CloudWatch Logs and Firehose. You can also enable or disable the event destination.
You may want to update an event destination to change its matching event types or updating the destination resource ARN. You can't change an event destination's type between CloudWatch Logs, Firehose, and Amazon SNS.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter configurationSetName :
The configuration set to update with the new event destination. Valid
values for this can be the ConfigurationSetName or ConfigurationSetArn.
Parameter eventDestinationName :
The name to use for the event destination.
Parameter cloudWatchLogsDestination :
An object that contains information about an event destination that sends
data to CloudWatch Logs.
Parameter enabled :
When set to true logging is enabled.
Parameter kinesisFirehoseDestination :
An object that contains information about an event destination for logging
to Firehose.
Parameter matchingEventTypes :
An array of event types that determine which events to log.
Parameter snsDestination :
An object that contains information about an event destination that sends
data to Amazon SNS.
Implementation
Future<UpdateEventDestinationResult> updateEventDestination({
required String configurationSetName,
required String eventDestinationName,
CloudWatchLogsDestination? cloudWatchLogsDestination,
bool? enabled,
KinesisFirehoseDestination? kinesisFirehoseDestination,
List<EventType>? matchingEventTypes,
SnsDestination? snsDestination,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PinpointSMSVoiceV2.UpdateEventDestination'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConfigurationSetName': configurationSetName,
'EventDestinationName': eventDestinationName,
if (cloudWatchLogsDestination != null)
'CloudWatchLogsDestination': cloudWatchLogsDestination,
if (enabled != null) 'Enabled': enabled,
if (kinesisFirehoseDestination != null)
'KinesisFirehoseDestination': kinesisFirehoseDestination,
if (matchingEventTypes != null)
'MatchingEventTypes': matchingEventTypes.map((e) => e.value).toList(),
if (snsDestination != null) 'SnsDestination': snsDestination,
},
);
return UpdateEventDestinationResult.fromJson(jsonResponse.body);
}