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

docs/api.rst
tweepy/api.py

index 43d930d85c996fdde7573f57d2b13d40d6f4a40b..495333e7ba10d229649fe7a84f2d14818e27ddd7 100644 (file)
@@ -150,6 +150,8 @@ Manage account settings and profile
 
 .. automethod:: API.saved_searches
 
+.. automethod:: API.get_saved_search
+
 
 Direct Message Methods
 ----------------------
@@ -344,15 +346,6 @@ Spam Reporting Methods
 Saved Searches Methods
 ----------------------
 
-.. method:: API.get_saved_search(id)
-
-   Retrieve the data for a saved search owned by the authenticating user
-   specified by the given id.
-
-   :param id: The id of the saved search to be retrieved.
-   :rtype: :class:`SavedSearch` object
-
-
 .. method:: API.create_saved_search(query)
 
    Creates a saved search for the authenticated user.
index 1b02935ff2c4ae0614dcb83d5a488d21c718c00f..936d54999562fff379904e816e516d39d920a14f 100644 (file)
@@ -1789,6 +1789,21 @@ class API:
         """
         return self.request('GET', 'saved_searches/list', **kwargs)
 
+    @payload('saved_search')
+    def get_saved_search(self, id, **kwargs):
+        """get_saved_search(id)
+
+        Retrieve the data for a saved search owned by the authenticating user
+        specified by the given ID.
+
+        :param id: The ID of the saved search to be retrieved.
+
+        :rtype: :class:`SavedSearch` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id
+        """
+        return self.request('GET', f'saved_searches/show/{id}', **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
@@ -2171,12 +2186,6 @@ class API:
             ), **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
-        """
-        return self.request('GET', f'saved_searches/show/{id}', **kwargs)
-
     @payload('saved_search')
     def create_saved_search(self, query, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-create