From: Harmon Date: Wed, 7 Apr 2021 17:33:42 +0000 (-0500) Subject: Add documentation for API.friendships_incoming X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=09dbe0e8d0975531b559f18caf702152353c0fff;p=tweepy.git Add documentation for API.friendships_incoming Improve method order --- diff --git a/docs/api.rst b/docs/api.rst index ca8870e..fa3f39c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -119,6 +119,8 @@ Follow, search, and get users .. automethod:: API.friends +.. automethod:: API.friendships_incoming + User methods ------------ diff --git a/tweepy/api.py b/tweepy/api.py index 3192034..65a65db 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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):