.. automethod:: API.lists_subscriptions
+.. automethod:: API.create_list
+
User methods
------------
List Methods
------------
-.. method:: API.create_list(name, [mode], [description])
-
- Creates a new list for the authenticated user.
- Note that you can create up to 1000 lists per account.
-
- :param name: The name of the new list.
- :param mode: |list_mode|
- :param description: The description of the list you are creating.
- :rtype: :class:`List` object
-
-
.. method:: API.destroy_list([owner_screen_name/owner_id], list_id/slug)
Deletes the specified list.
), **kwargs
)
+ @payload('list')
+ def create_list(self, name, **kwargs):
+ """create_list(name, *, mode, description)
+
+ Creates a new list for the authenticated user.
+ Note that you can create up to 1000 lists per account.
+
+ :param name: The name of the new list.
+ :param mode: |list_mode|
+ :param description: The description of the list you are creating.
+
+ :rtype: :class:`List` object
+
+ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create
+ """
+ return self.request(
+ 'POST', 'lists/create', endpoint_parameters=(
+ 'name', 'mode', 'description'
+ ), name=name, **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
"""
return self.request('POST', f'saved_searches/destroy/{id}', **kwargs)
- @payload('list')
- def create_list(self, name, **kwargs):
- """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create
- """
- return self.request(
- 'POST', 'lists/create', endpoint_parameters=(
- 'name', 'mode', 'description'
- ), name=name, **kwargs
- )
-
@payload('list')
def destroy_list(self, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy