.. automethod:: API.search
+Accounts and users
+------------------
+
+Create and manage lists
+^^^^^^^^^^^^^^^^^^^^^^^
+
+.. automethod:: API.lists_all
+
User methods
------------
:rtype: :class:`List` object
-.. method:: API.lists_all([screen_name], [user_id], [reverse])
-
- Returns all lists the authenticating or specified user subscribes to,
- including their own. The user is specified using the ``user_id`` or
- ``screen_name`` parameters. If no user is given, the authenticating user is
- used.
-
- A maximum of 100 results will be returned by this call. Subscribed lists are
- returned first, followed by owned lists. This means that if a user
- subscribes to 90 lists and owns 20 lists, this method returns 90
- subscriptions and 10 owned lists. The ``reverse`` method returns owned lists
- first, so with ``reverse=true``, 20 owned lists and 80 subscriptions would
- be returned.
-
- :param screen_name: |screen_name|
- :param user_id: |user_id|
- :param reverse: A boolean indicating if you would like owned lists to be
- returned first. See description above for information on how
- this parameter works.
- :rtype: list of :class:`List` objects
-
-
.. method:: API.lists_memberships([screen_name], [user_id], \
[filter_to_owned_lists], [cursor], [count])
), q=q, **kwargs
)
+ # Create and manage lists
+
+ @payload('list', list=True)
+ def lists_all(self, **kwargs):
+ """lists_all(*, user_id, screen_name, reverse)
+
+ Returns all lists the authenticating or specified user subscribes to,
+ including their own. The user is specified using the ``user_id`` or
+ ``screen_name`` parameters. If no user is given, the authenticating
+ user is used.
+
+ A maximum of 100 results will be returned by this call. Subscribed
+ lists are returned first, followed by owned lists. This means that if a
+ user subscribes to 90 lists and owns 20 lists, this method returns 90
+ subscriptions and 10 owned lists. The ``reverse`` method returns owned
+ lists first, so with ``reverse=true``, 20 owned lists and 80
+ subscriptions would be returned.
+
+ :param user_id: |user_id|
+ :param screen_name: |screen_name|
+ :param reverse: A boolean indicating if you would like owned lists to
+ be returned first. See description above for
+ information on how this parameter works.
+
+ :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-list
+ """
+ return self.request(
+ 'GET', 'lists/list', endpoint_parameters=(
+ 'user_id', 'screen_name', 'reverse'
+ ), **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
)
- @payload('list', list=True)
- def lists_all(self, **kwargs):
- """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list
- """
- return self.request(
- 'GET', 'lists/list', endpoint_parameters=(
- 'user_id', 'screen_name', 'reverse'
- ), **kwargs
- )
-
@pagination(mode='cursor')
@payload('list', list=True)
def lists_memberships(self, **kwargs):