Skip to content

Commit 1ea38ee

Browse files
committed
User create handler with application_id and same for resources list
1 parent 4ec7483 commit 1ea38ee

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.1.13"
10+
__version__ = "0.1.14"
1111

1212
__all__ = (
1313
"__author__",

bugout/app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,17 @@ def create_user(
5252
username: str,
5353
email: str,
5454
password: str,
55+
application_id: Optional[Union[str, uuid.UUID]] = None,
5556
timeout: float = REQUESTS_TIMEOUT,
5657
**kwargs: Dict[str, Any],
5758
) -> data.BugoutUser:
5859
self.user.timeout = timeout
5960
return self.user.create_user(
60-
username=username, email=email, password=password, **kwargs
61+
username=username,
62+
email=email,
63+
password=password,
64+
application_id=application_id,
65+
**kwargs,
6166
)
6267

6368
def get_user(
@@ -361,11 +366,14 @@ def get_resource(
361366
def list_resources(
362367
self,
363368
token: Union[str, uuid.UUID],
369+
application_id: Optional[Union[str, uuid.UUID]] = None,
364370
params: Optional[Dict[str, Any]] = None,
365371
timeout: float = REQUESTS_TIMEOUT,
366372
) -> data.BugoutResources:
367373
self.resource.timeout = timeout
368-
return self.resource.list_resources(token=token, params=params)
374+
return self.resource.list_resources(
375+
token=token, application_id=application_id, params=params
376+
)
369377

370378
def delete_resource(
371379
self,

bugout/resource.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ def get_resource(
6464
def list_resources(
6565
self,
6666
token: Union[str, uuid.UUID],
67+
application_id: Optional[Union[str, uuid.UUID]] = None,
6768
params: Optional[Dict[str, Any]] = None,
6869
) -> BugoutResources:
6970
resources_path = "resources"
7071
headers = {
7172
"Authorization": f"Bearer {token}",
7273
}
74+
if application_id is not None:
75+
params["application_id"] = application_id
7376
result = self._call(
7477
method=Method.get, path=resources_path, params=params, headers=headers
7578
)

bugout/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ def create_user(
3737
username: str,
3838
email: str,
3939
password: str,
40+
application_id: Optional[Union[str, uuid.UUID]] = None,
4041
**kwargs: Dict[str, Any],
4142
) -> BugoutUser:
4243
create_user_path = "user"
4344
data = {
4445
"username": username,
4546
"email": email,
4647
"password": password,
48+
"application_id": application_id,
4749
}
4850
headers = {}
4951
if "headers" in kwargs.keys():

0 commit comments

Comments
 (0)