From 6ce4d909ff8db19bf1373fbff3e3eec88030d92f Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 9 Apr 2021 13:45:07 -0500 Subject: [PATCH] Update and improve documentation for API.get_saved_search Automatically use docstring for documentation Improve method and documentation order Improve capitalization --- docs/api.rst | 11 ++--------- tweepy/api.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 43d930d..495333e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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. diff --git a/tweepy/api.py b/tweepy/api.py index 1b02935..936d549 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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 -- 2.25.1