Skip to content

unsubscribe_from_event

unsubscribe_from_event(
    resource_arn: Arn,
    event: InspectorEvent,
    topic_arn: Arn,
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
) -> None

Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

Parameters:

  • resource_arn (Arn) –

    The ARN of the assessment template that is used during the event for which you want to stop receiving SNS notifications.

  • event (InspectorEvent) –

    The event for which you want to stop receiving SNS notifications.

  • topic_arn (Arn) –

    The ARN of the SNS topic to which SNS notifications are sent.

Raises:

Examples:

Unsubscribe from event Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

>>> client.unsubscribe_from_event(resource_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0', event='ASSESSMENT_RUN_COMPLETED', topic_arn='arn:aws:sns:us-west-2:123456789012:exampletopic')
Source code in docs_src/capo_inspector/_services/inspector.py
def unsubscribe_from_event(
    self,
    resource_arn: "capo_inspector.types.arn.Arn",
    event: "capo_inspector.types.inspector_event.InspectorEvent",
    topic_arn: "capo_inspector.types.arn.Arn",
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
) -> None:
    """<p>Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.</p>

    Args:
        resource_arn: <p>The ARN of the assessment template that is used during the event for which you want to stop receiving SNS notifications.</p>
        event: <p>The event for which you want to stop receiving SNS notifications.</p>
        topic_arn: <p>The ARN of the SNS topic to which SNS notifications are sent.</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.service_temporarily_unavailable_exception.ServiceTemporarilyUnavailableException: <p>The serice is temporary unavailable.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Unsubscribe from event
        Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

        >>> client.unsubscribe_from_event(resource_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0', event='ASSESSMENT_RUN_COMPLETED', topic_arn='arn:aws:sns:us-west-2:123456789012:exampletopic')
    """

    def _handler(
        req: "OperationRequest[capo_inspector.types.unsubscribe_from_event_request.UnsubscribeFromEventRequest]",
    ) -> OperationResponse[None]:
        import capo_inspector._operations.inspector_service.unsubscribe_from_event

        output, http_response = (
            capo_inspector._operations.inspector_service.unsubscribe_from_event.unsubscribe_from_event(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UnsubscribeFromEvent")
    )
    input_: capo_inspector.types.unsubscribe_from_event_request.UnsubscribeFromEventRequest = {
        "resource_arn": resource_arn,
        "event": event,
        "topic_arn": topic_arn,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output