Skip to content

Commit

Permalink
Add pagination params to admin_domain_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
halcy authored and halcy committed Apr 23, 2023
1 parent 06825da commit 60f9bc7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mastodon/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,23 @@ def admin_trending_links(self):
return self.__api_request('GET', '/api/v1/admin/trends/links', params)

@api_version("4.0.0", "4.0.0", _DICT_VERSION_ADMIN_DOMAIN_BLOCK)
def admin_domain_blocks(self, id=None, limit:int=None):
def admin_domain_blocks(self, id=None, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetches a list of blocked domains. Requires scope `admin:read:domain_blocks`.
Provide an `id` to fetch a specific domain block based on its database id.
Returns a list of :ref:`admin domain block dicts <admin domain block dicts>`, raises a `MastodonAPIError` if the specified block does not exist.
"""
if max_id is not None:
max_id = self.__unpack_id(max_id)

if min_id is not None:
min_id = self.__unpack_id(min_id)

if since_id is not None:
since_id = self.__unpack_id(since_id)

if id is not None:
id = self.__unpack_id(id)
return self.__api_request('GET', f'/api/v1/admin/domain_blocks/{id}')
Expand Down

0 comments on commit 60f9bc7

Please sign in to comment.