From f317d5e64833e7deefc5039b49e981b405f3d629 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 11 Apr 2021 15:33:33 -0500 Subject: [PATCH] Update and improve documentation for API.rate_limit_status Automatically use docstring for documentation Change API documentation header to match API reference index Add documentation for resources parameter --- docs/api.rst | 15 +++------------ tweepy/api.py | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index d64e87a..8a082ae 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -268,19 +268,10 @@ Get Twitter supported languages .. automethod:: API.supported_languages +Get app rate limit status +^^^^^^^^^^^^^^^^^^^^^^^^^ -Account Methods ---------------- - -.. method:: API.rate_limit_status() - - Returns the current rate limits for methods belonging to the specified - resource families. When using application-only auth, this method's response - indicates the application-only auth rate limiting context. - - :param resources: A comma-separated list of resource families you want to - know the current rate limit disposition for. - :rtype: :class:`JSON` object +.. automethod:: API.rate_limit_status Search Methods diff --git a/tweepy/api.py b/tweepy/api.py index 9f3146a..6682d42 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2807,9 +2807,22 @@ class API: """ return self.request('GET', 'help/languages', **kwargs) + # Get app rate limit status + @payload('json') def rate_limit_status(self, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status + """rate_limit_status(*, resources) + + Returns the current rate limits for methods belonging to the specified + resource families. When using application-only auth, this method's + response indicates the application-only auth rate limiting context. + + :param resources: A comma-separated list of resource families you want + to know the current rate limit disposition for. + + :rtype: :class:`JSON` object + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status """ return self.request( 'GET', 'application/rate_limit_status', endpoint_parameters=( -- 2.25.1