Skip to content

delete_detector_model async

delete_detector_model(
    detector_model_name: DetectorModelName,
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
) -> DeleteDetectorModelResponse

Deletes a detector model. Any active instances of the detector model are also deleted.

Parameters:

  • detector_model_name (DetectorModelName) –

    The name of the detector model to be deleted.

Raises:

Source code in docs_src/capo_iot_events/_services/async_io_t_events.py
async def delete_detector_model(
    self,
    detector_model_name: "capo_iot_events.types.detector_model_name.DetectorModelName",
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
) -> "capo_iot_events.types.delete_detector_model_response.DeleteDetectorModelResponse":
    """<p>Deletes a detector model. Any active instances of the detector model are also deleted.</p>

    Args:
        detector_model_name: <p>The name of the detector model to be deleted.</p>

    Raises:
        capo_iot_events.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_iot_events.errors.invalid_request_exception.InvalidRequestException: <p>The request was invalid.</p>
        capo_iot_events.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is in use.</p>
        capo_iot_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
        capo_iot_events.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_iot_events.errors.throttling_exception.ThrottlingException: <p>The request could not be completed due to throttling.</p>
        capo_iot_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_events.types.delete_detector_model_request.DeleteDetectorModelRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_events.types.delete_detector_model_response.DeleteDetectorModelResponse"
    ]:
        import capo_iot_events._operations.iot_columbo_service.delete_detector_model

        (
            output,
            http_response,
        ) = await capo_iot_events._operations.iot_columbo_service.delete_detector_model.async_delete_detector_model(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDetectorModel")
    )
    input_: capo_iot_events.types.delete_detector_model_request.DeleteDetectorModelRequest = {
        "detector_model_name": detector_model_name
    }

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