Skip to content

delete_label async

delete_label(
    name: identifier,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
) -> DeleteLabelResult

Deletes a label.

You cannot delete labels that are included in an event type in Amazon Fraud Detector.

You cannot delete a label assigned to an event ID. You must first delete the relevant event ID.

When you delete a label, Amazon Fraud Detector permanently deletes that label and the data is no longer stored in Amazon Fraud Detector.

Parameters:

  • name (identifier) –

    The name of the label to delete.

Raises:

Source code in docs_src/capo_frauddetector/_services/async_fraud_detector.py
async def delete_label(
    self,
    name: "capo_frauddetector.types.identifier.identifier",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
) -> "capo_frauddetector.types.delete_label_result.DeleteLabelResult":
    """<p>Deletes a label.</p> <p>You cannot delete labels that are included in an event type in Amazon Fraud Detector.</p> <p>You cannot delete a label assigned to an event ID. You must first delete the relevant event ID.</p> <p>When you delete a label, Amazon Fraud Detector permanently deletes that label and the data is no longer stored in Amazon Fraud Detector.</p>

    Args:
        name: <p>The name of the label to delete.</p>

    Raises:
        capo_frauddetector.errors.conflict_exception.ConflictException: <p>An exception indicating there was a conflict during a delete operation.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_frauddetector.types.delete_label_request.DeleteLabelRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.delete_label_result.DeleteLabelResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.delete_label

        (
            output,
            http_response,
        ) = await capo_frauddetector._operations.aws_hawks_nest_service_facade.delete_label.async_delete_label(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteLabel")
    )
    input_: capo_frauddetector.types.delete_label_request.DeleteLabelRequest = {
        "name": name
    }

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