Skip to content

Commit 2d232ee

Browse files
feat(api): add external_key_id to projects, email/metadata params to users, update types
1 parent 4ae1138 commit 2d232ee

20 files changed

Lines changed: 317 additions & 101 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 233
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-ea3c8bfb9cc34e798c5a473bb68ab5012344b1c99ab95377d0af4d908eb32a5d.yml
3-
openapi_spec_hash: dbab3fdd7781b449ba3e9e1b5180c6ed
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-9a3e2bb9ea36990c39d7b633e6c10eb63d8918080560640a5b4cdccfac164761.yml
3+
openapi_spec_hash: 0fa82e4dacd57a6d551e79d745860eb8
44
config_hash: 5d8a716125a61761563abbfc0d34e57c

src/openai/resources/admin/organization/projects/projects.py

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Literal
5+
from typing import Optional
66

77
import httpx
88

@@ -128,7 +128,8 @@ def create(
128128
self,
129129
*,
130130
name: str,
131-
geography: Literal["US", "EU", "JP", "IN", "KR", "CA", "AU", "SG"] | Omit = omit,
131+
external_key_id: Optional[str] | Omit = omit,
132+
geography: Optional[str] | Omit = omit,
132133
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
133134
# The extra values given here take precedence over values defined on the client or passed to this method.
134135
extra_headers: Headers | None = None,
@@ -144,6 +145,8 @@ def create(
144145
Args:
145146
name: The friendly name of the project, this name appears in reports.
146147
148+
external_key_id: External key ID to associate with the project.
149+
147150
geography: Create the project with the specified data residency region. Your organization
148151
must have access to Data residency functionality in order to use. See
149152
[data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls)
@@ -162,6 +165,7 @@ def create(
162165
body=maybe_transform(
163166
{
164167
"name": name,
168+
"external_key_id": external_key_id,
165169
"geography": geography,
166170
},
167171
project_create_params.ProjectCreateParams,
@@ -217,7 +221,9 @@ def update(
217221
self,
218222
project_id: str,
219223
*,
220-
name: str,
224+
external_key_id: Optional[str] | Omit = omit,
225+
geography: Optional[str] | Omit = omit,
226+
name: Optional[str] | Omit = omit,
221227
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
222228
# The extra values given here take precedence over values defined on the client or passed to this method.
223229
extra_headers: Headers | None = None,
@@ -229,6 +235,10 @@ def update(
229235
Modifies a project in the organization.
230236
231237
Args:
238+
external_key_id: External key ID to associate with the project.
239+
240+
geography: Geography for the project.
241+
232242
name: The updated name of the project, this name appears in reports.
233243
234244
extra_headers: Send extra headers
@@ -243,7 +253,14 @@ def update(
243253
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
244254
return self._post(
245255
path_template("/organization/projects/{project_id}", project_id=project_id),
246-
body=maybe_transform({"name": name}, project_update_params.ProjectUpdateParams),
256+
body=maybe_transform(
257+
{
258+
"external_key_id": external_key_id,
259+
"geography": geography,
260+
"name": name,
261+
},
262+
project_update_params.ProjectUpdateParams,
263+
),
247264
options=make_request_options(
248265
extra_headers=extra_headers,
249266
extra_query=extra_query,
@@ -404,7 +421,8 @@ async def create(
404421
self,
405422
*,
406423
name: str,
407-
geography: Literal["US", "EU", "JP", "IN", "KR", "CA", "AU", "SG"] | Omit = omit,
424+
external_key_id: Optional[str] | Omit = omit,
425+
geography: Optional[str] | Omit = omit,
408426
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
409427
# The extra values given here take precedence over values defined on the client or passed to this method.
410428
extra_headers: Headers | None = None,
@@ -420,6 +438,8 @@ async def create(
420438
Args:
421439
name: The friendly name of the project, this name appears in reports.
422440
441+
external_key_id: External key ID to associate with the project.
442+
423443
geography: Create the project with the specified data residency region. Your organization
424444
must have access to Data residency functionality in order to use. See
425445
[data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls)
@@ -438,6 +458,7 @@ async def create(
438458
body=await async_maybe_transform(
439459
{
440460
"name": name,
461+
"external_key_id": external_key_id,
441462
"geography": geography,
442463
},
443464
project_create_params.ProjectCreateParams,
@@ -493,7 +514,9 @@ async def update(
493514
self,
494515
project_id: str,
495516
*,
496-
name: str,
517+
external_key_id: Optional[str] | Omit = omit,
518+
geography: Optional[str] | Omit = omit,
519+
name: Optional[str] | Omit = omit,
497520
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
498521
# The extra values given here take precedence over values defined on the client or passed to this method.
499522
extra_headers: Headers | None = None,
@@ -505,6 +528,10 @@ async def update(
505528
Modifies a project in the organization.
506529
507530
Args:
531+
external_key_id: External key ID to associate with the project.
532+
533+
geography: Geography for the project.
534+
508535
name: The updated name of the project, this name appears in reports.
509536
510537
extra_headers: Send extra headers
@@ -519,7 +546,14 @@ async def update(
519546
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
520547
return await self._post(
521548
path_template("/organization/projects/{project_id}", project_id=project_id),
522-
body=await async_maybe_transform({"name": name}, project_update_params.ProjectUpdateParams),
549+
body=await async_maybe_transform(
550+
{
551+
"external_key_id": external_key_id,
552+
"geography": geography,
553+
"name": name,
554+
},
555+
project_update_params.ProjectUpdateParams,
556+
),
523557
options=make_request_options(
524558
extra_headers=extra_headers,
525559
extra_query=extra_query,

src/openai/resources/admin/organization/projects/users/users.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Literal
5+
from typing import Optional
66

77
import httpx
88

@@ -57,8 +57,9 @@ def create(
5757
self,
5858
project_id: str,
5959
*,
60-
role: Literal["owner", "member"],
61-
user_id: str,
60+
role: str,
61+
email: Optional[str] | Omit = omit,
62+
user_id: Optional[str] | Omit = omit,
6263
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6364
# The extra values given here take precedence over values defined on the client or passed to this method.
6465
extra_headers: Headers | None = None,
@@ -74,6 +75,8 @@ def create(
7475
Args:
7576
role: `owner` or `member`
7677
78+
email: Email of the user to add.
79+
7780
user_id: The ID of the user.
7881
7982
extra_headers: Send extra headers
@@ -91,6 +94,7 @@ def create(
9194
body=maybe_transform(
9295
{
9396
"role": role,
97+
"email": email,
9498
"user_id": user_id,
9599
},
96100
user_create_params.UserCreateParams,
@@ -152,7 +156,7 @@ def update(
152156
user_id: str,
153157
*,
154158
project_id: str,
155-
role: Literal["owner", "member"],
159+
role: Optional[str] | Omit = omit,
156160
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157161
# The extra values given here take precedence over values defined on the client or passed to this method.
158162
extra_headers: Headers | None = None,
@@ -322,8 +326,9 @@ async def create(
322326
self,
323327
project_id: str,
324328
*,
325-
role: Literal["owner", "member"],
326-
user_id: str,
329+
role: str,
330+
email: Optional[str] | Omit = omit,
331+
user_id: Optional[str] | Omit = omit,
327332
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
328333
# The extra values given here take precedence over values defined on the client or passed to this method.
329334
extra_headers: Headers | None = None,
@@ -339,6 +344,8 @@ async def create(
339344
Args:
340345
role: `owner` or `member`
341346
347+
email: Email of the user to add.
348+
342349
user_id: The ID of the user.
343350
344351
extra_headers: Send extra headers
@@ -356,6 +363,7 @@ async def create(
356363
body=await async_maybe_transform(
357364
{
358365
"role": role,
366+
"email": email,
359367
"user_id": user_id,
360368
},
361369
user_create_params.UserCreateParams,
@@ -417,7 +425,7 @@ async def update(
417425
user_id: str,
418426
*,
419427
project_id: str,
420-
role: Literal["owner", "member"],
428+
role: Optional[str] | Omit = omit,
421429
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
422430
# The extra values given here take precedence over values defined on the client or passed to this method.
423431
extra_headers: Headers | None = None,

src/openai/resources/admin/organization/users/users.py

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Literal
5+
from typing import Optional
66

77
import httpx
88

@@ -94,7 +94,10 @@ def update(
9494
self,
9595
user_id: str,
9696
*,
97-
role: Literal["owner", "reader"] | Omit = omit,
97+
developer_persona: Optional[str] | Omit = omit,
98+
role: Optional[str] | Omit = omit,
99+
role_id: Optional[str] | Omit = omit,
100+
technical_level: Optional[str] | Omit = omit,
98101
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99102
# The extra values given here take precedence over values defined on the client or passed to this method.
100103
extra_headers: Headers | None = None,
@@ -106,8 +109,14 @@ def update(
106109
Modifies a user's role in the organization.
107110
108111
Args:
112+
developer_persona: Developer persona metadata.
113+
109114
role: `owner` or `reader`
110115
116+
role_id: Role ID to assign to the user.
117+
118+
technical_level: Technical level metadata.
119+
111120
extra_headers: Send extra headers
112121
113122
extra_query: Add additional query parameters to the request
@@ -120,7 +129,15 @@ def update(
120129
raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
121130
return self._post(
122131
path_template("/organization/users/{user_id}", user_id=user_id),
123-
body=maybe_transform({"role": role}, user_update_params.UserUpdateParams),
132+
body=maybe_transform(
133+
{
134+
"developer_persona": developer_persona,
135+
"role": role,
136+
"role_id": role_id,
137+
"technical_level": technical_level,
138+
},
139+
user_update_params.UserUpdateParams,
140+
),
124141
options=make_request_options(
125142
extra_headers=extra_headers,
126143
extra_query=extra_query,
@@ -290,7 +307,10 @@ async def update(
290307
self,
291308
user_id: str,
292309
*,
293-
role: Literal["owner", "reader"] | Omit = omit,
310+
developer_persona: Optional[str] | Omit = omit,
311+
role: Optional[str] | Omit = omit,
312+
role_id: Optional[str] | Omit = omit,
313+
technical_level: Optional[str] | Omit = omit,
294314
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
295315
# The extra values given here take precedence over values defined on the client or passed to this method.
296316
extra_headers: Headers | None = None,
@@ -302,8 +322,14 @@ async def update(
302322
Modifies a user's role in the organization.
303323
304324
Args:
325+
developer_persona: Developer persona metadata.
326+
305327
role: `owner` or `reader`
306328
329+
role_id: Role ID to assign to the user.
330+
331+
technical_level: Technical level metadata.
332+
307333
extra_headers: Send extra headers
308334
309335
extra_query: Add additional query parameters to the request
@@ -316,7 +342,15 @@ async def update(
316342
raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
317343
return await self._post(
318344
path_template("/organization/users/{user_id}", user_id=user_id),
319-
body=await async_maybe_transform({"role": role}, user_update_params.UserUpdateParams),
345+
body=await async_maybe_transform(
346+
{
347+
"developer_persona": developer_persona,
348+
"role": role,
349+
"role_id": role_id,
350+
"technical_level": technical_level,
351+
},
352+
user_update_params.UserUpdateParams,
353+
),
320354
options=make_request_options(
321355
extra_headers=extra_headers,
322356
extra_query=extra_query,

src/openai/types/admin/organization/admin_api_key.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ class AdminAPIKey(BaseModel):
3737
created_at: int
3838
"""The Unix timestamp (in seconds) of when the API key was created"""
3939

40-
last_used_at: Optional[int] = None
41-
"""The Unix timestamp (in seconds) of when the API key was last used"""
42-
43-
name: str
44-
"""The name of the API key"""
45-
4640
object: Literal["organization.admin_api_key"]
4741
"""The object type, which is always `organization.admin_api_key`"""
4842

@@ -51,5 +45,8 @@ class AdminAPIKey(BaseModel):
5145
redacted_value: str
5246
"""The redacted value of the API key"""
5347

54-
value: Optional[str] = None
55-
"""The value of the API key. Only shown on create."""
48+
last_used_at: Optional[int] = None
49+
"""The Unix timestamp (in seconds) of when the API key was last used"""
50+
51+
name: Optional[str] = None
52+
"""The name of the API key"""

src/openai/types/admin/organization/admin_api_key_create_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
class AdminAPIKeyCreateResponse(AdminAPIKey):
99
"""Represents an individual Admin API key in an org."""
1010

11-
value: str # type: ignore
11+
value: str
1212
"""The value of the API key. Only shown on create."""

src/openai/types/admin/organization/group.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class Group(BaseModel):
1414
created_at: int
1515
"""Unix timestamp (in seconds) when the group was created."""
1616

17+
group_type: str
18+
"""The type of the group."""
19+
1720
is_scim_managed: bool
1821
"""
1922
Whether the group is managed through SCIM and controlled by your identity

0 commit comments

Comments
 (0)