def update_user_profile_data(
        self,
        *,
        uid: str,
        data: t.Optional[t.Mapping[str, t.Any]] = None,
        error_trace: t.Optional[bool] = None,
        filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
        human: t.Optional[bool] = None,
        if_primary_term: t.Optional[int] = None,
        if_seq_no: t.Optional[int] = None,
        labels: t.Optional[t.Mapping[str, t.Any]] = None,
        pretty: t.Optional[bool] = None,
        refresh: t.Optional[
            t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
        ] = None,
        body: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> ObjectApiResponse[t.Any]:
        """
        .. raw:: html

          <p>Update user profile data.</p>
          <p>Update specific data for the user profile that is associated with a unique ID.</p>
          <p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
          Individual users and external applications should not call this API directly.
          Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
          <p>To use this API, you must have one of the following privileges:</p>
          <ul>
          <li>The <code>manage_user_profile</code> cluster privilege.</li>
          <li>The <code>update_profile_data</code> global privilege for the namespaces that are referenced in the request.</li>
          </ul>
          <p>This API updates the <code>labels</code> and <code>data</code> fields of an existing user profile document with JSON objects.
          New keys and their values are added to the profile document and conflicting keys are replaced by data that's included in the request.</p>
          <p>For both labels and data, content is namespaced by the top-level fields.
          The <code>update_profile_data</code> global privilege grants privileges for updating only the allowed namespaces.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-user-profile-data>`_

        :param uid: A unique identifier for the user profile.
        :param data: Non-searchable data that you want to associate with the user profile.
            This field supports a nested data structure. Within the `data` object, top-level
            keys cannot begin with an underscore (`_`) or contain a period (`.`). The
            data object is not searchable, but can be retrieved with the get user profile
            API.
        :param if_primary_term: Only perform the operation if the document has this primary
            term.
        :param if_seq_no: Only perform the operation if the document has this sequence
            number.
        :param labels: Searchable data that you want to associate with the user profile.
            This field supports a nested data structure. Within the labels object, top-level
            keys cannot begin with an underscore (`_`) or contain a period (`.`).
        :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
            this operation visible to search. If 'wait_for', it waits for a refresh to
            make this operation visible to search. If 'false', nothing is done with refreshes.
        """
        if uid in SKIP_IN_PATH:
            raise ValueError("Empty value passed for parameter 'uid'")
        __path_parts: t.Dict[str, str] = {"uid": _quote(uid)}
        __path = f'/_security/profile/{__path_parts["uid"]}/_data'
        __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 if_primary_term is not None:
            __query["if_primary_term"] = if_primary_term
        if if_seq_no is not None:
            __query["if_seq_no"] = if_seq_no
        if pretty is not None:
            __query["pretty"] = pretty
        if refresh is not None:
            __query["refresh"] = refresh
        if not __body:
            if data is not None:
                __body["data"] = data
            if labels is not None:
                __body["labels"] = labels
        __headers = {"accept": "application/json", "content-type": "application/json"}
        return self.perform_request(  # type: ignore[return-value]
            "PUT",
            __path,
            params=__query,
            headers=__headers,
            body=__body,
            endpoint_id="security.update_user_profile_data",
            path_parts=__path_parts,
        )

        .. raw:: html

          <p>Update user profile data.</p>
          <p>Update specific data for the user profile that is associated with a unique ID.</p>
          <p>NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
          Individual users and external applications should not call this API directly.
          Elastic reserves the right to change or remove this feature in future releases without prior notice.</p>
          <p>To use this API, you must have one of the following privileges:</p>
          <ul>
          <li>The <code>manage_user_profile</code> cluster privilege.</li>
          <li>The <code>update_profile_data</code> global privilege for the namespaces that are referenced in the request.</li>
          </ul>
          <p>This API updates the <code>labels</code> and <code>data</code> fields of an existing user profile document with JSON objects.
          New keys and their values are added to the profile document and conflicting keys are replaced by data that's included in the request.</p>
          <p>For both labels and data, content is namespaced by the top-level fields.
          The <code>update_profile_data</code> global privilege grants privileges for updating only the allowed namespaces.</p>


        `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-user-profile-data>`_

        :param uid: A unique identifier for the user profile.
        :param data: Non-searchable data that you want to associate with the user profile.
            This field supports a nested data structure. Within the `data` object, top-level
            keys cannot begin with an underscore (`_`) or contain a period (`.`). The
            data object is not searchable, but can be retrieved with the get user profile
            API.
        :param if_primary_term: Only perform the operation if the document has this primary
            term.
        :param if_seq_no: Only perform the operation if the document has this sequence
            number.
        :param labels: Searchable data that you want to associate with the user profile.
            This field supports a nested data structure. Within the labels object, top-level
            keys cannot begin with an underscore (`_`) or contain a period (`.`).
        :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
            this operation visible to search. If 'wait_for', it waits for a refresh to
            make this operation visible to search. If 'false', nothing is done with refreshes.
        
elasticsearch/_sync/client/security.py