Skip to content

Commit 33d1d01

Browse files
feat(api): api update
1 parent 36916ac commit 33d1d01

69 files changed

Lines changed: 6073 additions & 14 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 240
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-66f110677cd924205b0a4e2a1f567c8b56349ee9658bd0ce86561a413a2aabfe.yml
3-
openapi_spec_hash: ab8f320a7a6b2d30d5f1665b8a8bf84e
4-
config_hash: 425042cc0e99cf31866f6c98fef2be27
1+
configured_endpoints: 262
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-afacc4343d0efc074c8c5667eb83570642c8b9acaa7792ca8e075c6d18ef9f3a.yml
3+
openapi_spec_hash: a62a557c61532681963fd21e748b0eb4
4+
config_hash: bb69d8d0771dbac4a84fc6dca11e3ceb

‎api.md‎

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

‎src/openai/resources/admin/organization/__init__.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
OrganizationWithStreamingResponse,
7373
AsyncOrganizationWithStreamingResponse,
7474
)
75+
from .spend_alerts import (
76+
SpendAlerts,
77+
AsyncSpendAlerts,
78+
SpendAlertsWithRawResponse,
79+
AsyncSpendAlertsWithRawResponse,
80+
SpendAlertsWithStreamingResponse,
81+
AsyncSpendAlertsWithStreamingResponse,
82+
)
7583
from .admin_api_keys import (
7684
AdminAPIKeys,
7785
AsyncAdminAPIKeys,
@@ -80,6 +88,14 @@
8088
AdminAPIKeysWithStreamingResponse,
8189
AsyncAdminAPIKeysWithStreamingResponse,
8290
)
91+
from .data_retention import (
92+
DataRetention,
93+
AsyncDataRetention,
94+
DataRetentionWithRawResponse,
95+
AsyncDataRetentionWithRawResponse,
96+
DataRetentionWithStreamingResponse,
97+
AsyncDataRetentionWithStreamingResponse,
98+
)
8399

