Update and improve documentation for API.destroy_favorite
authorHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 23:57:57 +0000 (18:57 -0500)
committerHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 23:57:57 +0000 (18:57 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add documentation for include_entities parameter
Improve formatting and capitalization of reference

docs/api.rst
tweepy/api.py

index 3997d8b2e97da9b6c8a44c5a9c8a29f31c4b27e4..82b66700e7f65c29ce5577d87c719643ca8a03d8 100644 (file)
@@ -47,6 +47,8 @@ Post, retrieve, and engage with Tweets
 
 .. automethod:: API.create_favorite
 
+.. automethod:: API.destroy_favorite
+
 
 Status methods
 --------------
@@ -443,18 +445,6 @@ Account Methods
    :rtype: :class:`User` object
 
 
-Favorite Methods
-----------------
-
-.. method:: API.destroy_favorite(id)
-
-   Un-favorites the status specified in the ID parameter as the authenticating
-   user.
-
-   :param id: |sid|
-   :rtype: :class:`Status` object
-
-
 Block Methods
 -------------
 
index 38e968317fb0247518bf8d9a9252de45c12efe29..a5972fad176315d287eb69545be48e305e0dfc90 100644 (file)
@@ -586,6 +586,26 @@ class API:
             ), id=id, **kwargs
         )
 
+    @payload('status')
+    def destroy_favorite(self, id, **kwargs):
+        """destroy_favorite(id, *, include_entities)
+
+        Un-favorites the status specified in the ``id`` parameter as the
+        authenticating user.
+
+        :param id: |sid|
+        :param include_entities: |include_entities|
+
+        :rtype: :class:`Status` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-destroy
+        """
+        return self.request(
+            'POST', 'favorites/destroy', endpoint_parameters=(
+                'id', 'include_entities'
+            ), id=id, **kwargs
+        )
+
     @payload('status')
     def update_status(self, status, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update
@@ -1102,16 +1122,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('status')
-    def destroy_favorite(self, id, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-destroy
-        """
-        return self.request(
-            'POST', 'favorites/destroy', endpoint_parameters=(
-                'id', 'include_entities'
-            ), id=id, **kwargs
-        )
-
     @payload('user')
     def create_block(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-create