Skip to content

describe_event_topics async

describe_event_topics(
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    directory_id: Optional[DirectoryId] = None,
    topic_names: Optional[TopicNames] = None,
) -> DescribeEventTopicsResult

Obtains information about which Amazon SNS topics receive status messages from the specified directory.

If no input parameters are provided, such as DirectoryId or TopicName, this request describes all of the associations in the account.

Parameters:

  • directory_id (Optional[DirectoryId], default: None ) –

    The Directory ID for which to get the list of associated Amazon SNS topics. If this member is null, associations for all Directory IDs are returned.

  • topic_names (Optional[TopicNames], default: None ) –

    A list of Amazon SNS topic names for which to obtain the information. If this member is null, all associations for the specified Directory ID are returned.

    An empty list results in an InvalidParameterException being thrown.

Raises:

Examples:

To describe event topics The following example obtains information about which SNS topics receive status messages from the specified directory.

>>> await client.describe_event_topics(directory_id='d-92654abfed', topic_names=['snstopicexample'])
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
async def describe_event_topics(
    self,
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    directory_id: Optional[
        "capo_directory_service.types.directory_id.DirectoryId"
    ] = None,
    topic_names: Optional[
        "capo_directory_service.types.topic_names.TopicNames"
    ] = None,
) -> "capo_directory_service.types.describe_event_topics_result.DescribeEventTopicsResult":
    """<p>Obtains information about which Amazon SNS topics receive status messages from the specified directory.</p> <p>If no input parameters are provided, such as DirectoryId or TopicName, this request describes all of the associations in the account.</p>

    Args:
        directory_id: <p>The Directory ID for which to get the list of associated Amazon SNS topics. If this member is null, associations for all Directory IDs are returned.</p>
        topic_names: <p>A list of Amazon SNS topic names for which to obtain the information. If this member is null, all associations for the specified Directory ID are returned.</p> <p>An empty list results in an <code>InvalidParameterException</code> being thrown.</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 describe event topics
        The following example obtains information about which SNS topics receive status messages from the specified directory.

        >>> await client.describe_event_topics(directory_id='d-92654abfed', topic_names=['snstopicexample'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_directory_service.types.describe_event_topics_request.DescribeEventTopicsRequest]",
    ) -> AsyncOperationResponse[
        "capo_directory_service.types.describe_event_topics_result.DescribeEventTopicsResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.describe_event_topics

        (
            output,
            http_response,
        ) = await capo_directory_service._operations.directory_service_20150416.describe_event_topics.async_describe_event_topics(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeEventTopics")
    )
    input_: capo_directory_service.types.describe_event_topics_request.DescribeEventTopicsRequest = {}
    if directory_id is not None:
        input_["directory_id"] = directory_id
    if topic_names is not None:
        input_["topic_names"] = topic_names

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output