84100
__all__ = [
85101
"AuditLogs",
@@ -124,6 +140,18 @@
124140
"AsyncRolesWithRawResponse",
125141
"RolesWithStreamingResponse",
126142
"AsyncRolesWithStreamingResponse",
143+
"DataRetention",
144+
"AsyncDataRetention",
145+
"DataRetentionWithRawResponse",
146+
"AsyncDataRetentionWithRawResponse",
147+
"DataRetentionWithStreamingResponse",
148+
"AsyncDataRetentionWithStreamingResponse",
149+
"SpendAlerts",
150+
"AsyncSpendAlerts",
151+
"SpendAlertsWithRawResponse",
152+
"AsyncSpendAlertsWithRawResponse",
153+
"SpendAlertsWithStreamingResponse",
154+
"AsyncSpendAlertsWithStreamingResponse",
127155
"Certificates",
128156
"AsyncCertificates",
129157
"CertificatesWithRawResponse",
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal
6+
7+
import httpx
8+
9+
from .... import _legacy_response
10+
from ...._types import Body, Query, Headers, NotGiven, not_given
11+
from ...._utils import maybe_transform, async_maybe_transform
12+
from ...._compat import cached_property
13+
from ...._resource import SyncAPIResource, AsyncAPIResource
14+
from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
15+
from ...._base_client import make_request_options
16+
from ....types.admin.organization import data_retention_update_params
17+
from ....types.admin.organization.organization_data_retention import OrganizationDataRetention
18+
19+
__all__ = ["DataRetention", "AsyncDataRetention"]
20+
21+
22+
class DataRetention(SyncAPIResource):
23+
@cached_property
24+
def with_raw_response(self) -> DataRetentionWithRawResponse:
25+
"""
26+
This property can be used as a prefix for any HTTP method call to return
27+
the raw response object instead of the parsed content.
28+
29+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
30+
"""
31+
return DataRetentionWithRawResponse(self)
32+
33+
@cached_property
34+
def with_streaming_response(self) -> DataRetentionWithStreamingResponse:
35+
"""
36+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37+
38+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
39+
"""
40+
return DataRetentionWithStreamingResponse(self)
41+
42+
def retrieve(
43+
self,
44+
*,
45+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46+
# The extra values given here take precedence over values defined on the client or passed to this method.
47+
extra_headers: Headers | None = None,
48+
extra_query: Query | None = None,
49+
extra_body: Body | None = None,
50+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
51+
) -> OrganizationDataRetention:
52+
"""Retrieves organization data retention controls."""
53+
return self._get(
54+
"/organization/data_retention",
55+
options=make_request_options(
56+
extra_headers=extra_headers,
57+
extra_query=extra_query,
58+
extra_body=extra_body,
59+
timeout=timeout,
60+
security={"admin_api_key_auth": True},
61+
),
62+
cast_to=OrganizationDataRetention,
63+
)
64+
65+
def update(
66+
self,
67+
*,
68+
retention_type: Literal[
69+
"zero_data_retention",
70+
"modified_abuse_monitoring",
71+
"enhanced_zero_data_retention",
72+
"enhanced_modified_abuse_monitoring",
73+
],
74+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
75+
# The extra values given here take precedence over values defined on the client or passed to this method.
76+
extra_headers: Headers | None = None,
77+
extra_query: Query | None = None,
78+
extra_body: Body | None = None,
79+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
80+
) -> OrganizationDataRetention:
81+
"""
82+
Updates organization data retention controls.
83+
84+
Args:
85+
retention_type: The desired organization data retention type.
86+
87+
extra_headers: Send extra headers
88+
89+
extra_query: Add additional query parameters to the request
90+
91+
extra_body: Add additional JSON properties to the request
92+
93+
timeout: Override the client-level default timeout for this request, in seconds
94+
"""
95+
return self._post(
96+
"/organization/data_retention",
97+
body=maybe_transform(
98+
{"retention_type": retention_type}, data_retention_update_params.DataRetentionUpdateParams
99+
),
100+
options=make_request_options(
101+
extra_headers=extra_headers,
102+
extra_query=extra_query,
103+
extra_body=extra_body,
104+
timeout=timeout,
105+
security={"admin_api_key_auth": True},
106+
),
107+
cast_to=OrganizationDataRetention,
108+
)
109+
110+
111+
class AsyncDataRetention(AsyncAPIResource):
112+
@cached_property
113+
def with_raw_response(self) -> AsyncDataRetentionWithRawResponse:
114+
"""
115+
This property can be used as a prefix for any HTTP method call to return
116+
the raw response object instead of the parsed content.
117+
118+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
119+
"""
120+
return AsyncDataRetentionWithRawResponse(self)
121+
122+
@cached_property
123+
def with_streaming_response(self) -> AsyncDataRetentionWithStreamingResponse:
124+
"""
125+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
126+
127+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
128+
"""
129+
return AsyncDataRetentionWithStreamingResponse(self)
130+
131+
async def retrieve(
132+
self,
133+
*,
134+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135+
# The extra values given here take precedence over values defined on the client or passed to this method.
136+
extra_headers: Headers | None = None,
137+
extra_query: Query | None = None,
138+
extra_body: Body | None = None,
139+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
140+
) -> OrganizationDataRetention:
141+
"""Retrieves organization data retention controls."""
142+
return await self._get(
143+
"/organization/data_retention",
144+
options=make_request_options(
145+
extra_headers=extra_headers,
146+
extra_query=extra_query,
147+
extra_body=extra_body,
148+
timeout=timeout,
149+
security={"admin_api_key_auth": True},
150+
),
151+
cast_to=OrganizationDataRetention,
152+
)
153+
154+
async def update(
155+
self,
156+
*,
157+
retention_type: Literal[
158+
"zero_data_retention",
159+
"modified_abuse_monitoring",
160+
"enhanced_zero_data_retention",
161+
"enhanced_modified_abuse_monitoring",
162+
],
163+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
164+
# The extra values given here take precedence over values defined on the client or passed to this method.
165+
extra_headers: Headers | None = None,
166+
extra_query: Query | None = None,
167+
extra_body: Body | None = None,
168+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
169+
) -> OrganizationDataRetention:
170+
"""
171+
Updates organization data retention controls.
172+
173+
Args:
174+
retention_type: The desired organization data retention type.
175+
176+
extra_headers: Send extra headers
177+
178+
extra_query: Add additional query parameters to the request
179+
180+
extra_body: Add additional JSON properties to the request
181+
182+
timeout: Override the client-level default timeout for this request, in seconds
183+
"""
184+
return await self._post(
185+
"/organization/data_retention",
186+
body=await async_maybe_transform(
187+
{"retention_type": retention_type}, data_retention_update_params.DataRetentionUpdateParams
188+
),
189+
options=make_request_options(
190+
extra_headers=extra_headers,
191+
extra_query=extra_query,
192+
extra_body=extra_body,
193+
timeout=timeout,
194+
security={"admin_api_key_auth": True},
195+
),
196+
cast_to=OrganizationDataRetention,
197+
)
198+
199+
200+
class DataRetentionWithRawResponse:
201+
def __init__(self, data_retention: DataRetention) -> None:
202+
self._data_retention = data_retention
203+
204+
self.retrieve = _legacy_response.to_raw_response_wrapper(
205+
data_retention.retrieve,
206+
)
207+
self.update = _legacy_response.to_raw_response_wrapper(
208+
data_retention.update,
209+
)
210+
211+
212+
class AsyncDataRetentionWithRawResponse:
213+
def __init__(self, data_retention: AsyncDataRetention) -> None:
214+
self._data_retention = data_retention
215+
216+
self.retrieve = _legacy_response.async_to_raw_response_wrapper(
217+
data_retention.retrieve,
218+
)
219+
self.update = _legacy_response.async_to_raw_response_wrapper(
220+
data_retention.update,
221+
)
222+
223+
224+
class DataRetentionWithStreamingResponse:
225+
def __init__(self, data_retention: DataRetention) -> None:
226+
self._data_retention = data_retention
227+
228+
self.retrieve = to_streamed_response_wrapper(
229+
data_retention.retrieve,
230+
)
231+
self.update = to_streamed_response_wrapper(
232+
data_retention.update,
233+
)
234+
235+
236+
class AsyncDataRetentionWithStreamingResponse:
237+
def __init__(self, data_retention: AsyncDataRetention) -> None:
238+
self._data_retention = data_retention
239+
240+
self.retrieve = async_to_streamed_response_wrapper(
241+
data_retention.retrieve,
242+
)
243+
self.update = async_to_streamed_response_wrapper(
244+
data_retention.update,
245+
)

0 commit comments

Comments
 (0)