Skip to content

Commit

Permalink
exchange and material use get from adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jplacht committed Oct 30, 2023
1 parent 7679437 commit 28e66ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions pyfio/endpoints/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def get(self, exchange_ticker: str) -> ExchangeTicker:
"""
self._validate_exchangeticker(exchange_ticker=exchange_ticker)

(status, data) = self._adapter._do(
http_method="get",
(status, data) = self._adapter.get(
endpoint=self._adapter.urls.exchange_get_url(
exchange_ticker=exchange_ticker
),
Expand Down Expand Up @@ -106,8 +105,7 @@ def get_orders(self, company_code: str) -> OrderList:
# 1 to 4 character company code
validate_company_code(company_code=company_code)

(_, data) = self._adapter._do(
http_method="get",
(_, data) = self._adapter.get(
endpoint=self._adapter.urls.exchange_get_orders_companycode(
company_code=company_code
),
Expand Down
9 changes: 3 additions & 6 deletions pyfio/endpoints/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def get(self, material_ticker: str) -> MaterialTicker:

self._validate_ticker(material_ticker=material_ticker)

(status, data) = self._adapter._do(
http_method="get",
(status, data) = self._adapter.get(
endpoint=self._adapter.urls.material_get_url(
material_ticker=material_ticker
),
Expand All @@ -56,8 +55,7 @@ def all(self) -> MaterialTickerList:
Returns:
MaterialModelList: List of Materials as List[MaterialModel]
"""
(_, data) = self._adapter._do(
http_method="get",
(_, data) = self._adapter.get(
endpoint=self._adapter.urls.material_allmaterials_url(),
)
return MaterialTickerList.model_validate(data)
Expand All @@ -74,8 +72,7 @@ def category(self, category_name: str) -> MaterialTickerList:
Returns:
MaterialModelList: List of Materials as List[MaterialModel]
"""
(status, data) = self._adapter._do(
http_method="get",
(status, data) = self._adapter.get(
endpoint=self._adapter.urls.material_get_category(
category_name=category_name
),
Expand Down

0 comments on commit 28e66ad

Please sign in to comment.