Update and improve documentation for API.friends_ids
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 17:23:08 +0000 (12:23 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 17:23:08 +0000 (12:23 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add stringify_ids and count parameters to documentation
Remove id parameter from documentation
Improve parameter order in documentation
Improve return type reference

docs/api.rst
tweepy/api.py

index 5197a1898aa2e146bf9caf3512d2303d7e6321de..9ff1448a5dab3439c02e393d68b208d7e8f04f7b 100644 (file)
@@ -115,6 +115,8 @@ Follow, search, and get users
 
 .. automethod:: API.followers
 
+.. automethod:: API.friends_ids
+
 
 User methods
 ------------
@@ -299,18 +301,6 @@ Friendship Methods
    :rtype: :class:`Relationship` object
 
 
-.. method:: API.friends_ids(id/screen_name/user_id, [cursor])
-
-   Returns an array containing the IDs of users being followed by the specified
-   user.
-
-   :param id: |uid|
-   :param screen_name: |screen_name|
-   :param user_id: |user_id|
-   :param cursor: |cursor|
-   :rtype: list of Integers
-
-
 Account Methods
 ---------------
 
index 6b29132123f5c9620ab6fd5a0f24394d30d252b2..5cb041328a5e3d86ff25fdcda12a335510d0b1a8 100644 (file)
@@ -1434,6 +1434,30 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('ids')
+    def friends_ids(self, **kwargs):
+        """friends_ids(*, user_id, screen_name, cursor, stringify_ids, count)
+
+        Returns an array containing the IDs of users being followed by the
+        specified user.
+
+        :param user_id: |user_id|
+        :param screen_name: |screen_name|
+        :param cursor: |cursor|
+        :param stringify_ids: Have IDs returned as strings instead
+        :param count: |count|
+
+        :rtype: list of :class:`int`
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids
+        """
+        return self.request(
+            'GET', 'friends/ids', endpoint_parameters=(
+                'user_id', 'screen_name', 'cursor', 'stringify_ids', 'count'
+            ), **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
@@ -1741,17 +1765,6 @@ class API:
             user_id=list_to_csv(user_id), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('ids')
-    def friends_ids(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids
-        """
-        return self.request(
-            'GET', 'friends/ids', endpoint_parameters=(
-                'user_id', 'screen_name', 'cursor', 'stringify_ids', 'count'
-            ), **kwargs
-        )
-
     @pagination(mode='cursor')
     @payload('user', list=True)
     def friends(self, **kwargs):