From: Harmon Date: Sun, 11 Apr 2021 20:29:02 +0000 (-0500) Subject: Document API.supported_languages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9bb8446837562424093d4c65b6c389d2f1228c62;p=tweepy.git Document API.supported_languages Automatically use docstring for documentation Improve method order Add API documentation header to match API reference index --- diff --git a/docs/api.rst b/docs/api.rst index 7aa78ad..d64e87a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -263,6 +263,11 @@ Get Twitter configuration details .. automethod:: API.configuration +Get Twitter supported languages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automethod:: API.supported_languages + Account Methods --------------- diff --git a/tweepy/api.py b/tweepy/api.py index 607cffd..9f3146a 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2788,6 +2788,25 @@ class API: """ return self.request('GET', 'help/configuration', **kwargs) + # Get Twitter supported languages + + @payload('json') + def supported_languages(self, **kwargs): + """supported_languages() + + Returns the list of languages supported by Twitter along with the + language code supported by Twitter. + + The language code may be formatted as ISO 639-1 alpha-2 (``en``), ISO + 639-3 alpha-3 (``msa``), or ISO 639-1 alpha-2 combined with an ISO + 3166-1 alpha-2 localization (``zh-tw``). + + :rtype: :class:`JSON` object + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages + """ + return self.request('GET', 'help/languages', **kwargs) + @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 @@ -2819,9 +2838,3 @@ class API: 'query', 'tag', 'fromDate', 'toDate', 'maxResults', 'next' ), query=query, **kwargs ) - - @payload('json') - def supported_languages(self, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages - """ - return self.request('GET', 'help/languages', **kwargs)