fix(client): include ability to getitem for sync client

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
Aaron
2023-11-26 18:48:01 -05:00
parent 739eff3d21
commit 7bb53a7aa4

View File

@@ -46,6 +46,13 @@ class HTTPClient(Client):
return {'Authorization': f'Bearer {env}'}
return super()._build_auth_headers()
def __getitem__(self, item):
if hasattr(self._metadata, item):
return getattr(self._metadata, item)
elif item in self._config:
return self._config[item]
raise KeyError(f'No attributes: {item}')
@property
def _metadata(self):
if self.__metadata is None: