Skip to content

Commit 543a81b

Browse files
chore(api): upload stainless config from cloudflare-config
1 parent 62d83bb commit 543a81b

9 files changed

Lines changed: 598 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1780
1+
configured_endpoints: 1782
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4685df3ca2087423cddb4a4de339931859a09c4fa49e4e221dca73d558d1ed50.yml
33
openapi_spec_hash: 55c6bba2524de7539961a878afedaa6c
4-
config_hash: 3c3eb4d2344e048ccefb763165bb4e9f
4+
config_hash: eda5b3d9487ce675d1fadf88153b457d

api.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8910,6 +8910,19 @@ Methods:
89108910
- <code title="delete /accounts/{account_id}/cloudforce-one/scans/config/{config_id}">client.cloudforce_one.scans.config.<a href="./src/cloudflare/resources/cloudforce_one/scans/config.py">delete</a>(config_id, \*, account_id) -> object</code>
89118911
- <code title="patch /accounts/{account_id}/cloudforce-one/scans/config/{config_id}">client.cloudforce_one.scans.config.<a href="./src/cloudflare/resources/cloudforce_one/scans/config.py">edit</a>(config_id, \*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/scans/config_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/scans/config_edit_response.py">Optional[ConfigEditResponse]</a></code>
89128912

8913+
## BinaryStorage
8914+
8915+
Types:
8916+
8917+
```python
8918+
from cloudflare.types.cloudforce_one import BinaryStorageCreateResponse
8919+
```
8920+
8921+
Methods:
8922+
8923+
- <code title="post /accounts/{account_id}/cloudforce-one/binary">client.cloudforce_one.binary_storage.<a href="./src/cloudflare/resources/cloudforce_one/binary_storage.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/cloudforce_one/binary_storage_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/binary_storage_create_response.py">BinaryStorageCreateResponse</a></code>
8924+
- <code title="get /accounts/{account_id}/cloudforce-one/binary/{hash}">client.cloudforce_one.binary_storage.<a href="./src/cloudflare/resources/cloudforce_one/binary_storage.py">get</a>(hash, \*, account_id) -> None</code>
8925+
89138926
## Requests
89148927

89158928
Types:

src/cloudflare/resources/cloudforce_one/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
ThreatEventsResourceWithStreamingResponse,
2525
AsyncThreatEventsResourceWithStreamingResponse,
2626
)
27+
from .binary_storage import (
28+
BinaryStorageResource,
29+
AsyncBinaryStorageResource,
30+
BinaryStorageResourceWithRawResponse,
31+
AsyncBinaryStorageResourceWithRawResponse,
32+
BinaryStorageResourceWithStreamingResponse,
33+
AsyncBinaryStorageResourceWithStreamingResponse,
34+
)
2735
from .cloudforce_one import (
2836
CloudforceOneResource,
2937
AsyncCloudforceOneResource,
@@ -40,6 +48,12 @@
4048
"AsyncScansResourceWithRawResponse",
4149
"ScansResourceWithStreamingResponse",
4250
"AsyncScansResourceWithStreamingResponse",
51+
"BinaryStorageResource",
52+
"AsyncBinaryStorageResource",
53+
"BinaryStorageResourceWithRawResponse",
54+
"AsyncBinaryStorageResourceWithRawResponse",
55+
"BinaryStorageResourceWithStreamingResponse",
56+
"AsyncBinaryStorageResourceWithStreamingResponse",
4357
"RequestsResource",
4458
"AsyncRequestsResource",
4559
"RequestsResourceWithRawResponse",
Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Mapping, cast
6+
7+
import httpx
8+
9+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes
10+
from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
11+
from ..._compat import cached_property
12+
from ..._resource import SyncAPIResource, AsyncAPIResource
13+
from ..._response import (
14+
to_raw_response_wrapper,
15+
to_streamed_response_wrapper,
16+
async_to_raw_response_wrapper,
17+
async_to_streamed_response_wrapper,
18+
)
19+
from ..._base_client import make_request_options
20+
from ...types.cloudforce_one import binary_storage_create_params
21+
from ...types.cloudforce_one.binary_storage_create_response import BinaryStorageCreateResponse
22+
23+
__all__ = ["BinaryStorageResource", "AsyncBinaryStorageResource"]
24+
25+
26+
class BinaryStorageResource(SyncAPIResource):
27+
@cached_property
28+
def with_raw_response(self) -> BinaryStorageResourceWithRawResponse:
29+
"""
30+
This property can be used as a prefix for any HTTP method call to return
31+
the raw response object instead of the parsed content.
32+
33+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
34+
"""
35+
return BinaryStorageResourceWithRawResponse(self)
36+
37+
@cached_property
38+
def with_streaming_response(self) -> BinaryStorageResourceWithStreamingResponse:
39+
"""
40+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41+
42+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
43+
"""
44+
return BinaryStorageResourceWithStreamingResponse(self)
45+
46+
def create(
47+
self,
48+
*,
49+
account_id: str,
50+
file: FileTypes,
51+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52+
# The extra values given here take precedence over values defined on the client or passed to this method.
53+
extra_headers: Headers | None = None,
54+
extra_query: Query | None = None,
55+
extra_body: Body | None = None,
56+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57+
) -> BinaryStorageCreateResponse:
58+
"""
59+
Posts a file to BinDB
60+
61+
Args:
62+
account_id: Account ID.
63+
64+
file: The binary file content to upload.
65+
66+
extra_headers: Send extra headers
67+
68+
extra_query: Add additional query parameters to the request
69+
70+
extra_body: Add additional JSON properties to the request
71+
72+
timeout: Override the client-level default timeout for this request, in seconds
73+
"""
74+
if not account_id:
75+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
76+
body = deepcopy_minimal({"file": file})
77+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
78+
# It should be noted that the actual Content-Type header that will be
79+
# sent to the server will contain a `boundary` parameter, e.g.
80+
# multipart/form-data; boundary=---abc--
81+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
82+
return self._post(
83+
f"/accounts/{account_id}/cloudforce-one/binary",
84+
body=maybe_transform(body, binary_storage_create_params.BinaryStorageCreateParams),
85+
files=files,
86+
options=make_request_options(
87+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
88+
),
89+
cast_to=BinaryStorageCreateResponse,
90+
)
91+
92+
def get(
93+
self,
94+
hash: str,
95+
*,
96+
account_id: str,
97+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
98+
# The extra values given here take precedence over values defined on the client or passed to this method.
99+
extra_headers: Headers | None = None,
100+
extra_query: Query | None = None,
101+
extra_body: Body | None = None,
102+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
103+
) -> None:
104+
"""
105+
Posts a file to BinDB
106+
107+
Args:
108+
account_id: Account ID.
109+
110+
hash: hash of the binary
111+
112+
extra_headers: Send extra headers
113+
114+
extra_query: Add additional query parameters to the request
115+
116+
extra_body: Add additional JSON properties to the request
117+
118+
timeout: Override the client-level default timeout for this request, in seconds
119+
"""
120+
if not account_id:
121+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
122+
if not hash:
123+
raise ValueError(f"Expected a non-empty value for `hash` but received {hash!r}")
124+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
125+
return self._get(
126+
f"/accounts/{account_id}/cloudforce-one/binary/{hash}",
127+
options=make_request_options(
128+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
129+
),
130+
cast_to=NoneType,
131+
)
132+
133+
134+
class AsyncBinaryStorageResource(AsyncAPIResource):
135+
@cached_property
136+
def with_raw_response(self) -> AsyncBinaryStorageResourceWithRawResponse:
137+
"""
138+
This property can be used as a prefix for any HTTP method call to return
139+
the raw response object instead of the parsed content.
140+
141+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
142+
"""
143+
return AsyncBinaryStorageResourceWithRawResponse(self)
144+
145+
@cached_property
146+
def with_streaming_response(self) -> AsyncBinaryStorageResourceWithStreamingResponse:
147+
"""
148+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
149+
150+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
151+
"""
152+
return AsyncBinaryStorageResourceWithStreamingResponse(self)
153+
154+
async def create(
155+
self,
156+
*,
157+
account_id: str,
158+
file: FileTypes,
159+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
160+
# The extra values given here take precedence over values defined on the client or passed to this method.
161+
extra_headers: Headers | None = None,
162+
extra_query: Query | None = None,
163+
extra_body: Body | None = None,
164+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
165+
) -> BinaryStorageCreateResponse:
166+
"""
167+
Posts a file to BinDB
168+
169+
Args:
170+
account_id: Account ID.
171+
172+
file: The binary file content to upload.
173+
174+
extra_headers: Send extra headers
175+
176+
extra_query: Add additional query parameters to the request
177+
178+
extra_body: Add additional JSON properties to the request
179+
180+
timeout: Override the client-level default timeout for this request, in seconds
181+
"""
182+
if not account_id:
183+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
184+
body = deepcopy_minimal({"file": file})
185+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
186+
# It should be noted that the actual Content-Type header that will be
187+
# sent to the server will contain a `boundary` parameter, e.g.
188+
# multipart/form-data; boundary=---abc--
189+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
190+
return await self._post(
191+
f"/accounts/{account_id}/cloudforce-one/binary",
192+
body=await async_maybe_transform(body, binary_storage_create_params.BinaryStorageCreateParams),
193+
files=files,
194+
options=make_request_options(
195+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
196+
),
197+
cast_to=BinaryStorageCreateResponse,
198+
)
199+
200+
async def get(
201+
self,
202+
hash: str,
203+
*,
204+
account_id: str,
205+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
206+
# The extra values given here take precedence over values defined on the client or passed to this method.
207+
extra_headers: Headers | None = None,
208+
extra_query: Query | None = None,
209+
extra_body: Body | None = None,
210+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
211+
) -> None:
212+
"""
213+
Posts a file to BinDB
214+
215+
Args:
216+
account_id: Account ID.
217+
218+
hash: hash of the binary
219+
220+
extra_headers: Send extra headers
221+
222+
extra_query: Add additional query parameters to the request
223+
224+
extra_body: Add additional JSON properties to the request
225+
226+
timeout: Override the client-level default timeout for this request, in seconds
227+
"""
228+
if not account_id:
229+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
230+
if not hash:
231+
raise ValueError(f"Expected a non-empty value for `hash` but received {hash!r}")
232+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
233+
return await self._get(
234+
f"/accounts/{account_id}/cloudforce-one/binary/{hash}",
235+
options=make_request_options(
236+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
237+
),
238+
cast_to=NoneType,
239+
)
240+
241+
242+
class BinaryStorageResourceWithRawResponse:
243+
def __init__(self, binary_storage: BinaryStorageResource) -> None:
244+
self._binary_storage = binary_storage
245+
246+
self.create = to_raw_response_wrapper(
247+
binary_storage.create,
248+
)
249+
self.get = to_raw_response_wrapper(
250+
binary_storage.get,
251+
)
252+
253+
254+
class AsyncBinaryStorageResourceWithRawResponse:
255+
def __init__(self, binary_storage: AsyncBinaryStorageResource) -> None:
256+
self._binary_storage = binary_storage
257+
258+
self.create = async_to_raw_response_wrapper(
259+
binary_storage.create,
260+
)
261+
self.get = async_to_raw_response_wrapper(
262+
binary_storage.get,
263+
)
264+
265+
266+
class BinaryStorageResourceWithStreamingResponse:
267+
def __init__(self, binary_storage: BinaryStorageResource) -> None:
268+
self._binary_storage = binary_storage
269+
270+
self.create = to_streamed_response_wrapper(
271+
binary_storage.create,
272+
)
273+
self.get = to_streamed_response_wrapper(
274+
binary_storage.get,
275+
)
276+
277+
278+
class AsyncBinaryStorageResourceWithStreamingResponse:
279+
def __init__(self, binary_storage: AsyncBinaryStorageResource) -> None:
280+
self._binary_storage = binary_storage
281+
282+
self.create = async_to_streamed_response_wrapper(
283+
binary_storage.create,
284+
)
285+
self.get = async_to_streamed_response_wrapper(
286+
binary_storage.get,
287+
)

0 commit comments

Comments
 (0)