.. automethod:: API.show_list_member
+.. automethod:: API.lists_memberships
+
User methods
------------
:rtype: :class:`List` object
-.. method:: API.lists_memberships([screen_name], [user_id], \
- [filter_to_owned_lists], [cursor], [count])
-
- Returns the lists the specified user has been added to. If ``user_id`` or
- ``screen_name`` are not provided, the memberships for the authenticating
- user are returned.
-
- :param screen_name: |screen_name|
- :param user_id: |user_id|
- :param filter_to_owned_lists: A boolean indicating whether to return just
- lists the authenticating user owns, and the user represented by
- ``user_id`` or ``screen_name`` is a member of.
- :param cursor: |cursor|
- :param count: |count|
- :rtype: list of :class:`List` objects
-
-
.. method:: API.lists_ownerships([user_id], [screen_name], [count], [cursor])
Returns the lists owned by the specified user. Private lists will only be
), **kwargs
)
+ @pagination(mode='cursor')
+ @payload('list', list=True)
+ def lists_memberships(self, **kwargs):
+ """lists_memberships(user_id, screen_name, count, cursor, \
+ filter_to_owned_lists)
+
+ Returns the lists the specified user has been added to. If ``user_id``
+ or ``screen_name`` are not provided, the memberships for the
+ authenticating user are returned.
+
+ :param user_id: |user_id|
+ :param screen_name: |screen_name|
+ :param count: |count|
+ :param cursor: |cursor|
+ :param filter_to_owned_lists: A boolean indicating whether to return
+ just lists the authenticating user owns, and the user represented
+ by ``user_id`` or ``screen_name`` is a member of.
+
+ :rtype: list of :class:`List` objects
+
+ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships
+ """
+ return self.request(
+ 'GET', 'lists/memberships', endpoint_parameters=(
+ 'user_id', 'screen_name', 'count', 'cursor',
+ 'filter_to_owned_lists'
+ ), **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
), **kwargs
)
- @pagination(mode='cursor')
- @payload('list', list=True)
- def lists_memberships(self, **kwargs):
- """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships
- """
- return self.request(
- 'GET', 'lists/memberships', endpoint_parameters=(
- 'user_id', 'screen_name', 'count', 'cursor',
- 'filter_to_owned_lists'
- ), **kwargs
- )
-
@pagination(mode='cursor')
@payload('list', list=True)
def lists_ownerships(self, **kwargs):