registerEventTopic method

Future<void> registerEventTopic({
  1. required String directoryId,
  2. required String topicName,
})

Associates a directory with an SNS topic. This establishes the directory as a publisher to the specified SNS topic. You can then receive email or text (SMS) messages when the status of your directory changes. You get notified if your directory goes from an Active status to an Impaired or Inoperable status. You also receive a notification when the directory returns to an Active status.

May throw EntityDoesNotExistException. May throw InvalidParameterException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The Directory ID that will publish status messages to the SNS topic.

Parameter topicName : The SNS topic name to which the directory will publish status messages. This SNS topic must be in the same region as the specified Directory ID.

Implementation

Future<void> registerEventTopic({
  required String directoryId,
  required String topicName,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  ArgumentError.checkNotNull(topicName, 'topicName');
  _s.validateStringLength(
    'topicName',
    topicName,
    1,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.RegisterEventTopic'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      'TopicName': topicName,
    },
  );
}