From 8ff5f22c6655002ff7ec230d2200d6833af5ff0a Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 7 Apr 2021 13:15:08 -0500 Subject: [PATCH] Add documentation for API.friendships_outgoing Improve method order --- docs/api.rst | 2 ++ tweepy/api.py | 32 +++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 32fbd33..4aefab5 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -125,6 +125,8 @@ Follow, search, and get users .. automethod:: API.no_retweets_friendships +.. automethod:: API.friendships_outgoing + User methods ------------ diff --git a/tweepy/api.py b/tweepy/api.py index ae3a76c..42bfb2a 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1548,6 +1548,27 @@ class API: ), **kwargs ) + @pagination(mode='cursor') + @payload('ids') + def friendships_outgoing(self, **kwargs): + """friendships_outgoing(*, cursor, stringify_ids) + + Returns a collection of numeric IDs for every protected user for whom + the authenticating user has a pending follow request. + + :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-outgoing + """ + return self.request( + 'GET', 'friendships/outgoing', 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 @@ -1844,17 +1865,6 @@ class API: ), **kwargs ) - @pagination(mode='cursor') - @payload('ids') - def friendships_outgoing(self, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing - """ - return self.request( - 'GET', 'friendships/outgoing', endpoint_parameters=( - 'cursor', 'stringify_ids' - ), **kwargs - ) - @payload('json') def get_settings(self, **kwargs): """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings -- 2.25.1