aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-06-22 22:00:19 +0200
committerLorenz Diener <[email protected]>2019-06-22 22:00:19 +0200
commit9b8d6f37a26f2c2b67b619e4a579c01f3b093003 (patch)
tree47c14864fa1496a79c9b35d48ddc7769be3a8c14 /mastodon
parentc671f4bbb36c3e754c43ee2bb0de62545bf65cad (diff)
downloadmastodon.py-9b8d6f37a26f2c2b67b619e4a579c01f3b093003.tar.gz
Implement rest of the moderation API
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py44
1 files changed, 34 insertions, 10 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 83726d4..f463ac9 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -2504,7 +2504,7 @@ class Mastodon:
2504 params = self.__generate_params(locals()) 2504 params = self.__generate_params(locals())
2505 return self.__api_request('GET', '/api/v1/admin/reports', params) 2505 return self.__api_request('GET', '/api/v1/admin/reports', params)
2506 2506
2507 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT) 2507 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT)
2508 def admin_report(self, id): 2508 def admin_report(self, id):
2509 """ 2509 """
2510 Fetches the report with the given id. 2510 Fetches the report with the given id.
@@ -2513,22 +2513,46 @@ class Mastodon:
2513 """ 2513 """
2514 id = self.__unpack_id(id) 2514 id = self.__unpack_id(id)
2515 return self.__api_request('GET', '/api/v1/admin/reports/{0}'.format(id)) 2515 return self.__api_request('GET', '/api/v1/admin/reports/{0}'.format(id))
2516 2516
2517 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT)
2517 def admin_report_assign(self, id): 2518 def admin_report_assign(self, id):
2518 pass 2519 """
2519 #POST /api/v1/admin/reports/:id/assign_to_self Assign report to self 2520 Assigns the given report to the logged-in user.
2520 2521
2522 Returns the updated `report dict`_.
2523 """
2524 id = self.__unpack_id(id)
2525 return self.__api_request('POST', '/api/v1/admin/reports/{0}/assign_to_sel'.format(id))
2526
2527 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT)
2521 def admin_report_unassign(self, id): 2528 def admin_report_unassign(self, id):
2522 pass 2529 """
2523 #POST /api/v1/admin/reports/:id/unassign Unassign report from self 2530 Unassigns the given report from the logged-in user.
2524 2531
2532 Returns the updated `report dict`_.
2533 """
2534 id = self.__unpack_id(id)
2535 return self.__api_request('POST', '/api/v1/admin/reports/{0}/unassign'.format(id))
2536
2537 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT)
2525 def admin_report_reopen(self, id): 2538 def admin_report_reopen(self, id):
2526 pass 2539 """
2527 #POST /api/v1/admin/reports/:id/reopen Re-open report 2540 Reopens a closed report.
2541
2542 Returns the updated `report dict`_.
2543 """
2544 id = self.__unpack_id(id)
2545 return self.__api_request('POST', '/api/v1/admin/reports/{0}/reopen'.format(id))
2528 2546
2547 @api_version("2.9.1", "2.9.1", __DICT_VERSION_REPORT)
2529 def admin_report_resolve(self, id): 2548 def admin_report_resolve(self, id):
2530 pass 2549 """
2531 #POST /api/v1/admin/reports/:id/resolve Close report 2550 Marks a report as resolved (without taking any action).
2551
2552 Returns the updated `report dict`_.
2553 """
2554 id = self.__unpack_id(id)
2555 return self.__api_request('POST', '/api/v1/admin/reports/{0}/resolve'.format(id))
2532 2556
2533 ### 2557 ###
2534 # Push subscription crypto utilities 2558 # Push subscription crypto utilities
Powered by cgit v1.2.3 (git 2.41.0)