Skip to content

delete_notification_rule async

delete_notification_rule(
    arn: NotificationRuleArn,
    *,
    config_overrides: Optional[AsynccodestarnotificationsClientConfig] = None,
) -> DeleteNotificationRuleResult

Deletes a notification rule for a resource.

Parameters:

  • arn (NotificationRuleArn) –

    The Amazon Resource Name (ARN) of the notification rule you want to delete.

Raises:

  • ConcurrentModificationException –

    CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.

  • LimitExceededException –

    One of the CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.

  • ValidationException –

    One or more parameter values are not valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_codestar_notifications/_services/async_codestarnotifications.py
async def delete_notification_rule(
    self,
    arn: "capo_codestar_notifications.types.notification_rule_arn.NotificationRuleArn",
    *,
    config_overrides: Optional[AsynccodestarnotificationsClientConfig] = None,
) -> "capo_codestar_notifications.types.delete_notification_rule_result.DeleteNotificationRuleResult":
    """<p>Deletes a notification rule for a resource.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the notification rule you want to delete.</p>

    Raises:
        capo_codestar_notifications.errors.concurrent_modification_exception.ConcurrentModificationException: <p>CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.</p>
        capo_codestar_notifications.errors.limit_exceeded_exception.LimitExceededException: <p>One of the CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.</p>
        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.delete_notification_rule_request.DeleteNotificationRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_codestar_notifications.types.delete_notification_rule_result.DeleteNotificationRuleResult"
    ]:
        import capo_codestar_notifications._operations.code_star_notifications_20191015.delete_notification_rule

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteNotificationRule")
    )
    input_: capo_codestar_notifications.types.delete_notification_rule_request.DeleteNotificationRuleRequest = {
        "arn": arn
    }

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