From: Harmon Date: Sat, 10 Apr 2021 14:37:46 +0000 (-0500) Subject: Update and improve documentation for API.destroy_saved_search X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5e5378f1e55d06c097db3f166e2cbef2b76a8a0d;p=tweepy.git Update and improve documentation for API.destroy_saved_search Automatically use docstring for documentation Improve method and documentation order Improve capitalization --- 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