Add documentation for API.friendships_incoming
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 17:33:42 +0000 (12:33 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 17:33:42 +0000 (12:33 -0500)
Improve method order

docs/api.rst
tweepy/api.py

index ca8870ef27f9db7403bd1e772dc9dc936b2be9ba..fa3f39c35062459313d0f5e78f640e19b8fe3071 100644 (file)
@@ -119,6 +119,8 @@ Follow, search, and get users
 
 .. automethod:: API.friends
 
+.. automethod:: API.friendships_incoming
+
 
 User methods
 ------------
index 31920341402556e91cdd0df4cd411d985fe88498..65a65db7a0dde28227ed3be201ae5ee25249c6b3 100644 (file)
@@ -1485,6 +1485,27 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('ids')
+    def friendships_incoming(self, **kwargs):
+        """friendships_incoming(*, cursor, stringify_ids)
+
+        Returns a collection of numeric IDs for every user who has a pending
+        request to follow the authenticating user.
+
+        :param cursor: |cursor|
+        :param stringify_ids: |stringify_ids|
+
+        :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-friendships-incoming
+        """
+        return self.request(
+            'GET', 'friendships/incoming', endpoint_parameters=(
+                'cursor', 'stringify_ids'
+            ), **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
@@ -1792,17 +1813,6 @@ class API:
             user_id=list_to_csv(user_id), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('ids')
-    def friendships_incoming(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming
-        """
-        return self.request(
-            'GET', 'friendships/incoming', endpoint_parameters=(
-                'cursor', 'stringify_ids'
-            ), **kwargs
-        )
-
     @pagination(mode='cursor')
     @payload('ids')
     def friendships_outgoing(self, **kwargs):