Skip to content

Commit 1566ff0

Browse files
committed
pluralize ApiKeyModule, ApiKey and AsyncApiKey
1 parent 6622211 commit 1566ff0

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

workos/_base_client.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
from abc import abstractmethod
21
import os
2+
from abc import abstractmethod
33
from typing import Optional
4-
from workos.__about__ import __version__
4+
55
from workos._client_configuration import ClientConfiguration
6-
from workos.fga import FGAModule
7-
from workos.utils._base_http_client import DEFAULT_REQUEST_TIMEOUT
8-
from workos.utils.http_client import HTTPClient
9-
from workos.api_key import ApiKeyModule
6+
from workos.api_keys import ApiKeysModule
107
from workos.audit_logs import AuditLogsModule
118
from workos.directory_sync import DirectorySyncModule
129
from workos.events import EventsModule
10+
from workos.fga import FGAModule
1311
from workos.mfa import MFAModule
14-
from workos.organizations import OrganizationsModule
1512
from workos.organization_domains import OrganizationDomainsModule
13+
from workos.organizations import OrganizationsModule
1614
from workos.passwordless import PasswordlessModule
1715
from workos.portal import PortalModule
1816
from workos.sso import SSOModule
1917
from workos.user_management import UserManagementModule
18+
from workos.utils._base_http_client import DEFAULT_REQUEST_TIMEOUT
2019
from workos.webhooks import WebhooksModule
2120

2221

@@ -68,7 +67,7 @@ def __init__(
6867

6968
@property
7069
@abstractmethod
71-
def api_keys(self) -> ApiKeyModule: ...
70+
def api_keys(self) -> ApiKeysModule: ...
7271

7372
@property
7473
@abstractmethod

workos/api_keys.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from workos.utils.request_helper import REQUEST_METHOD_POST
77

88

9-
class ApiKeyModule(Protocol):
9+
10+
class ApiKeysModule(Protocol):
1011
def validate_api_key(self) -> SyncOrAsync[ApiKey]:
1112
"""Validates the configured API key.
1213
@@ -24,7 +25,7 @@ def validate_api_key(self) -> SyncOrAsync[ApiKey]:
2425
...
2526

2627

27-
class ApiKey(ApiKeyModule):
28+
class ApiKeys(ApiKeysModule):
2829
_http_client: SyncHTTPClient
2930

3031
def __init__(self, http_client: SyncHTTPClient):
@@ -39,7 +40,7 @@ def validate_api_key(self) -> ApiKey:
3940
return ApiKey.model_validate(response)
4041

4142

42-
class AsyncApiKey(ApiKeyModule):
43+
class AsyncApiKeys(ApiKeysModule):
4344
_http_client: AsyncHTTPClient
4445

4546
def __init__(self, http_client: AsyncHTTPClient):

workos/async_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Optional
22
from workos.__about__ import __version__
33
from workos._base_client import BaseClient
4-
from workos.api_key import AsyncApiKey
4+
from workos.api_keys import AsyncApiKeys
55
from workos.audit_logs import AuditLogsModule
66
from workos.directory_sync import AsyncDirectorySync
77
from workos.events import AsyncEvents
@@ -47,9 +47,9 @@ def __init__(
4747
)
4848

4949
@property
50-
def api_keys(self) -> AsyncApiKey:
50+
def api_keys(self) -> AsyncApiKeys:
5151
if not getattr(self, "_api_keys", None):
52-
self._api_keys = AsyncApiKey(self._http_client)
52+
self._api_keys = AsyncApiKeys(self._http_client)
5353
return self._api_keys
5454

5555
@property

workos/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Optional
22
from workos.__about__ import __version__
33
from workos._base_client import BaseClient
4-
from workos.api_key import ApiKey
4+
from workos.api_keys import ApiKeys
55
from workos.audit_logs import AuditLogs
66
from workos.directory_sync import DirectorySync
77
from workos.fga import FGA
@@ -47,9 +47,9 @@ def __init__(
4747
)
4848

4949
@property
50-
def api_keys(self) -> ApiKey:
50+
def api_keys(self) -> ApiKeys:
5151
if not getattr(self, "_api_keys", None):
52-
self._api_keys = ApiKey(self._http_client)
52+
self._api_keys = ApiKeys(self._http_client)
5353
return self._api_keys
5454

5555
@property

0 commit comments

Comments
 (0)