@@ -59,7 +59,7 @@ async def get_orders(self, **kwargs) -> ApiResponse:
5959 normalize_csv_param (kwargs , "AmazonOrderIds" )
6060
6161 if "RestrictedResources" in kwargs :
62- return self ._access_restricted (kwargs )
62+ return await self ._access_restricted (kwargs )
6363 return await self ._request (kwargs .pop ("path" ), params = {** kwargs })
6464
6565 @sp_endpoint ("/orders/v0/orders/{}" )
@@ -98,7 +98,7 @@ async def get_order(self, order_id: str, **kwargs) -> ApiResponse:
9898 kwargs .update (
9999 {"original_path" : fill_query_params (kwargs .get ("path" ), order_id )}
100100 )
101- return self ._access_restricted (kwargs )
101+ return await self ._access_restricted (kwargs )
102102 return await self ._request (
103103 fill_query_params (kwargs .pop ("path" ), order_id ),
104104 params = {** kwargs },
@@ -151,7 +151,7 @@ async def get_order_items(self, order_id: str, **kwargs) -> ApiResponse:
151151 kwargs .update (
152152 {"original_path" : fill_query_params (kwargs .get ("path" ), order_id )}
153153 )
154- return self ._access_restricted (kwargs )
154+ return await self ._access_restricted (kwargs )
155155 return await self ._request (
156156 fill_query_params (kwargs .pop ("path" ), order_id ), params = {** kwargs }
157157 )
@@ -352,7 +352,7 @@ async def _get_token(self, **kwargs):
352352 async def _access_restricted (self , kwargs ):
353353 if "original_path" not in kwargs :
354354 kwargs .update ({"original_path" : kwargs ["path" ]})
355- token = self ._get_token (** kwargs ).payload
355+ token = ( await self ._get_token (** kwargs ) ).payload
356356 self .restricted_data_token = token ["restrictedDataToken" ]
357357 r = await self ._request (kwargs .pop ("original_path" ), params = {** kwargs })
358358 if not self .keep_restricted_data_token :
0 commit comments