Skip to content

Commit bdb8a46

Browse files
committed
Fixed resources alias and serialization
1 parent 3a7aacf commit bdb8a46

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

bugout/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
22
Bugout Python API
33
"""
4+
45
__author__ = "Bugout"
56
__maintainer__ = __author__
67
__description__ = "Python client library for Bugout API"
78

89
__email__ = "engineering@bugout.dev"
910
__license__ = "MIT"
10-
__version__ = "0.2.14"
11+
__version__ = "0.2.15"
1112

1213
__all__ = (
1314
"__author__",

bugout/resource.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import uuid
23
from typing import Any, Dict, Optional, Union
34

@@ -129,7 +130,10 @@ def add_resource_holder_permissions(
129130
"Authorization": f"Bearer {token}",
130131
}
131132
result = self._call(
132-
method=Method.post, path=path, headers=headers, json=holder_permissions
133+
method=Method.post,
134+
path=path,
135+
headers=headers,
136+
json=json.loads(holder_permissions.json(by_alias=True)),
133137
)
134138
return BugoutResourceHolders(**result)
135139

@@ -144,6 +148,9 @@ def delete_resource_holder_permissions(
144148
"Authorization": f"Bearer {token}",
145149
}
146150
result = self._call(
147-
method=Method.delete, path=path, headers=headers, json=holder_permissions
151+
method=Method.delete,
152+
path=path,
153+
headers=headers,
154+
json=json.loads(holder_permissions.json(by_alias=True)),
148155
)
149156
return BugoutResourceHolders(**result)

0 commit comments

Comments
 (0)