enpi_api.l2.client.api.whoami_api
1from enpi_api.l1 import openapi_client 2from enpi_api.l2.types.api_error import ApiError 3from enpi_api.l2.types.log import LogLevel 4from enpi_api.l2.types.whoami import Whoami 5 6 7class WhoamiApi: 8 _inner_api_client: openapi_client.ApiClient 9 _log_level: LogLevel 10 11 def __init__(self, inner_api_client: openapi_client.ApiClient, log_level: LogLevel): 12 """@private""" 13 self._inner_api_client = inner_api_client 14 self._log_level = log_level 15 16 def whoami(self) -> Whoami: 17 """Get information about the current key and who it is assigned to. 18 19 Returns: 20 enpi_api.l2.types.whoami.Whoami: Information about the current API key, and information about the user and 21 organization it is assigned to. 22 """ 23 whoami_api_instance = openapi_client.WhoamiApi(self._inner_api_client) 24 25 try: 26 response = whoami_api_instance.whoami() 27 except openapi_client.ApiException as e: 28 raise ApiError(e) 29 30 return Whoami.from_raw(response)
class
WhoamiApi:
8class WhoamiApi: 9 _inner_api_client: openapi_client.ApiClient 10 _log_level: LogLevel 11 12 def __init__(self, inner_api_client: openapi_client.ApiClient, log_level: LogLevel): 13 """@private""" 14 self._inner_api_client = inner_api_client 15 self._log_level = log_level 16 17 def whoami(self) -> Whoami: 18 """Get information about the current key and who it is assigned to. 19 20 Returns: 21 enpi_api.l2.types.whoami.Whoami: Information about the current API key, and information about the user and 22 organization it is assigned to. 23 """ 24 whoami_api_instance = openapi_client.WhoamiApi(self._inner_api_client) 25 26 try: 27 response = whoami_api_instance.whoami() 28 except openapi_client.ApiException as e: 29 raise ApiError(e) 30 31 return Whoami.from_raw(response)
17 def whoami(self) -> Whoami: 18 """Get information about the current key and who it is assigned to. 19 20 Returns: 21 enpi_api.l2.types.whoami.Whoami: Information about the current API key, and information about the user and 22 organization it is assigned to. 23 """ 24 whoami_api_instance = openapi_client.WhoamiApi(self._inner_api_client) 25 26 try: 27 response = whoami_api_instance.whoami() 28 except openapi_client.ApiException as e: 29 raise ApiError(e) 30 31 return Whoami.from_raw(response)
Get information about the current key and who it is assigned to.
Returns:
enpi_api.l2.types.whoami.Whoami: Information about the current API key, and information about the user and organization it is assigned to.