Skip to content

list_event_subscriptions async

list_event_subscriptions(
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
    resource_arn: Optional[Arn] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[ListEventSubscriptionsMaxResults] = None,
) -> ListEventSubscriptionsResponse

Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see SubscribeToEvent and UnsubscribeFromEvent.

Parameters:

  • resource_arn (Optional[Arn], default: None ) –

    The ARN of the assessment template for which you want to list the existing event subscriptions.

  • next_token (Optional[PaginationToken], default: None ) –

    You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListEventSubscriptions action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • max_results (Optional[ListEventSubscriptionsMaxResults], default: None ) –

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Raises:

  • AccessDeniedException –

    You do not have required permissions to access the requested resource.

  • InternalException –

    Internal server error.

  • InvalidInputException –

    The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • NoSuchEntityException –

    The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_inspector/_services/async_inspector.py
async def list_event_subscriptions(
    self,
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
    resource_arn: Optional["capo_inspector.types.arn.Arn"] = None,
    next_token: Optional[
        "capo_inspector.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_inspector.types.list_event_subscriptions_max_results.ListEventSubscriptionsMaxResults"
    ] = None,
) -> "capo_inspector.types.list_event_subscriptions_response.ListEventSubscriptionsResponse":
    """<p>Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see <a>SubscribeToEvent</a> and <a>UnsubscribeFromEvent</a>.</p>

    Args:
        resource_arn: <p>The ARN of the assessment template for which you want to list the existing event subscriptions.</p>
        next_token: <p>You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the <b>ListEventSubscriptions</b> action. Subsequent calls to the action fill <b>nextToken</b> in the request with the value of <b>NextToken</b> from the previous response to continue listing data.</p>
        max_results: <p>You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_inspector.types.list_event_subscriptions_request.ListEventSubscriptionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_inspector.types.list_event_subscriptions_response.ListEventSubscriptionsResponse"
    ]:
        import capo_inspector._operations.inspector_service.list_event_subscriptions

        (
            output,
            http_response,
        ) = await capo_inspector._operations.inspector_service.list_event_subscriptions.async_list_event_subscriptions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEventSubscriptions")
    )
    input_: capo_inspector.types.list_event_subscriptions_request.ListEventSubscriptionsRequest = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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