Skip to content

Commit 1bb1668

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1095)
1 parent bbc5c47 commit 1bb1668

File tree

11 files changed

+5
-991
lines changed

11 files changed

+5
-991
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1356
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-62c3b16f6d836d9cc7bca2f54e83f7ed99fbe325b4b6cfec72a71fc7ceee58a6.yml
1+
configured_endpoints: 1353
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e79cc9a74089de5aec2c720b1e3023ea27869883f43c8b0167198f5967128636.yml

api.md

+1-26
Original file line numberDiff line numberDiff line change
@@ -7886,37 +7886,12 @@ Methods:
78867886
Types:
78877887

78887888
```python
7889-
from cloudflare.types.ai_gateway import LogListResponse, LogGetResponse
7889+
from cloudflare.types.ai_gateway import LogListResponse
78907890
```
78917891

78927892
Methods:
78937893

78947894
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs">client.ai_gateway.logs.<a href="./src/cloudflare/resources/ai_gateway/logs/logs.py">list</a>(id, \*, account_id, \*\*<a href="src/cloudflare/types/ai_gateway/log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/ai_gateway/log_list_response.py">SyncV4PagePaginationArray[LogListResponse]</a></code>
7895-
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs/{logId}">client.ai_gateway.logs.<a href="./src/cloudflare/resources/ai_gateway/logs/logs.py">get</a>(log_id, \*, account_id, id) -> <a href="./src/cloudflare/types/ai_gateway/log_get_response.py">LogGetResponse</a></code>
7896-
7897-
### Request
7898-
7899-
Types:
7900-
7901-
```python
7902-
from cloudflare.types.ai_gateway.logs import RequestGetResponse
7903-
```
7904-
7905-
Methods:
7906-
7907-
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs/{logId}/request">client.ai_gateway.logs.request.<a href="./src/cloudflare/resources/ai_gateway/logs/request.py">get</a>(log_id, \*, account_id, id) -> <a href="./src/cloudflare/types/ai_gateway/logs/request_get_response.py">object</a></code>
7908-
7909-
### Response
7910-
7911-
Types:
7912-
7913-
```python
7914-
from cloudflare.types.ai_gateway.logs import ResponseGetResponse
7915-
```
7916-
7917-
Methods:
7918-
7919-
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs/{logId}/response">client.ai_gateway.logs.response.<a href="./src/cloudflare/resources/ai_gateway/logs/response.py">get</a>(log_id, \*, account_id, id) -> <a href="./src/cloudflare/types/ai_gateway/logs/response_get_response.py">object</a></code>
79207895

79217896
# IAM
79227897

src/cloudflare/resources/ai_gateway/logs/__init__.py

-28
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,8 @@
88
LogsResourceWithStreamingResponse,
99
AsyncLogsResourceWithStreamingResponse,
1010
)
11-
from .request import (
12-
RequestResource,
13-
AsyncRequestResource,
14-
RequestResourceWithRawResponse,
15-
AsyncRequestResourceWithRawResponse,
16-
RequestResourceWithStreamingResponse,
17-
AsyncRequestResourceWithStreamingResponse,
18-
)
19-
from .response import (
20-
ResponseResource,
21-
AsyncResponseResource,
22-
ResponseResourceWithRawResponse,
23-
AsyncResponseResourceWithRawResponse,
24-
ResponseResourceWithStreamingResponse,
25-
AsyncResponseResourceWithStreamingResponse,
26-
)
2711

