Skip to content

Commit f2c9663

Browse files
authored
Add JSON parsing to Response class initialization
1 parent 62d50f2 commit f2c9663

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import json
12
class Response:
23
def __init__(self, http_response):
34
self.http_response = http_response
45
self.result = None
56
self.metadata = None
7+
self.__post_init__()
8+
9+
def __post_init__(self):
10+
data = json.loads(self.http_response.data)
11+
self.result = data.get("Result")
12+
self.metadata = data.get("ResponseMetadata")

0 commit comments

Comments
 (0)