Update and improve documentation for API.destroy_saved_search
authorHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 14:37:46 +0000 (09:37 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 14:37:46 +0000 (09:37 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Improve capitalization

docs/api.rst
tweepy/api.py

index b6b13a58036e58946a8a92b131a17048c653e46c..92dfd55a9ded2612d436f4f11045b3356665b6e1 100644 (file)
@@ -166,6 +166,8 @@ Manage account settings and profile
 
 .. automethod:: API.create_saved_search
 
+.. automethod:: API.destroy_saved_search
+
 
 Direct Message Methods
 ----------------------
@@ -335,18 +337,6 @@ Spam Reporting Methods
    :rtype: :class:`User` object
 
 
-Saved Searches Methods
-----------------------
-
-.. method:: API.destroy_saved_search(id)
-
-   Destroys a saved search for the authenticated user. The search specified by
-   id must be owned by the authenticating user.
-
-   :param id: The id of the saved search to be deleted.
-   :rtype: :class:`SavedSearch` object
-
-
 Search Methods
 --------------
 
index 31df496454b8a0c71d038f059c9d03dbb7650a07..9b4228b35ef86d3e80d92165b63fc9b4eb3b4fdd 100644 (file)
@@ -1990,6 +1990,21 @@ class API:
             ), query=query, **kwargs
         )
 
+    @payload('saved_search')
+    def destroy_saved_search(self, id, **kwargs):
+        """destroy_saved_search(id)
+
+        Destroys a saved search for the authenticated user. The search
+        specified by ID must be owned by the authenticating user.
+
+        :param id: The ID of the saved search to be deleted.
+
+        :rtype: :class:`SavedSearch` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-destroy-id
+        """
+        return self.request('POST', f'saved_searches/destroy/{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
@@ -2323,12 +2338,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('saved_search')
-    def destroy_saved_search(self, id, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-destroy-id
-        """
-        return self.request('POST', f'saved_searches/destroy/{id}', **kwargs)
-
     @payload('json')
     def trends_available(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available