File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ def test_client_with_api_key_and_client_id_environment_variables(self):
3737 os .environ .pop ("WORKOS_API_KEY" )
3838 os .environ .pop ("WORKOS_CLIENT_ID" )
3939
40+ def test_initialize_api_keys (self , default_client ):
41+ assert bool (default_client .api_keys )
42+
4043 def test_initialize_sso (self , default_client ):
4144 assert bool (default_client .sso )
4245
@@ -112,6 +115,9 @@ def test_client_with_api_key_and_client_id_environment_variables(self):
112115 os .environ .pop ("WORKOS_API_KEY" )
113116 os .environ .pop ("WORKOS_CLIENT_ID" )
114117
118+ def test_initialize_api_keys (self , default_client ):
119+ assert bool (default_client .api_keys )
120+
115121 def test_initialize_directory_sync (self , default_client ):
116122 assert bool (default_client .directory_sync )
117123
Original file line number Diff line number Diff line change 66from workos .fga import FGAModule
77from workos .utils ._base_http_client import DEFAULT_REQUEST_TIMEOUT
88from workos .utils .http_client import HTTPClient
9+ from workos .api_key import ApiKeyModule
910from workos .audit_logs import AuditLogsModule
1011from workos .directory_sync import DirectorySyncModule
1112from workos .events import EventsModule
@@ -65,6 +66,10 @@ def __init__(
6566 else int (os .getenv ("WORKOS_REQUEST_TIMEOUT" , DEFAULT_REQUEST_TIMEOUT ))
6667 )
6768
69+ @property
70+ @abstractmethod
71+ def api_keys (self ) -> ApiKeyModule : ...
72+
6873 @property
6974 @abstractmethod
7075 def audit_logs (self ) -> AuditLogsModule : ...
Original file line number Diff line number Diff line change 11from typing import Optional
22from workos .__about__ import __version__
33from workos ._base_client import BaseClient
4+ from workos .api_key import AsyncApiKey
45from workos .audit_logs import AuditLogsModule
56from workos .directory_sync import AsyncDirectorySync
67from workos .events import AsyncEvents
@@ -45,6 +46,12 @@ def __init__(
4546 timeout = self .request_timeout ,
4647 )
4748
49+ @property
50+ def api_keys (self ) -> AsyncApiKey :
51+ if not getattr (self , "_api_keys" , None ):
52+ self ._api_keys = AsyncApiKey (self ._http_client )
53+ return self ._api_keys
54+
4855 @property
4956 def sso (self ) -> AsyncSSO :
5057 if not getattr (self , "_sso" , None ):
Original file line number Diff line number Diff line change 11from typing import Optional
22from workos .__about__ import __version__
33from workos ._base_client import BaseClient
4+ from workos .api_key import ApiKey
45from workos .audit_logs import AuditLogs
56from workos .directory_sync import DirectorySync
67from workos .fga import FGA
@@ -45,6 +46,12 @@ def __init__(
4546 timeout = self .request_timeout ,
4647 )
4748
49+ @property
50+ def api_keys (self ) -> ApiKey :
51+ if not getattr (self , "_api_keys" , None ):
52+ self ._api_keys = ApiKey (self ._http_client )
53+ return self ._api_keys
54+
4855 @property
4956 def sso (self ) -> SSO :
5057 if not getattr (self , "_sso" , None ):
You can’t perform that action at this time.
0 commit comments