Skip to content

Commit 42ffe18

Browse files
committed
fix(admin-client): update README with user management methods and examples
1 parent 56f6417 commit 42ffe18

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,23 @@ pip install python-vaultwarden
3636
```python
3737
from vaultwarden.clients.vaultwarden import VaultwardenAdminClient
3838

39-
client = VaultwardenAdminClient(url="https://vaultwarden.example.com", admin_secret_token="admin_token")
39+
client = VaultwardenAdminClient(url="https://vaultwarden.example.com", admin_secret_token="admin_token", preload_users=True)
4040

4141
client.invite("john.doe@example.com")
4242

43-
all_users = client.get_all_users()
43+
# Get all users
44+
all_users = client.users()
4445

45-
client.delete(all_users[0].id)
46+
# Get a specific user by email
47+
user = client.user(email="example@example.com")
4648

49+
# Delete/Disable/Enable a user by ID
50+
client.delete(user.Id)
51+
client.disable(user.Id)
52+
client.enable(user.Id)
53+
54+
# Set enabled status of a user
55+
client.set_user_enabled(user.Id, enabled=True)
4756
```
4857

4958
### Bitwarden client

0 commit comments

Comments
 (0)