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