Update and improve documentation for API.show_list_subscriber
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:28:42 +0000 (10:28 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:28:42 +0000 (10:28 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add include_entities and skip_status parameters to documentation
Improve parameter order in documentation

docs/api.rst
tweepy/api.py

index d294e8d3f1f89492f5e1631a151c43bea77f67c4..46091317bf48f8f8f7f0274a83e53975127f1634 100644 (file)
@@ -86,6 +86,8 @@ Create and manage lists
 
 .. automethod:: API.list_subscribers
 
+.. automethod:: API.show_list_subscriber
+
 
 User methods
 ------------
@@ -730,20 +732,6 @@ List Methods
    :rtype: :class:`List` object
 
 
-.. method:: API.show_list_subscriber(list_id/slug, screen_name/user_id, \
-                                     [owner_id/owner_screen_name])
-
-   Check if the specified user is a subscriber of the specified list.
-
-   :param list_id: |list_id|
-   :param slug: |slug|
-   :param screen_name: |screen_name|
-   :param user_id: |user_id|
-   :param owner_id: |owner_id|
-   :param owner_screen_name: |owner_screen_name|
-   :rtype: :class:`User` object if user is subscribed to list
-
-
 Trends Methods
 --------------
 
index d25f9b96fa23d521077ec9ad52330074d0b33ee0..8eb04db75a5dcd11925b4354b43d13c9870574e0 100644 (file)
@@ -1100,6 +1100,34 @@ class API:
             ), **kwargs
         )
 
+    @payload('user')
+    def show_list_subscriber(self, **kwargs):
+        """show_list_subscriber(*, owner_screen_name, owner_id, list_id, \
+                                slug, user_id, screen_name, include_entities \
+                                skip_status)
+
+        Check if the specified user is a subscriber of the specified list.
+
+        :param owner_screen_name: |owner_screen_name|
+        :param owner_id: |owner_id|
+        :param list_id: |list_id|
+        :param slug: |slug|
+        :param user_id: |user_id|
+        :param screen_name: |screen_name|
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+
+        :rtype: :class:`User` object if user is subscribed to list
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show
+        """
+        return self.request(
+            'GET', 'lists/subscribers/show', endpoint_parameters=(
+                'owner_screen_name', 'owner_id', 'list_id', 'slug', 'user_id',
+                'screen_name', 'include_entities', 'skip_status'
+            ), **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
@@ -1790,17 +1818,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('user')
-    def show_list_subscriber(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show
-        """
-        return self.request(
-            'GET', 'lists/subscribers/show', endpoint_parameters=(
-                'owner_screen_name', 'owner_id', 'list_id', 'slug', 'user_id',
-                'screen_name', 'include_entities', 'skip_status'
-            ), **kwargs
-        )
-
     @payload('json')
     def trends_available(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available