From: Harmon Date: Fri, 9 Apr 2021 18:42:05 +0000 (-0500) Subject: Update and improve documentation for API.saved_searches X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=71e07a4b22268675ce9f893063c99ed06055f885;p=tweepy.git Update and improve documentation for API.saved_searches Automatically use docstring for documentation Improve method and documentation order --- diff --git a/docs/api.rst b/docs/api.rst index caabb6c..43d930d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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 diff --git a/tweepy/api.py b/tweepy/api.py index 0d0c38e..1b02935 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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