Update and improve documentation for API.destroy_block
authorHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 15:16:18 +0000 (10:16 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 15:16:18 +0000 (10:16 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add include_entities and skip_status parameters to documentation
Remove id parameter from documentation

docs/api.rst
tweepy/api.py

index 96141ceb3caf5790849723d0569d20704298e2a5..0033461924a6586a34e6bfd40f84ecd51bd4d499 100644 (file)
@@ -181,6 +181,8 @@ Mute, block, and report users
 
 .. automethod:: API.create_block
 
+.. automethod:: API.destroy_block
+
 
 Direct Message Methods
 ----------------------
@@ -252,20 +254,6 @@ Account Methods
    :rtype: :class:`JSON` object
 
 
-Block Methods
--------------
-
-.. method:: API.destroy_block(id/screen_name/user_id)
-
-   Un-blocks the user specified in the ID parameter for the authenticating
-   user.
-
-   :param id: |uid|
-   :param screen_name: |screen_name|
-   :param user_id: |user_id|
-   :rtype: :class:`User` object
-
-
 Mute Methods
 ------------
 
index b543e543b95cfc41cfd38cf05ba28dc0914a30b2..8065067552a027af21db7bf7c0e7c89f8a61a49f 100644 (file)
@@ -2115,6 +2115,29 @@ class API:
             ), **kwargs
         )
 
+    @payload('user')
+    def destroy_block(self, **kwargs):
+        """destroy_block(*, screen_name, user_id, include_entities, \
+                         skip_status)
+
+        Un-blocks the user specified in the ID parameter for the authenticating
+        user.
+
+        :param screen_name: |screen_name|
+        :param user_id: |user_id|
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+
+        :rtype: :class:`User` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-destroy
+        """
+        return self.request(
+            'POST', 'blocks/destroy', endpoint_parameters=(
+                'screen_name', 'user_id', '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
@@ -2354,16 +2377,6 @@ class API:
             ), use_cache=False, **kwargs
         )
 
-    @payload('user')
-    def destroy_block(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-destroy
-        """
-        return self.request(
-            'POST', 'blocks/destroy', endpoint_parameters=(
-                'screen_name', 'user_id', 'include_entities', 'skip_status'
-            ), **kwargs
-        )
-
     @payload('user')
     def create_mute(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-create