Skip to content

Commit cc263a4

Browse files
committed
add new API calls
1 parent 78854dc commit cc263a4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

databunkerpro/api.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,33 @@ def delete_user(
435435
}
436436
return self._make_request("UserDelete", data, request_metadata)
437437

438+
def delete_users_bulk(
439+
self,
440+
users: List[Dict[str, str]],
441+
request_metadata: Optional[Dict[str, Any]] = None,
442+
) -> Dict[str, Any]:
443+
"""
444+
Delete multiple users in bulk from DatabunkerPro.
445+
446+
Args:
447+
users: List of user dictionaries containing mode and identity for each user to delete
448+
request_metadata: Optional request metadata
449+
450+
Returns:
451+
Dict containing the result of the bulk deletion operation
452+
453+
Example:
454+
>>> users_to_delete = [
455+
... {"mode": "email", "identity": "[email protected]"},
456+
... {"mode": "phone", "identity": "+1234567890"}
457+
... ]
458+
>>> result = api.delete_users_bulk(users_to_delete)
459+
>>> print(result)
460+
{'status': 'ok', 'deleted_count': 2}
461+
"""
462+
data = {"users": users}
463+
return self._make_request("UserDeleteBulk", data, request_metadata)
464+
438465
def request_user_deletion(
439466
self,
440467
mode: str,
@@ -1616,6 +1643,29 @@ def generate_wrapping_key(
16161643
data = {"key1": key1, "key2": key2, "key3": key3}
16171644
return self._make_request("SystemGenerateWrappingKey", data, request_metadata)
16181645

1646+
def set_license_key(
1647+
self,
1648+
license_key: str,
1649+
request_metadata: Optional[Dict[str, Any]] = None,
1650+
) -> Dict[str, Any]:
1651+
"""
1652+
Set the license key for the system.
1653+
1654+
Args:
1655+
license_key: The license key to set
1656+
request_metadata: Optional request metadata
1657+
1658+
Returns:
1659+
Dict containing the result of the license key setting operation
1660+
1661+
Example:
1662+
>>> result = api.set_license_key("your-license-key-here")
1663+
>>> print(result)
1664+
{'status': 'ok', 'message': 'License key set successfully'}
1665+
"""
1666+
data = {"licensekey": license_key}
1667+
return self._make_request("SystemSetLicenseKey", data, request_metadata)
1668+
16191669
# Session Management
16201670
def upsert_session(
16211671
self,

0 commit comments

Comments
 (0)