Skip to content

delete_target

delete_target(
    target_address: TargetAddress,
    *,
    config_overrides: Optional[codestarnotificationsClientConfig] = None,
    force_unsubscribe_all: Optional[ForceUnsubscribeAll] = None,
) -> DeleteTargetResult

Deletes a specified target for notifications.

Parameters:

  • target_address (TargetAddress) –

    The Amazon Resource Name (ARN) of the Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client to delete.

  • force_unsubscribe_all (Optional[ForceUnsubscribeAll], default: None ) –

    A Boolean value that can be used to delete all associations with this Amazon Q Developer in chat applications topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your Amazon Web Services account are deleted.

Raises:

Source code in docs_src/capo_codestar_notifications/_services/codestarnotifications.py
def delete_target(
    self,
    target_address: "capo_codestar_notifications.types.target_address.TargetAddress",
    *,
    config_overrides: Optional[codestarnotificationsClientConfig] = None,
    force_unsubscribe_all: Optional[
        "capo_codestar_notifications.types.force_unsubscribe_all.ForceUnsubscribeAll"
    ] = None,
) -> "capo_codestar_notifications.types.delete_target_result.DeleteTargetResult":
    """<p>Deletes a specified target for notifications.</p>

    Args:
        target_address: <p>The Amazon Resource Name (ARN) of the Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client to delete.</p>
        force_unsubscribe_all: <p>A Boolean value that can be used to delete all associations with this Amazon Q Developer in chat applications topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your Amazon Web Services account are deleted.</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.
    """

    def _handler(
        req: "OperationRequest[capo_codestar_notifications.types.delete_target_request.DeleteTargetRequest]",
    ) -> OperationResponse[
        "capo_codestar_notifications.types.delete_target_result.DeleteTargetResult"
    ]:
        import capo_codestar_notifications._operations.code_star_notifications_20191015.delete_target

        output, http_response = (
            capo_codestar_notifications._operations.code_star_notifications_20191015.delete_target.delete_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_codestar_notifications.types.delete_target_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DeleteTarget", redact_input=_redact_input),
    )
    input_: capo_codestar_notifications.types.delete_target_request.DeleteTargetRequest = {
        "target_address": target_address
    }
    if force_unsubscribe_all is not None:
        input_["force_unsubscribe_all"] = force_unsubscribe_all

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