Skip to content

Commit 41b3aa2

Browse files
feat: [codex] Expose API keys in SDK config
1 parent a1054a6 commit 41b3aa2

12 files changed

Lines changed: 1191 additions & 3 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 112
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-0a186c486b56f555cab374ea5f2adbef2d718b5c9190a48c862f0fdf1232324f.yml
1+
configured_endpoints: 117
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-54d9016df9730e65881df9f694df4f33620b0c032f177849d36ccc426cd42fa8.yml
33
openapi_spec_hash: fad386b8e8712e6639ed9689e9dfc070
4-
config_hash: 5dde8b5de321a7bb96f695a69eb21c23
4+
config_hash: 58396d6c1fafaf72b26596b9117edf48

api.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,22 @@ Methods:
414414
- <code title="get /org/projects/{id}/limits">client.projects.limits.<a href="./src/kernel/resources/projects/limits.py">retrieve</a>(id) -> <a href="./src/kernel/types/projects/project_limits.py">ProjectLimits</a></code>
415415
- <code title="patch /org/projects/{id}/limits">client.projects.limits.<a href="./src/kernel/resources/projects/limits.py">update</a>(id, \*\*<a href="src/kernel/types/projects/limit_update_params.py">params</a>) -> <a href="./src/kernel/types/projects/project_limits.py">ProjectLimits</a></code>
416416

417+
# APIKeys
418+
419+
Types:
420+
421+
```python
422+
from kernel.types import APIKey, CreateAPIKeyRequest, CreatedAPIKey, UpdateAPIKeyRequest
423+
```
424+
425+
Methods:
426+
427+
- <code title="post /org/api_keys">client.api_keys.<a href="./src/kernel/resources/api_keys.py">create</a>(\*\*<a href="src/kernel/types/api_key_create_params.py">params</a>) -> <a href="./src/kernel/types/created_api_key.py">CreatedAPIKey</a></code>
428+
- <code title="get /org/api_keys/{id}">client.api_keys.<a href="./src/kernel/resources/api_keys.py">retrieve</a>(id) -> <a href="./src/kernel/types/api_key.py">APIKey</a></code>
429+
- <code title="patch /org/api_keys/{id}">client.api_keys.<a href="./src/kernel/resources/api_keys.py">update</a>(id, \*\*<a href="src/kernel/types/api_key_update_params.py">params</a>) -> <a href="./src/kernel/types/api_key.py">APIKey</a></code>
430+
- <code title="get /org/api_keys">client.api_keys.<a href="./src/kernel/resources/api_keys.py">list</a>(\*\*<a href="src/kernel/types/api_key_list_params.py">params</a>) -> <a href="./src/kernel/types/api_key.py">SyncOffsetPagination[APIKey]</a></code>
431+
- <code title="delete /org/api_keys/{id}">client.api_keys.<a href="./src/kernel/resources/api_keys.py">delete</a>(id) -> None</code>
432+
417433
# CredentialProviders
418434

419435
Types:

src/kernel/_client.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
apps,
5151
auth,
5252
proxies,
53+
api_keys,
5354
browsers,
5455
profiles,
5556
projects,
@@ -62,6 +63,7 @@
6263
)
6364
from .resources.apps import AppsResource, AsyncAppsResource
6465
from .resources.proxies import ProxiesResource, AsyncProxiesResource
66+
from .resources.api_keys import APIKeysResource, AsyncAPIKeysResource
6567
from .resources.profiles import ProfilesResource, AsyncProfilesResource
6668
from .resources.auth.auth import AuthResource, AsyncAuthResource
6769
from .resources.extensions import ExtensionsResource, AsyncExtensionsResource
@@ -260,6 +262,13 @@ def projects(self) -> ProjectsResource:
260262

261263
return ProjectsResource(self)
262264

265+
@cached_property
266+
def api_keys(self) -> APIKeysResource:
267+
"""Create and manage API keys for organization and project-scoped access."""
268+
from .resources.api_keys import APIKeysResource
269+
270+
return APIKeysResource(self)
271+
263272
@cached_property
264273
def credential_providers(self) -> CredentialProvidersResource:
265274
"""Configure external credential providers like 1Password."""
@@ -584,6 +593,13 @@ def projects(self) -> AsyncProjectsResource:
584593

585594
return AsyncProjectsResource(self)
586595

