Order is now a class instead of just a dict.
This commit is contained in:
parent
bca2e7b143
commit
7c1dba2f1b
2 changed files with 19 additions and 1 deletions
14
camisatoshi_wordpress_reports/order.py
Normal file
14
camisatoshi_wordpress_reports/order.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from typing import Dict
|
||||
|
||||
|
||||
class Order:
|
||||
|
||||
def __init__(self, raw_data: Dict):
|
||||
self.raw_data = raw_data
|
||||
|
||||
def __getitem__(self, item):
|
||||
return self.raw_data[item]
|
||||
|
||||
@classmethod
|
||||
def from_api_response(cls, raw_data) -> "Order":
|
||||
return Order(raw_data)
|
||||
Loading…
Add table
Add a link
Reference in a new issue