2812
__all__ = [
29-
"RequestResource",
30-
"AsyncRequestResource",
31-
"RequestResourceWithRawResponse",
32-
"AsyncRequestResourceWithRawResponse",
33-
"RequestResourceWithStreamingResponse",
34-
"AsyncRequestResourceWithStreamingResponse",
35-
"ResponseResource",
36-
"AsyncResponseResource",
37-
"ResponseResourceWithRawResponse",
38-
"AsyncResponseResourceWithRawResponse",
39-
"ResponseResourceWithStreamingResponse",
40-
"AsyncResponseResourceWithStreamingResponse",
4113
"LogsResource",
4214
"AsyncLogsResource",
4315
"LogsResourceWithRawResponse",

src/cloudflare/resources/ai_gateway/logs/logs.py

+1-169
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,12 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Union, cast
5+
from typing import Union
66
from datetime import datetime
77
from typing_extensions import Literal
88

99
import httpx
1010

11-
from .request import (
12-
RequestResource,
13-
AsyncRequestResource,
14-
RequestResourceWithRawResponse,
15-
AsyncRequestResourceWithRawResponse,
16-
RequestResourceWithStreamingResponse,
17-
AsyncRequestResourceWithStreamingResponse,
18-
)
19-
from .response import (
20-
ResponseResource,
21-
AsyncResponseResource,
22-
ResponseResourceWithRawResponse,
23-
AsyncResponseResourceWithRawResponse,
24-
ResponseResourceWithStreamingResponse,
25-
AsyncResponseResourceWithStreamingResponse,
26-
)
2711
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
2812
from ...._utils import maybe_transform
2913
from ...._compat import cached_property
@@ -34,28 +18,18 @@
3418
async_to_raw_response_wrapper,
3519
async_to_streamed_response_wrapper,
3620
)
37-
from ...._wrappers import ResultWrapper
3821
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
3922
from ...._base_client import (
4023
AsyncPaginator,
4124
make_request_options,
4225
)
4326
from ....types.ai_gateway import log_list_params
44-
from ....types.ai_gateway.log_get_response import LogGetResponse
4527
from ....types.ai_gateway.log_list_response import LogListResponse
4628

4729
__all__ = ["LogsResource", "AsyncLogsResource"]
4830

4931

5032
class LogsResource(SyncAPIResource):
51-
@cached_property
52-
def request(self) -> RequestResource:
53-
return RequestResource(self._client)
54-
55-
@cached_property
56-
def response(self) -> ResponseResource:
57-
return ResponseResource(self._client)
58-
5933
@cached_property
6034
def with_raw_response(self) -> LogsResourceWithRawResponse:
6135
return LogsResourceWithRawResponse(self)
@@ -129,61 +103,8 @@ def list(
129103
model=LogListResponse,
130104
)
131105

132-
def get(
133-
self,
134-
log_id: str,
135-
*,
136-
account_id: str,
137-
id: str,
138-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
139-
# The extra values given here take precedence over values defined on the client or passed to this method.
140-
extra_headers: Headers | None = None,
141-
extra_query: Query | None = None,
142-
extra_body: Body | None = None,
143-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
144-
) -> LogGetResponse:
145-
"""
146-
Get Gateway Log Detail
147-
148-
Args:
149-
id: gateway id
150-
151-
extra_headers: Send extra headers
152-
153-
extra_query: Add additional query parameters to the request
154-
155-
extra_body: Add additional JSON properties to the request
156-
157-
timeout: Override the client-level default timeout for this request, in seconds
158-
"""
159-
if not account_id:
160-
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
161-
if not id:
162-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
163-
if not log_id:
164-
raise ValueError(f"Expected a non-empty value for `log_id` but received {log_id!r}")
165-
return self._get(
166-
f"/accounts/{account_id}/ai-gateway/gateways/{id}/logs/{log_id}",
167-
options=make_request_options(
168-
extra_headers=extra_headers,
169-
extra_query=extra_query,
170-
extra_body=extra_body,
171-
timeout=timeout,
172-
post_parser=ResultWrapper[LogGetResponse]._unwrapper,
173-
),
174-
cast_to=cast(Type[LogGetResponse], ResultWrapper[LogGetResponse]),
175-
)
176-
177106

178107
class AsyncLogsResource(AsyncAPIResource):
179-
@cached_property
180-
def request(self) -> AsyncRequestResource:
181-
return AsyncRequestResource(self._client)
182-
183-
@cached_property
184-
def response(self) -> AsyncResponseResource:
185-
return AsyncResponseResource(self._client)
186-
187108
@cached_property
188109
def with_raw_response(self) -> AsyncLogsResourceWithRawResponse:
189110
return AsyncLogsResourceWithRawResponse(self)
@@ -257,51 +178,6 @@ def list(
257178
model=LogListResponse,
258179
)
259180