596+
@cached_property
597+
def api_keys(self) -> AsyncAPIKeysResource:
598+
"""Create and manage API keys for organization and project-scoped access."""
599+
from .resources.api_keys import AsyncAPIKeysResource
600+
601+
return AsyncAPIKeysResource(self)
602+
587603
@cached_property
588604
def credential_providers(self) -> AsyncCredentialProvidersResource:
589605
"""Configure external credential providers like 1Password."""
@@ -821,6 +837,13 @@ def projects(self) -> projects.ProjectsResourceWithRawResponse:
821837

822838
return ProjectsResourceWithRawResponse(self._client.projects)
823839

840+
@cached_property
841+
def api_keys(self) -> api_keys.APIKeysResourceWithRawResponse:
842+
"""Create and manage API keys for organization and project-scoped access."""
843+
from .resources.api_keys import APIKeysResourceWithRawResponse
844+
845+
return APIKeysResourceWithRawResponse(self._client.api_keys)
846+
824847
@cached_property
825848
def credential_providers(self) -> credential_providers.CredentialProvidersResourceWithRawResponse:
826849
"""Configure external credential providers like 1Password."""
@@ -911,6 +934,13 @@ def projects(self) -> projects.AsyncProjectsResourceWithRawResponse:
911934

912935
return AsyncProjectsResourceWithRawResponse(self._client.projects)
913936

937+
@cached_property
938+
def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithRawResponse:
939+
"""Create and manage API keys for organization and project-scoped access."""
940+
from .resources.api_keys import AsyncAPIKeysResourceWithRawResponse
941+
942+
return AsyncAPIKeysResourceWithRawResponse(self._client.api_keys)
943+
914944
@cached_property
915945
def credential_providers(self) -> credential_providers.AsyncCredentialProvidersResourceWithRawResponse:
916946
"""Configure external credential providers like 1Password."""
@@ -1001,6 +1031,13 @@ def projects(self) -> projects.ProjectsResourceWithStreamingResponse:
10011031

10021032
return ProjectsResourceWithStreamingResponse(self._client.projects)
10031033

1034+
@cached_property
1035+
def api_keys(self) -> api_keys.APIKeysResourceWithStreamingResponse:
1036+
"""Create and manage API keys for organization and project-scoped access."""
1037+
from .resources.api_keys import APIKeysResourceWithStreamingResponse
1038+
1039+
return APIKeysResourceWithStreamingResponse(self._client.api_keys)
1040+
10041041
@cached_property
10051042
def credential_providers(self) -> credential_providers.CredentialProvidersResourceWithStreamingResponse:
10061043
"""Configure external credential providers like 1Password."""
@@ -1091,6 +1128,13 @@ def projects(self) -> projects.AsyncProjectsResourceWithStreamingResponse:
10911128

10921129
return AsyncProjectsResourceWithStreamingResponse(self._client.projects)
10931130

1131+
@cached_property
1132+
def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithStreamingResponse:
1133+
"""Create and manage API keys for organization and project-scoped access."""
1134+
from .resources.api_keys import AsyncAPIKeysResourceWithStreamingResponse
1135+
1136+
return AsyncAPIKeysResourceWithStreamingResponse(self._client.api_keys)
1137+
10941138
@cached_property
10951139
def credential_providers(self) -> credential_providers.AsyncCredentialProvidersResourceWithStreamingResponse:
10961140
"""Configure external credential providers like 1Password."""

src/kernel/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
ProxiesResourceWithStreamingResponse,
2525
AsyncProxiesResourceWithStreamingResponse,
2626
)
27+
from .api_keys import (
28+
APIKeysResource,
29+
AsyncAPIKeysResource,
30+
APIKeysResourceWithRawResponse,
31+
AsyncAPIKeysResourceWithRawResponse,
32+
APIKeysResourceWithStreamingResponse,
33+
AsyncAPIKeysResourceWithStreamingResponse,
34+
)
2735
from .browsers import (
2836
BrowsersResource,
2937
AsyncBrowsersResource,
@@ -164,6 +172,12 @@
164172
"AsyncProjectsResourceWithRawResponse",
165173
"ProjectsResourceWithStreamingResponse",
166174
"AsyncProjectsResourceWithStreamingResponse",
175+
"APIKeysResource",
176+
"AsyncAPIKeysResource",
177+
"APIKeysResourceWithRawResponse",
178+
"AsyncAPIKeysResourceWithRawResponse",
179+
"APIKeysResourceWithStreamingResponse",
180+
"AsyncAPIKeysResourceWithStreamingResponse",
167181
"CredentialProvidersResource",
168182
"AsyncCredentialProvidersResource",
169183
"CredentialProvidersResourceWithRawResponse",

0 commit comments

Comments
 (0)