From 5e5378f1e55d06c097db3f166e2cbef2b76a8a0d Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 10 Apr 2021 09:37:46 -0500 Subject: [PATCH] Update and improve documentation for API.destroy_saved_search Automatically use docstring for documentation Improve method and documentation order Improve capitalization --- docs/api.rst | 14 ++------------ tweepy/api.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index b6b13a5..92dfd55 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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 -------------- diff --git a/tweepy/api.py b/tweepy/api.py index 31df496..9b4228b 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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 -- 2.25.1