260-
async def get(
261-
self,
262-
log_id: str,
263-
*,
264-
account_id: str,
265-
id: str,
266-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
267-
# The extra values given here take precedence over values defined on the client or passed to this method.
268-
extra_headers: Headers | None = None,
269-
extra_query: Query | None = None,
270-
extra_body: Body | None = None,
271-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
272-
) -> LogGetResponse:
273-
"""
274-
Get Gateway Log Detail
275-
276-
Args:
277-
id: gateway id
278-
279-
extra_headers: Send extra headers
280-
281-
extra_query: Add additional query parameters to the request
282-
283-
extra_body: Add additional JSON properties to the request
284-
285-
timeout: Override the client-level default timeout for this request, in seconds
286-
"""
287-
if not account_id:
288-
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
289-
if not id:
290-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
291-
if not log_id:
292-
raise ValueError(f"Expected a non-empty value for `log_id` but received {log_id!r}")
293-
return await self._get(
294-
f"/accounts/{account_id}/ai-gateway/gateways/{id}/logs/{log_id}",
295-
options=make_request_options(
296-
extra_headers=extra_headers,
297-
extra_query=extra_query,
298-
extra_body=extra_body,
299-
timeout=timeout,
300-
post_parser=ResultWrapper[LogGetResponse]._unwrapper,
301-
),
302-
cast_to=cast(Type[LogGetResponse], ResultWrapper[LogGetResponse]),
303-
)
304-
305181

306182
class LogsResourceWithRawResponse:
307183
def __init__(self, logs: LogsResource) -> None:
@@ -310,17 +186,6 @@ def __init__(self, logs: LogsResource) -> None:
310186
self.list = to_raw_response_wrapper(
311187
logs.list,
312188
)
313-
self.get = to_raw_response_wrapper(
314-
logs.get,
315-
)
316-
317-
@cached_property
318-
def request(self) -> RequestResourceWithRawResponse:
319-
return RequestResourceWithRawResponse(self._logs.request)
320-
321-
@cached_property
322-
def response(self) -> ResponseResourceWithRawResponse:
323-
return ResponseResourceWithRawResponse(self._logs.response)
324189

325190

326191
class AsyncLogsResourceWithRawResponse:
@@ -330,17 +195,6 @@ def __init__(self, logs: AsyncLogsResource) -> None:
330195
self.list = async_to_raw_response_wrapper(
331196
logs.list,
332197
)
333-
self.get = async_to_raw_response_wrapper(
334-
logs.get,
335-
)
336-
337-
@cached_property
338-
def request(self) -> AsyncRequestResourceWithRawResponse:
339-
return AsyncRequestResourceWithRawResponse(self._logs.request)
340-
341-
@cached_property
342-
def response(self) -> AsyncResponseResourceWithRawResponse:
343-
return AsyncResponseResourceWithRawResponse(self._logs.response)
344198

345199

346200
class LogsResourceWithStreamingResponse:
@@ -350,17 +204,6 @@ def __init__(self, logs: LogsResource) -> None:
350204
self.list = to_streamed_response_wrapper(
351205
logs.list,
352206
)
353-
self.get = to_streamed_response_wrapper(
354-
logs.get,
355-
)
356-
357-
@cached_property
358-
def request(self) -> RequestResourceWithStreamingResponse:
359-
return RequestResourceWithStreamingResponse(self._logs.request)
360-
361-
@cached_property
362-
def response(self) -> ResponseResourceWithStreamingResponse:
363-
return ResponseResourceWithStreamingResponse(self._logs.response)
364207

365208

366209
class AsyncLogsResourceWithStreamingResponse:
@@ -370,14 +213,3 @@ def __init__(self, logs: AsyncLogsResource) -> None:
370213
self.list = async_to_streamed_response_wrapper(
371214
logs.list,
372215
)
373-
self.get = async_to_streamed_response_wrapper(
374-
logs.get,
375-
)
376-
377-
@cached_property
378-
def request(self) -> AsyncRequestResourceWithStreamingResponse:
379-
return AsyncRequestResourceWithStreamingResponse(self._logs.request)
380-
381-
@cached_property
382-
def response(self) -> AsyncResponseResourceWithStreamingResponse:
383-
return AsyncResponseResourceWithStreamingResponse(self._logs.response)

0 commit comments

Comments
 (0)