diff options
author | Lorenz Diener <[email protected]> | 2019-04-28 19:34:52 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2019-04-28 19:34:52 +0200 |
commit | d7f5b4d66d47baa12d9e986c39385618adef0e71 (patch) | |
tree | 72b0f452d469e51326e42b1e67fbe12e6b4ab7dd | |
parent | fe4e01f90eb76f68719611042e575a4fff32f9d0 (diff) | |
download | mastodon.py-d7f5b4d66d47baa12d9e986c39385618adef0e71.tar.gz |
Implement the rest of the scheduled status endpoints
-rw-r--r-- | docs/index.rst | 16 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index daae043..d6d0d04 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -777,6 +777,13 @@ These functions allow you to get information about single statuses. | |||
777 | .. automethod:: Mastodon.status_favourited_by | 777 | .. automethod:: Mastodon.status_favourited_by |
778 | .. automethod:: Mastodon.status_card | 778 | .. automethod:: Mastodon.status_card |
779 | 779 | ||
780 | Writing data: Scheduled statuses | ||
781 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
782 | These functions allow you to get information about scheduled statuses. | ||
783 | |||
784 | .. automethod:: Mastodon.scheduled_statuses | ||
785 | .. automethod:: Mastodon.scheduled_status | ||
786 | |||
780 | Reading data: Notifications | 787 | Reading data: Notifications |
781 | --------------------------- | 788 | --------------------------- |
782 | This function allows you to get information about a users notifications. | 789 | This function allows you to get information about a users notifications. |
@@ -891,6 +898,15 @@ interact with already posted statuses. | |||
891 | .. automethod:: Mastodon.status_unpin | 898 | .. automethod:: Mastodon.status_unpin |
892 | .. automethod:: Mastodon.status_delete | 899 | .. automethod:: Mastodon.status_delete |
893 | 900 | ||
901 | Writing data: Scheduled statuses | ||
902 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
903 | Mastodon allows you to schedule statuses (using `status_post()`_. | ||
904 | The functions in this section allow you to update or delete thusly | ||
905 | scheduled statuses. | ||
906 | |||
907 | .. automethod:: Mastodon.scheduled_status_update | ||
908 | .. automethod:: Mastodon.scheduled_status_delete | ||
909 | |||
894 | Writing data: Notifications | 910 | Writing data: Notifications |
895 | --------------------------- | 911 | --------------------------- |
896 | These functions allow you to clear all or some notifications. | 912 | These functions allow you to clear all or some notifications. |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 97e8461..c037ceb 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -814,6 +814,17 @@ class Mastodon: | |||
814 | """ | 814 | """ |
815 | return self.__api_request('GET', '/api/v1/scheduled_statuses') | 815 | return self.__api_request('GET', '/api/v1/scheduled_statuses') |
816 | 816 | ||
817 | @api_version("2.7.0", "2.7.0", __DICT_VERSION_SCHEDULED_STATUS) | ||
818 | def scheduled_status(self, id): | ||
819 | """ | ||
820 | Fetch information about the scheduled status with the given id. | ||
821 | |||
822 | Returns a `scheduled toot dict`_. | ||
823 | """ | ||
824 | id = self.__unpack_id(id) | ||
825 | url = '/api/v1/scheduled_statuses/{0}'.format(str(id)) | ||
826 | return self.__api_request('GET', url) | ||
827 | |||
817 | ### | 828 | ### |
818 | # Reading data: Notifications | 829 | # Reading data: Notifications |
819 | ### | 830 | ### |
@@ -1580,6 +1591,15 @@ class Mastodon: | |||
1580 | url = '/api/v1/scheduled_statuses/{0}'.format(str(id)) | 1591 | url = '/api/v1/scheduled_statuses/{0}'.format(str(id)) |
1581 | return self.__api_request('PUT', url, params) | 1592 | return self.__api_request('PUT', url, params) |
1582 | 1593 | ||
1594 | @api_version("2.7.0", "2.7.0", "2.7.0") | ||
1595 | def scheduled_status_delete(self, id): | ||
1596 | """ | ||
1597 | Deletes a scheduled status. | ||
1598 | """ | ||
1599 | id = self.__unpack_id(id) | ||
1600 | url = '/api/v1/scheduled_statuses/{0}'.format(str(id)) | ||
1601 | self.__api_request('DELETE', url) | ||
1602 | |||
1583 | ### | 1603 | ### |
1584 | # Writing data: Notifications | 1604 | # Writing data: Notifications |
1585 | ### | 1605 | ### |