async def sync_job_error(
        self,
        *,
        connector_sync_job_id: str,
        error: t.Optional[str] = None,
        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,
        body: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> ObjectApiResponse[t.Any]:
        """
        .. raw:: html

          <p>Set a connector sync job error.
          Set the <code>error</code> field for a connector sync job and set its <code>status</code> to <code>error</code>.</p>
          <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
          This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error>`_

        :param connector_sync_job_id: The unique identifier for the connector sync job.
        :param error: The error for the connector sync job error field.
        """
        if connector_sync_job_id in SKIP_IN_PATH:
            raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
        if error is None and body is None:
            raise ValueError("Empty value passed for parameter 'error'")
        __path_parts: t.Dict[str, str] = {
            "connector_sync_job_id": _quote(connector_sync_job_id)
        }
        __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_error'
        __query: t.Dict[str, t.Any] = {}
        __body: t.Dict[str, t.Any] = body if body is not None else {}
        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 not __body:
            if error is not None:
                __body["error"] = error
        __headers = {"accept": "application/json", "content-type": "application/json"}
        return await self.perform_request(  # type: ignore[return-value]
            "PUT",
            __path,
            params=__query,
            headers=__headers,
            body=__body,
            endpoint_id="connector.sync_job_error",
            path_parts=__path_parts,
        )

        .. raw:: html

          <p>Set a connector sync job error.
          Set the <code>error</code> field for a connector sync job and set its <code>status</code> to <code>error</code>.</p>
          <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
          This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error>`_

        :param connector_sync_job_id: The unique identifier for the connector sync job.
        :param error: The error for the connector sync job error field.
        
elasticsearch/_async/client/connector.py