diff options
Diffstat (limited to 'mastodon/suggestions.py')
-rw-r--r-- | mastodon/suggestions.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mastodon/suggestions.py b/mastodon/suggestions.py new file mode 100644 index 0000000..ab55993 --- /dev/null +++ b/mastodon/suggestions.py | |||
@@ -0,0 +1,32 @@ | |||
1 | # suggestions.py - follow suggestion endpoints | ||
2 | |||
3 | from .versions import _DICT_VERSION_ACCOUNT | ||
4 | from .utility import api_version | ||
5 | |||
6 | from .internals import Mastodon as Internals | ||
7 | |||
8 | class Mastodon(Internals): | ||
9 | ### | ||
10 | # Reading data: Follow suggestions | ||
11 | ### | ||
12 | @api_version("2.4.3", "2.4.3", _DICT_VERSION_ACCOUNT) | ||
13 | def suggestions(self): | ||
14 | """ | ||
15 | Fetch follow suggestions for the logged-in user. | ||
16 | |||
17 | Returns a list of :ref:`account dicts <account dicts>`. | ||
18 | |||
19 | """ | ||
20 | return self.__api_request('GET', '/api/v1/suggestions') | ||
21 | |||
22 | ### | ||
23 | # Writing data: Follow suggestions | ||
24 | ### | ||
25 | @api_version("2.4.3", "2.4.3", _DICT_VERSION_ACCOUNT) | ||
26 | def suggestion_delete(self, account_id): | ||
27 | """ | ||
28 | Remove the user with the given `account_id` from the follow suggestions. | ||
29 | """ | ||
30 | account_id = self.__unpack_id(account_id) | ||
31 | url = '/api/v1/suggestions/{0}'.format(str(account_id)) | ||
32 | self.__api_request('DELETE', url) \ No newline at end of file | ||