Removes the specified directory as a publisher to the specified Amazon SNS topic.
Parameters:
-
directory_id
(DirectoryId)
–
The Directory ID to remove as a publisher. This directory will no longer send messages to the specified Amazon SNS topic.
-
topic_name
(TopicName)
–
The name of the Amazon SNS topic from which to remove the directory as a publisher.
Raises:
Examples:
To remove an event topic
The following example removes the specified directory as a publisher to the specified SNS topic.
>>> await client.deregister_event_topic(directory_id='d-92654abfed', topic_name='snstopicexample')
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
| async def deregister_event_topic(
self,
directory_id: "capo_directory_service.types.directory_id.DirectoryId",
topic_name: "capo_directory_service.types.topic_name.TopicName",
*,
config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.deregister_event_topic_result.DeregisterEventTopicResult":
"""<p>Removes the specified directory as a publisher to the specified Amazon SNS topic.</p>
Args:
directory_id: <p>The Directory ID to remove as a publisher. This directory will no longer send messages to the specified Amazon SNS topic.</p>
topic_name: <p>The name of the Amazon SNS topic from which to remove the directory as a publisher.</p>
Raises:
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To remove an event topic
The following example removes the specified directory as a publisher to the specified SNS topic.
>>> await client.deregister_event_topic(directory_id='d-92654abfed', topic_name='snstopicexample')
"""
async def _handler(
req: "AsyncOperationRequest[capo_directory_service.types.deregister_event_topic_request.DeregisterEventTopicRequest]",
) -> AsyncOperationResponse[
"capo_directory_service.types.deregister_event_topic_result.DeregisterEventTopicResult"
]:
import capo_directory_service._operations.directory_service_20150416.deregister_event_topic
(
output,
http_response,
) = await capo_directory_service._operations.directory_service_20150416.deregister_event_topic.async_deregister_event_topic(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeregisterEventTopic")
)
input_: capo_directory_service.types.deregister_event_topic_request.DeregisterEventTopicRequest = {
"directory_id": directory_id,
"topic_name": topic_name,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|