diff options
-rw-r--r-- | mastodon/Mastodon.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 78f8b85..bda3001 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -208,6 +208,8 @@ class Mastodon: | |||
208 | __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) | 208 | __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) |
209 | __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) | 209 | __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) |
210 | __DICT_VERSION_PREFERENCES = "2.8.0" | 210 | __DICT_VERSION_PREFERENCES = "2.8.0" |
211 | __DICT_VERSION_ADMIN_ACCOUNT = "2.9.1" | ||
212 | __DICT_VERSION_ADMIN_REPORT = "2.9.1" | ||
211 | 213 | ||
212 | ### | 214 | ### |
213 | # Registering apps | 215 | # Registering apps |
@@ -2330,7 +2332,7 @@ class Mastodon: | |||
2330 | ### | 2332 | ### |
2331 | # Moderation API | 2333 | # Moderation API |
2332 | ### | 2334 | ### |
2333 | @api_version("2.9.1", "2.9.1", "2.9.1") | 2335 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) |
2334 | def admin_accounts(self, remote=False, by_domain=None, status='active', username=None, display_name=None, email=None, ip=None, staff_only=False, max_id=None, min_id=None, since_id=None, limit=None): | 2336 | def admin_accounts(self, remote=False, by_domain=None, status='active', username=None, display_name=None, email=None, ip=None, staff_only=False, max_id=None, min_id=None, since_id=None, limit=None): |
2335 | """ | 2337 | """ |
2336 | Fetches a list of accounts that match given criteria. By default, local accounts are returned. | 2338 | Fetches a list of accounts that match given criteria. By default, local accounts are returned. |
@@ -2376,6 +2378,7 @@ class Mastodon: | |||
2376 | 2378 | ||
2377 | return self.__api_request('GET', '/api/v1/admin/accounts', params) | 2379 | return self.__api_request('GET', '/api/v1/admin/accounts', params) |
2378 | 2380 | ||
2381 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2379 | def admin_account(self, id): | 2382 | def admin_account(self, id): |
2380 | """ | 2383 | """ |
2381 | Fetches a single `admin account dict`_ for the user with the given id. | 2384 | Fetches a single `admin account dict`_ for the user with the given id. |
@@ -2384,7 +2387,8 @@ class Mastodon: | |||
2384 | """ | 2387 | """ |
2385 | id = self.__unpack_id(id) | 2388 | id = self.__unpack_id(id) |
2386 | return self.__api_request('GET', '/api/v1/admin/accounts/{0}'.format(id)) | 2389 | return self.__api_request('GET', '/api/v1/admin/accounts/{0}'.format(id)) |
2387 | 2390 | ||
2391 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2388 | def admin_account_enable(self, id): | 2392 | def admin_account_enable(self, id): |
2389 | """ | 2393 | """ |
2390 | Reenables login for a local account for which login has been disabled. | 2394 | Reenables login for a local account for which login has been disabled. |
@@ -2394,6 +2398,7 @@ class Mastodon: | |||
2394 | id = self.__unpack_id(id) | 2398 | id = self.__unpack_id(id) |
2395 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/enable'.format(id)) | 2399 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/enable'.format(id)) |
2396 | 2400 | ||
2401 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2397 | def admin_account_approve(self, id): | 2402 | def admin_account_approve(self, id): |
2398 | """ | 2403 | """ |
2399 | Approves a pending account. | 2404 | Approves a pending account. |
@@ -2403,6 +2408,7 @@ class Mastodon: | |||
2403 | id = self.__unpack_id(id) | 2408 | id = self.__unpack_id(id) |
2404 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/approve'.format(id)) | 2409 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/approve'.format(id)) |
2405 | 2410 | ||
2411 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2406 | def admin_account_reject(self, id): | 2412 | def admin_account_reject(self, id): |
2407 | """ | 2413 | """ |
2408 | Rejects and deletes a pending account. | 2414 | Rejects and deletes a pending account. |
@@ -2411,7 +2417,8 @@ class Mastodon: | |||
2411 | """ | 2417 | """ |
2412 | id = self.__unpack_id(id) | 2418 | id = self.__unpack_id(id) |
2413 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/reject'.format(id)) | 2419 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/reject'.format(id)) |
2414 | 2420 | ||
2421 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2415 | def admin_account_unsilence(self, id): | 2422 | def admin_account_unsilence(self, id): |
2416 | """ | 2423 | """ |
2417 | Unsilences an account. | 2424 | Unsilences an account. |
@@ -2421,6 +2428,7 @@ class Mastodon: | |||
2421 | id = self.__unpack_id(id) | 2428 | id = self.__unpack_id(id) |
2422 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/unsilence'.format(id)) | 2429 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/unsilence'.format(id)) |
2423 | 2430 | ||
2431 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
2424 | def admin_account_unsuspend(self, id): | 2432 | def admin_account_unsuspend(self, id): |
2425 | """ | 2433 | """ |
2426 | Unsuspends an account. | 2434 | Unsuspends an account. |
@@ -2429,7 +2437,8 @@ class Mastodon: | |||
2429 | """ | 2437 | """ |
2430 | id = self.__unpack_id(id) | 2438 | id = self.__unpack_id(id) |
2431 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/unsuspend'.format(id)) | 2439 | return self.__api_request('POST', '/api/v1/admin/accounts/{0}/unsuspend'.format(id)) |
2432 | 2440 | ||
2441 | @api_version("2.9.1", "2.9.1", "2.9.1") | ||
2433 | def admin_account_moderate(self, id, action=None, report_id=None, warning_preset_id=None, text=None, send_email_notification=True): | 2442 | def admin_account_moderate(self, id, action=None, report_id=None, warning_preset_id=None, text=None, send_email_notification=True): |
2434 | """ | 2443 | """ |
2435 | Perform a moderation action on an account. | 2444 | Perform a moderation action on an account. |