forked from passwork-me/pip-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete_password.py
More file actions
27 lines (19 loc) · 959 Bytes
/
delete_password.py
File metadata and controls
27 lines (19 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from passwork.passwork_api import PassworkAPI
def delete_password(api: PassworkAPI, password_id: str, verify: bool=True) -> None:
"""
Delete a password from the Passwork API.
This function awaits for API to be logged in,
after function call you also should logout API in your upper-level code
Args:
api (PassworkAPI): An instance of PassworkAPI class initialized with appropriate credentials.
password_id (str): The unique identifier of the password to delete.
This function doesn't provide the API login and logout, API should be logged in at the call of function,
after that you can call logout of API in your upper-level code
Example usage:
api = PassworkAPI(credentials)\n
delete_password(api, 'password123')
Raises:
ValueError: If password_id is empty or None.
"""
# Delete the specified password
api.delete_password(password_id=password_id, verify=verify)