Update and improve documentation for API.saved_searches
authorHarmon <Harmon758@gmail.com>
Fri, 9 Apr 2021 18:42:05 +0000 (13:42 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 9 Apr 2021 18:42:05 +0000 (13:42 -0500)
Automatically use docstring for documentation
Improve method and documentation order

docs/api.rst
tweepy/api.py

index caabb6c9d29d6daf7bea7c2beacc347a90168d29..43d930d85c996fdde7573f57d2b13d40d6f4a40b 100644 (file)
@@ -148,6 +148,8 @@ Manage account settings and profile
 
 .. automethod:: API.verify_credentials
 
+.. automethod:: API.saved_searches
+
 
 Direct Message Methods
 ----------------------
@@ -342,13 +344,6 @@ Spam Reporting Methods
 Saved Searches Methods
 ----------------------
 
-.. method:: API.saved_searches()
-
-   Returns the authenticated user's saved search queries.
-
-   :rtype: list of :class:`SavedSearch` objects
-
-
 .. method:: API.get_saved_search(id)
 
    Retrieve the data for a saved search owned by the authenticating user
index 0d0c38eb0877d8e20733176cc81fe3cc5462da34..1b02935ff2c4ae0614dcb83d5a488d21c718c00f 100644 (file)
@@ -1777,6 +1777,18 @@ class API:
             ), **kwargs
         )
 
+    @payload('saved_search', list=True)
+    def saved_searches(self, **kwargs):
+        """saved_searches()
+
+        Returns the authenticated user's saved search queries.
+
+        :rtype: list of :class:`SavedSearch` objects
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list
+        """
+        return self.request('GET', 'saved_searches/list', **kwargs)
+
     def media_upload(self, filename, *, file=None, chunked=False,
                      media_category=None, additional_owners=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview
@@ -2159,12 +2171,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('saved_search', list=True)
-    def saved_searches(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list
-        """
-        return self.request('GET', 'saved_searches/list', **kwargs)
-
     @payload('saved_search')
     def get_saved_search(self, id, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id