aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-06-22 21:45:09 +0200
committerLorenz Diener <[email protected]>2019-06-22 21:45:09 +0200
commit9e6745ef8a7463675f914b0ab6cf89ef5f6eb0dd (patch)
treebe08bb279ef39798f6c4946f208e0f82c106624b /mastodon/Mastodon.py
parentee096aa9200f7047e41aa4df83c908d721d84aa2 (diff)
downloadmastodon.py-9e6745ef8a7463675f914b0ab6cf89ef5f6eb0dd.tar.gz
Add pagination to report API
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index c9aaa75..5b521d1 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -2474,7 +2474,8 @@ class Mastodon:
2474 2474
2475 self.__api_request('POST', '/api/v1/admin/accounts/{0}/action'.format(id), params) 2475 self.__api_request('POST', '/api/v1/admin/accounts/{0}/action'.format(id), params)
2476 2476
2477 def admin_reports(self, resolved=False, account_id=None, target_account_id=None): 2477 @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_REPORT)
2478 def admin_reports(self, resolved=False, account_id=None, target_account_id=None, max_id=None, min_id=None, since_id=None, limit=None):
2478 """ 2479 """
2479 Get a list of reports. 2480 Get a list of reports.
2480 2481
@@ -2483,7 +2484,26 @@ class Mastodon:
2483 2484
2484 Returns a list of `report dicts`_. 2485 Returns a list of `report dicts`_.
2485 """ 2486 """
2486 #GET /api/v1/admin/reports Get reports, with params resolved, account_id, target_account_id 2487 if max_id != None:
2488 max_id = self.__unpack_id(max_id)
2489
2490 if min_id != None:
2491 min_id = self.__unpack_id(min_id)
2492
2493 if since_id != None:
2494 since_id = self.__unpack_id(since_id)
2495
2496 if not account_id is None:
2497 account_id = self.__unpack_id(account_id)
2498
2499 if not target_account_id is None:
2500 target_account_id = self.__unpack_id(target_account_id)
2501
2502 if resolved == False:
2503 resolved = None
2504
2505 params = self.__generate_params(locals())
2506 return self.__api_request('GET', '/api/v1/admin/reports', params)
2487 2507
2488 def admin_report(self, id): 2508 def admin_report(self, id):
2489 pass 2509 pass
Powered by cgit v1.2.3 (git 2.41.0)