async def stop_job(
        self,
        *,
        id: str,
        error_trace: t.Optional[bool] = None,
        filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
        human: t.Optional[bool] = None,
        pretty: t.Optional[bool] = None,
        timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
        wait_for_completion: t.Optional[bool] = None,
    ) -> ObjectApiResponse[t.Any]:
        """
        .. raw:: html

          <p>Stop rollup jobs.
          If you try to stop a job that does not exist, an exception occurs.
          If you try to stop a job that is already stopped, nothing happens.</p>
          <p>Since only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped.
          This is accomplished with the <code>wait_for_completion</code> query parameter, and optionally a timeout. For example:</p>
          <pre><code>POST _rollup/job/sensor/_stop?wait_for_completion=true&amp;timeout=10s
          </code></pre>
          <p>The parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed.
          If the specified time elapses without the job moving to STOPPED, a timeout exception occurs.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-stop-job>`_

        :param id: Identifier for the rollup job.
        :param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum)
            the specified duration while waiting for the job to stop. If more than `timeout`
            time has passed, the API throws a timeout exception. NOTE: Even if a timeout
            occurs, the stop request is still processing and eventually moves the job
            to STOPPED. The timeout simply means the API call itself timed out while
            waiting for the status change.
        :param wait_for_completion: If set to `true`, causes the API to block until the
            indexer state completely stops. If set to `false`, the API returns immediately
            and the indexer is stopped asynchronously in the background.
        """
        if id in SKIP_IN_PATH:
            raise ValueError("Empty value passed for parameter 'id'")
        __path_parts: t.Dict[str, str] = {"id": _quote(id)}
        __path = f'/_rollup/job/{__path_parts["id"]}/_stop'
        __query: t.Dict[str, t.Any] = {}
        if error_trace is not None:
            __query["error_trace"] = error_trace
        if filter_path is not None:
            __query["filter_path"] = filter_path
        if human is not None:
            __query["human"] = human
        if pretty is not None:
            __query["pretty"] = pretty
        if timeout is not None:
            __query["timeout"] = timeout
        if wait_for_completion is not None:
            __query["wait_for_completion"] = wait_for_completion
        __headers = {"accept": "application/json"}
        return await self.perform_request(  # type: ignore[return-value]
            "POST",
            __path,
            params=__query,
            headers=__headers,
            endpoint_id="rollup.stop_job",
            path_parts=__path_parts,
        )

        .. raw:: html

          <p>Stop rollup jobs.
          If you try to stop a job that does not exist, an exception occurs.
          If you try to stop a job that is already stopped, nothing happens.</p>
          <p>Since only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped.
          This is accomplished with the <code>wait_for_completion</code> query parameter, and optionally a timeout. For example:</p>
          <pre><code>POST _rollup/job/sensor/_stop?wait_for_completion=true&amp;timeout=10s
          </code></pre>
          <p>The parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed.
          If the specified time elapses without the job moving to STOPPED, a timeout exception occurs.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-stop-job>`_

        :param id: Identifier for the rollup job.
        :param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum)
            the specified duration while waiting for the job to stop. If more than `timeout`
            time has passed, the API throws a timeout exception. NOTE: Even if a timeout
            occurs, the stop request is still processing and eventually moves the job
            to STOPPED. The timeout simply means the API call itself timed out while
            waiting for the status change.
        :param wait_for_completion: If set to `true`, causes the API to block until the
            indexer state completely stops. If set to `false`, the API returns immediately
            and the indexer is stopped asynchronously in the background.
        
elasticsearch/_async/client/rollup.py