Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions duo_client/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,17 @@ def delete_user(self, user_id):
path = '/admin/v1/users/' + user_id
return self.json_api_call('DELETE', path, {})

def bulk_trash_user(self, user_ids: list):
"""
Move user/s to trash.
user_ids - List of user ids
Returns a list of dicts with the 'success' and 'user_id' data.
Raises RuntimeError on error.
"""
user_ids = [urllib.parse.quote_plus(str(user_id)) for user_id in user_ids]
path = '/admin/v1/users/bulk_send_to_trash'
return self.json_api_call('POST', path, {"user_id_list": json.dumps(user_ids)})

def enroll_user(self, username, email, valid_secs=None):
"""
Enroll a user and send them an enrollment email.
Expand Down