Skip to content

unsubscribe async

unsubscribe(
    arn: NotificationRuleArn,
    target_address: TargetAddress,
    *,
    config_overrides: Optional[AsynccodestarnotificationsClientConfig] = None,
) -> UnsubscribeResult

Removes an association between a notification rule and an Amazon Q Developer in chat applications topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.

Parameters:

  • arn (NotificationRuleArn) –

    The Amazon Resource Name (ARN) of the notification rule.

  • target_address (TargetAddress) –

    The ARN of the Amazon Q Developer in chat applications topic to unsubscribe from the notification rule.

Raises:

Source code in docs_src/capo_codestar_notifications/_services/async_codestarnotifications.py
async def unsubscribe(
    self,
    arn: "capo_codestar_notifications.types.notification_rule_arn.NotificationRuleArn",
    target_address: "capo_codestar_notifications.types.target_address.TargetAddress",
    *,
    config_overrides: Optional[AsynccodestarnotificationsClientConfig] = None,
) -> "capo_codestar_notifications.types.unsubscribe_result.UnsubscribeResult":
    """<p>Removes an association between a notification rule and an Amazon Q Developer in chat applications topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the notification rule.</p>
        target_address: <p>The ARN of the Amazon Q Developer in chat applications topic to unsubscribe from the notification rule.</p>

    Raises:
        capo_codestar_notifications.errors.validation_exception.ValidationException: <p>One or more parameter values are not valid.</p>
        capo_codestar_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codestar_notifications.types.unsubscribe_request.UnsubscribeRequest]",
    ) -> AsyncOperationResponse[
        "capo_codestar_notifications.types.unsubscribe_result.UnsubscribeResult"
    ]:
        import capo_codestar_notifications._operations.code_star_notifications_20191015.unsubscribe

        (
            output,
            http_response,
        ) = await capo_codestar_notifications._operations.code_star_notifications_20191015.unsubscribe.async_unsubscribe(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_codestar_notifications.types.unsubscribe_request.UnsubscribeRequest",
    ) -> dict[str, Any]:
        import capo_codestar_notifications.types.unsubscribe_request

        return (
            capo_codestar_notifications.types.unsubscribe_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("Unsubscribe", redact_input=_redact_input),
    )
    input_: capo_codestar_notifications.types.unsubscribe_request.UnsubscribeRequest = {
        "arn": arn,
        "target_address": target_address,
    }

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