Skip to content

stop_events_detection_job async

stop_events_detection_job(
    job_id: JobId, *, config_overrides: Optional[AsyncComprehendClientConfig] = None
) -> StopEventsDetectionJobResponse

Stops an events detection job in progress.

Parameters:

  • job_id (JobId) –

    The identifier of the events detection job to stop.

Raises:

Source code in docs_src/capo_comprehend/_services/async_comprehend.py
async def stop_events_detection_job(
    self,
    job_id: "capo_comprehend.types.job_id.JobId",
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> "capo_comprehend.types.stop_events_detection_job_response.StopEventsDetectionJobResponse":
    """<p>Stops an events detection job in progress.</p>

    Args:
        job_id: <p>The identifier of the events detection job to stop.</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.job_not_found_exception.JobNotFoundException: <p>The specified job was not found. Check the job ID and try again.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_comprehend.types.stop_events_detection_job_request.StopEventsDetectionJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_comprehend.types.stop_events_detection_job_response.StopEventsDetectionJobResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.stop_events_detection_job

        (
            output,
            http_response,
        ) = await capo_comprehend._operations.comprehend_20171127.stop_events_detection_job.async_stop_events_detection_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopEventsDetectionJob")
    )
    input_: capo_comprehend.types.stop_events_detection_job_request.StopEventsDetectionJobRequest = {
        "job_id": job_id
    }

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