.. automethod:: API.get_user
+.. automethod:: API.create_friendship
+
Direct Message Methods
----------------------
Friendship Methods
------------------
-.. method:: API.create_friendship(id/screen_name/user_id, [follow])
-
- Create a new friendship with the specified user (aka follow).
-
- :param id: |uid|
- :param screen_name: |screen_name|
- :param user_id: |user_id|
- :param follow: Enable notifications for the target user in addition to
- becoming friends.
- :rtype: :class:`User` object
-
-
.. method:: API.destroy_friendship(id/screen_name/user_id)
Destroy a friendship with the specified user (aka unfollow).
), **kwargs
)
+ @payload('user')
+ def create_friendship(self, **kwargs):
+ """create_friendship(*, screen_name, user_id, follow)
+
+ Create a new friendship with the specified user (aka follow).
+
+ :param screen_name: |screen_name|
+ :param user_id: |user_id|
+ :param follow: Enable notifications for the target user in addition to
+ becoming friends.
+
+ :rtype: :class:`User` object
+
+ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create
+ """
+ return self.request(
+ 'POST', 'friendships/create', endpoint_parameters=(
+ 'screen_name', 'user_id', 'follow'
+ ), **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
), id=id, **kwargs
)
- @payload('user')
- def create_friendship(self, **kwargs):
- """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create
- """
- return self.request(
- 'POST', 'friendships/create', endpoint_parameters=(
- 'screen_name', 'user_id', 'follow'
- ), **kwargs
- )
-
@payload('user')
def destroy_friendship(self, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy