subscribeToEvent method
Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.
May throw AccessDeniedException.
May throw InternalException.
May throw InvalidInputException.
May throw LimitExceededException.
May throw NoSuchEntityException.
May throw ServiceTemporarilyUnavailableException.
Parameter event :
The event for which you want to receive SNS notifications.
Parameter resourceArn :
The ARN of the assessment template that is used during the event for which
you want to receive SNS notifications.
Parameter topicArn :
The ARN of the SNS topic to which the SNS notifications are sent.
Implementation
Future<void> subscribeToEvent({
required InspectorEvent event,
required String resourceArn,
required String topicArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'InspectorService.SubscribeToEvent'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'event': event.value,
'resourceArn': resourceArn,
'topicArn': topicArn,
},
);
}