Skip to content

Commit 41069fe

Browse files
feat(api): fix account ID types
Change type of account_id path parameter from 'number' to 'string' for Cloudforce threat event and Magic Transit connector endpoints
1 parent 0328fcc commit 41069fe

Some content is hidden

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

52 files changed

+1176
-408
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-630f05355fbbcf8b9ce657a1a5635aab2423b8387a5ffa7534173ffcdf57a305.yml
3-
openapi_spec_hash: ca3793864d354c1d505730523406f865
4-
config_hash: 135c41c52147f104907327e028f831e2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc675acbdcab1131f3681a184a8515deca17471c93595473e2474c4b5fafc7e2.yml
3+
openapi_spec_hash: 41b14e228d5ef99f8e1e09732ce2679c
4+
config_hash: 22b6cc50203041358f4b2b4e832b009d

src/cloudflare/resources/cloudforce_one/threat_events/attackers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def with_streaming_response(self) -> AttackersResourceWithStreamingResponse:
4242
def list(
4343
self,
4444
*,
45-
account_id: float,
45+
account_id: str,
4646
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4747
# The extra values given here take precedence over values defined on the client or passed to this method.
4848
extra_headers: Headers | None = None,
@@ -64,6 +64,8 @@ def list(
6464
6565
timeout: Override the client-level default timeout for this request, in seconds
6666
"""
67+
if not account_id:
68+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
6769
return self._get(
6870
f"/accounts/{account_id}/cloudforce-one/events/attackers",
6971
options=make_request_options(
@@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncAttackersResourceWithStreamingResponse
9698
async def list(
9799
self,
98100
*,
99-
account_id: float,
101+
account_id: str,
100102
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101103
# The extra values given here take precedence over values defined on the client or passed to this method.
102104
extra_headers: Headers | None = None,
@@ -118,6 +120,8 @@ async def list(
118120
119121
timeout: Override the client-level default timeout for this request, in seconds
120122
"""
123+
if not account_id:
124+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
121125
return await self._get(
122126
f"/accounts/{account_id}/cloudforce-one/events/attackers",
123127
options=make_request_options(

src/cloudflare/resources/cloudforce_one/threat_events/categories.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def with_streaming_response(self) -> CategoriesResourceWithStreamingResponse:
5050
def create(
5151
self,
5252
*,
53-
account_id: float,
53+
account_id: str,
5454
kill_chain: float,
5555
name: str,
5656
mitre_attack: List[str] | NotGiven = NOT_GIVEN,
@@ -76,6 +76,8 @@ def create(
7676
7777
timeout: Override the client-level default timeout for this request, in seconds
7878
"""
79+
if not account_id:
80+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
7981
return self._post(
8082
f"/accounts/{account_id}/cloudforce-one/events/categories/create",
8183
body=maybe_transform(
@@ -96,7 +98,7 @@ def create(
9698
def list(
9799
self,
98100
*,
99-
account_id: float,
101+
account_id: str,
100102
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101103
# The extra values given here take precedence over values defined on the client or passed to this method.
102104
extra_headers: Headers | None = None,
@@ -118,6 +120,8 @@ def list(
118120
119121
timeout: Override the client-level default timeout for this request, in seconds
120122
"""
123+
if not account_id:
124+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
121125
return self._get(
122126
f"/accounts/{account_id}/cloudforce-one/events/categories",
123127
options=make_request_options(
@@ -130,7 +134,7 @@ def delete(
130134
self,
131135
category_id: str,
132136
*,
133-
account_id: float,
137+
account_id: str,
134138
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135139
# The extra values given here take precedence over values defined on the client or passed to this method.
136140
extra_headers: Headers | None = None,
@@ -154,6 +158,8 @@ def delete(
154158
155159
timeout: Override the client-level default timeout for this request, in seconds
156160
"""
161+
if not account_id:
162+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
157163
if not category_id:
158164
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
159165
return self._delete(
@@ -168,7 +174,7 @@ def edit(
168174
self,
169175
category_id: str,
170176
*,
171-
account_id: float,
177+
account_id: str,
172178
kill_chain: float | NotGiven = NOT_GIVEN,
173179
mitre_attack: List[str] | NotGiven = NOT_GIVEN,
174180
name: str | NotGiven = NOT_GIVEN,
@@ -196,6 +202,8 @@ def edit(
196202
197203
timeout: Override the client-level default timeout for this request, in seconds
198204
"""
205+
if not account_id:
206+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
199207
if not category_id:
200208
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
201209
return self._patch(
@@ -219,7 +227,7 @@ def get(
219227
self,
220228
category_id: str,
221229
*,
222-
account_id: float,
230+
account_id: str,
223231
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
224232
# The extra values given here take precedence over values defined on the client or passed to this method.
225233
extra_headers: Headers | None = None,
@@ -243,6 +251,8 @@ def get(
243251
244252
timeout: Override the client-level default timeout for this request, in seconds
245253
"""
254+
if not account_id:
255+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
246256
if not category_id:
247257
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
248258
return self._get(
@@ -277,7 +287,7 @@ def with_streaming_response(self) -> AsyncCategoriesResourceWithStreamingRespons
277287
async def create(
278288
self,
279289
*,
280-
account_id: float,
290+
account_id: str,
281291
kill_chain: float,
282292
name: str,
283293
mitre_attack: List[str] | NotGiven = NOT_GIVEN,
@@ -303,6 +313,8 @@ async def create(
303313
304314
timeout: Override the client-level default timeout for this request, in seconds
305315
"""
316+
if not account_id:
317+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
306318
return await self._post(
307319
f"/accounts/{account_id}/cloudforce-one/events/categories/create",
308320
body=await async_maybe_transform(
@@ -323,7 +335,7 @@ async def create(
323335
async def list(
324336
self,
325337
*,
326-
account_id: float,
338+
account_id: str,
327339
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
328340
# The extra values given here take precedence over values defined on the client or passed to this method.
329341
extra_headers: Headers | None = None,
@@ -345,6 +357,8 @@ async def list(
345357
346358
timeout: Override the client-level default timeout for this request, in seconds
347359
"""
360+
if not account_id:
361+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
348362
return await self._get(
349363
f"/accounts/{account_id}/cloudforce-one/events/categories",
350364
options=make_request_options(
@@ -357,7 +371,7 @@ async def delete(
357371
self,
358372
category_id: str,
359373
*,
360-
account_id: float,
374+
account_id: str,
361375
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
362376
# The extra values given here take precedence over values defined on the client or passed to this method.
363377
extra_headers: Headers | None = None,
@@ -381,6 +395,8 @@ async def delete(
381395
382396
timeout: Override the client-level default timeout for this request, in seconds
383397
"""
398+
if not account_id:
399+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
384400
if not category_id:
385401
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
386402
return await self._delete(
@@ -395,7 +411,7 @@ async def edit(
395411
self,
396412
category_id: str,
397413
*,
398-
account_id: float,
414+
account_id: str,
399415
kill_chain: float | NotGiven = NOT_GIVEN,
400416
mitre_attack: List[str] | NotGiven = NOT_GIVEN,
401417
name: str | NotGiven = NOT_GIVEN,
@@ -423,6 +439,8 @@ async def edit(
423439
424440
timeout: Override the client-level default timeout for this request, in seconds
425441
"""
442+
if not account_id:
443+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
426444
if not category_id:
427445
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
428446
return await self._patch(
@@ -446,7 +464,7 @@ async def get(
446464
self,
447465
category_id: str,
448466
*,
449-
account_id: float,
467+
account_id: str,
450468
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
451469
# The extra values given here take precedence over values defined on the client or passed to this method.
452470
extra_headers: Headers | None = None,
@@ -470,6 +488,8 @@ async def get(
470488
471489
timeout: Override the client-level default timeout for this request, in seconds
472490
"""
491+
if not account_id:
492+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
473493
if not category_id:
474494
raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
475495
return await self._get(

src/cloudflare/resources/cloudforce_one/threat_events/countries.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def with_streaming_response(self) -> CountriesResourceWithStreamingResponse:
4242
def list(
4343
self,
4444
*,
45-
account_id: float,
45+
account_id: str,
4646
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4747
# The extra values given here take precedence over values defined on the client or passed to this method.
4848
extra_headers: Headers | None = None,
@@ -64,6 +64,8 @@ def list(
6464
6565
timeout: Override the client-level default timeout for this request, in seconds
6666
"""
67+
if not account_id:
68+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
6769
return self._get(
6870
f"/accounts/{account_id}/cloudforce-one/events/countries",
6971
options=make_request_options(
@@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncCountriesResourceWithStreamingResponse
9698
async def list(
9799
self,
98100
*,
99-
account_id: float,
101+
account_id: str,
100102
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101103
# The extra values given here take precedence over values defined on the client or passed to this method.
102104
extra_headers: Headers | None = None,
@@ -118,6 +120,8 @@ async def list(
118120
119121
timeout: Override the client-level default timeout for this request, in seconds
120122
"""
123+
if not account_id:
124+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
121125
return await self._get(
122126
f"/accounts/{account_id}/cloudforce-one/events/countries",
123127
options=make_request_options(

src/cloudflare/resources/cloudforce_one/threat_events/crons.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def with_streaming_response(self) -> CronsResourceWithStreamingResponse:
4343
def list(
4444
self,
4545
*,
46-
account_id: float,
46+
account_id: str,
4747
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4848
# The extra values given here take precedence over values defined on the client or passed to this method.
4949
extra_headers: Headers | None = None,
@@ -65,6 +65,8 @@ def list(
6565
6666
timeout: Override the client-level default timeout for this request, in seconds
6767
"""
68+
if not account_id:
69+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
6870
return self._get(
6971
f"/accounts/{account_id}/cloudforce-one/events/cron",
7072
options=make_request_options(
@@ -76,7 +78,7 @@ def list(
7678
def edit(
7779
self,
7880
*,
79-
account_id: float,
81+
account_id: str,
8082
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8183
# The extra values given here take precedence over values defined on the client or passed to this method.
8284
extra_headers: Headers | None = None,
@@ -98,6 +100,8 @@ def edit(
98100
99101
timeout: Override the client-level default timeout for this request, in seconds
100102
"""
103+
if not account_id:
104+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
101105
return self._patch(
102106
f"/accounts/{account_id}/cloudforce-one/events/cron",
103107
options=make_request_options(
@@ -130,7 +134,7 @@ def with_streaming_response(self) -> AsyncCronsResourceWithStreamingResponse:
130134
async def list(
131135
self,
132136
*,
133-
account_id: float,
137+
account_id: str,
134138
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135139
# The extra values given here take precedence over values defined on the client or passed to this method.
136140
extra_headers: Headers | None = None,
@@ -152,6 +156,8 @@ async def list(
152156
153157
timeout: Override the client-level default timeout for this request, in seconds
154158
"""
159+
if not account_id:
160+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
155161
return await self._get(
156162
f"/accounts/{account_id}/cloudforce-one/events/cron",
157163
options=make_request_options(
@@ -163,7 +169,7 @@ async def list(
163169
async def edit(
164170
self,
165171
*,
166-
account_id: float,
172+
account_id: str,
167173
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168174
# The extra values given here take precedence over values defined on the client or passed to this method.
169175
extra_headers: Headers | None = None,
@@ -185,6 +191,8 @@ async def edit(
185191
186192
timeout: Override the client-level default timeout for this request, in seconds
187193
"""
194+
if not account_id:
195+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
188196
return await self._patch(
189197
f"/accounts/{account_id}/cloudforce-one/events/cron",
190198
options=make_request_options(

0 commit comments

Comments
 (0)