def get(
        self,
        *,
        task_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>Get task information.
          Get information about a task currently running in the cluster.</p>
          <p>WARNING: The task management API is new and should still be considered a beta feature.
          The API may change in ways that are not backwards compatible.</p>
          <p>If the task identifier is not found, a 404 response code indicates that there are no resources that match the request.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks>`_

        :param task_id: The task identifier.
        :param timeout: The period to wait for a response. If no response is received
            before the timeout expires, the request fails and returns an error.
        :param wait_for_completion: If `true`, the request blocks until the task has
            completed.
        """
        if task_id in SKIP_IN_PATH:
            raise ValueError("Empty value passed for parameter 'task_id'")
        __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
        __path = f'/_tasks/{__path_parts["task_id"]}'
        __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 self.perform_request(  # type: ignore[return-value]
            "GET",
            __path,
            params=__query,
            headers=__headers,
            endpoint_id="tasks.get",
            path_parts=__path_parts,
        )

        .. raw:: html

          <p>Get task information.
          Get information about a task currently running in the cluster.</p>
          <p>WARNING: The task management API is new and should still be considered a beta feature.
          The API may change in ways that are not backwards compatible.</p>
          <p>If the task identifier is not found, a 404 response code indicates that there are no resources that match the request.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks>`_

        :param task_id: The task identifier.
        :param timeout: The period to wait for a response. If no response is received
            before the timeout expires, the request fails and returns an error.
        :param wait_for_completion: If `true`, the request blocks until the task has
            completed.
        
elasticsearch/_sync/client/tasks.py