Implement the rest of the scheduled status endpoints

This commit is contained in:
Lorenz Diener 2019-04-28 19:34:52 +02:00
pare fe4e01f90e
commit d7f5b4d66d
S'han modificat 2 arxius amb 36 adicions i 0 eliminacions

Veure arxiu

@ -777,6 +777,13 @@ These functions allow you to get information about single statuses.
.. automethod:: Mastodon.status_favourited_by .. automethod:: Mastodon.status_favourited_by
.. automethod:: Mastodon.status_card .. automethod:: Mastodon.status_card
Writing data: Scheduled statuses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These functions allow you to get information about scheduled statuses.
.. automethod:: Mastodon.scheduled_statuses
.. automethod:: Mastodon.scheduled_status
Reading data: Notifications Reading data: Notifications
--------------------------- ---------------------------
This function allows you to get information about a users notifications. This function allows you to get information about a users notifications.
@ -891,6 +898,15 @@ interact with already posted statuses.
.. automethod:: Mastodon.status_unpin .. automethod:: Mastodon.status_unpin
.. automethod:: Mastodon.status_delete .. automethod:: Mastodon.status_delete
Writing data: Scheduled statuses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mastodon allows you to schedule statuses (using `status_post()`_.
The functions in this section allow you to update or delete thusly
scheduled statuses.
.. automethod:: Mastodon.scheduled_status_update
.. automethod:: Mastodon.scheduled_status_delete
Writing data: Notifications Writing data: Notifications
--------------------------- ---------------------------
These functions allow you to clear all or some notifications. These functions allow you to clear all or some notifications.

Veure arxiu

@ -814,6 +814,17 @@ class Mastodon:
""" """
return self.__api_request('GET', '/api/v1/scheduled_statuses') return self.__api_request('GET', '/api/v1/scheduled_statuses')
@api_version("2.7.0", "2.7.0", __DICT_VERSION_SCHEDULED_STATUS)
def scheduled_status(self, id):
"""
Fetch information about the scheduled status with the given id.
Returns a `scheduled toot dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
return self.__api_request('GET', url)
### ###
# Reading data: Notifications # Reading data: Notifications
### ###
@ -1580,6 +1591,15 @@ class Mastodon:
url = '/api/v1/scheduled_statuses/{0}'.format(str(id)) url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
return self.__api_request('PUT', url, params) return self.__api_request('PUT', url, params)
@api_version("2.7.0", "2.7.0", "2.7.0")
def scheduled_status_delete(self, id):
"""
Deletes a scheduled status.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
self.__api_request('DELETE', url)
### ###
# Writing data: Notifications # Writing data: Notifications
### ###