def direct_message_search(
        self, query: str
    ) -> List[Tuple[DirectMessage, DirectShortThread]]:
        """
        Search query mentions in direct messages

        Parameters
        ----------
        query: str
            Text query

        Returns
        -------
        List[Tuple[DirectMessage, DirectThread]]
            List of Tuples with DirectMessage (matched query) and its DirectThread
        """
        params = {
            "offsets": '{"message_content":"0","reshared_content":""}',
            "query": query,
            "result_types": '["message_content","reshared_content"]',
        }
        result = self.private_request(
            "direct_v2/search_secondary/",
            params=params,
        )
        assert result.get("status", "") == "ok"
        search_results = result.get("message_search_results", {})

        data = []
        for item in search_results.get("message_search_result_items", []):
            message = item.get("matched_message_info", {})
            thread = item.get("thread", {})
            data.append(
                (
                    extract_direct_message(message.get("item_info", {})),
                    extract_direct_short_thread(thread),
                )
            )
        return data

        Search query mentions in direct messages

        Parameters
        ----------
        query: str
            Text query

        Returns
        -------
        List[Tuple[DirectMessage, DirectThread]]
            List of Tuples with DirectMessage (matched query) and its DirectThread
        
instagrapi/mixins/direct.py