Update and improve documentation for API.verify_credentials
authorHarmon <Harmon758@gmail.com>
Fri, 9 Apr 2021 18:35:15 +0000 (13:35 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 9 Apr 2021 18:35:15 +0000 (13:35 -0500)
Automatically use docstring for documentation
Improve method and documentation order

docs/api.rst
tweepy/api.py

index 668d02ba4577cc65fc1f9da77f99867ec169f780..caabb6c9d29d6daf7bea7c2beacc347a90168d29 100644 (file)
@@ -146,6 +146,8 @@ Manage account settings and profile
 
 .. automethod:: API.get_settings
 
+.. automethod:: API.verify_credentials
+
 
 Direct Message Methods
 ----------------------
@@ -206,18 +208,6 @@ Direct Message Methods
 Account Methods
 ---------------
 
-.. method:: API.verify_credentials([include_entities], [skip_status], \
-                                   [include_email])
-
-   Verify the supplied user credentials are valid.
-
-   :param include_entities: |include_entities|
-   :param skip_status: |skip_status|
-   :param include_email: When set to true email will be returned in the user
-                         objects as a string.
-   :rtype: :class:`User` object if credentials are valid, otherwise False
-
-
 .. method:: API.rate_limit_status()
 
    Returns the current rate limits for methods belonging to the specified
index 474909e1419dc964f82adbe0844eacdf1a32bf5d..0d0c38eb0877d8e20733176cc81fe3cc5462da34 100644 (file)
@@ -1754,6 +1754,29 @@ class API:
             'GET', 'account/settings', use_cache=False, **kwargs
         )
 
+    @payload('user')
+    def verify_credentials(self, **kwargs):
+        """verify_credentials(*, include_entities, skip_status, include_email)
+
+        Verify the supplied user credentials are valid.
+
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+        :param include_email: When set to true email will be returned in the
+                              user objects as a string.
+
+        :rtype: :class:`User` object if credentials are valid, otherwise False
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials
+        """
+        if 'include_email' in kwargs:
+            kwargs['include_email'] = str(kwargs['include_email']).lower()
+        return self.request(
+            'GET', 'account/verify_credentials', endpoint_parameters=(
+                'include_entities', 'skip_status', 'include_email'
+            ), **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
@@ -1994,18 +2017,6 @@ class API:
             ), use_cache=False, **kwargs
         )
 
-    @payload('user')
-    def verify_credentials(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials
-        """
-        if 'include_email' in kwargs:
-            kwargs['include_email'] = str(kwargs['include_email']).lower()
-        return self.request(
-            'GET', 'account/verify_credentials', endpoint_parameters=(
-                'include_entities', 'skip_status', 'include_email'
-            ), **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