Skip to content

Commit 14b7e5f

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#365)
1 parent f07a5ed commit 14b7e5f

29 files changed

+237
-1936
lines changed

src/cloudflare/resources/accounts/members.py

+30-10
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def with_streaming_response(self) -> MembersResourceWithStreamingResponse:
4747
def create(
4848
self,
4949
*,
50-
account_id: object,
50+
account_id: str,
5151
email: str,
5252
roles: List[str],
5353
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
@@ -74,6 +74,8 @@ def create(
7474
7575
timeout: Override the client-level default timeout for this request, in seconds
7676
"""
77+
if not account_id:
78+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
7779
return self._post(
7880
f"/accounts/{account_id}/members",
7981
body=maybe_transform(
@@ -98,7 +100,7 @@ def update(
98100
self,
99101
member_id: str,
100102
*,
101-
account_id: object,
103+
account_id: str,
102104
roles: Iterable[member_update_params.Role],
103105
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
104106
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -123,6 +125,8 @@ def update(
123125
124126
timeout: Override the client-level default timeout for this request, in seconds
125127
"""
128+
if not account_id:
129+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
126130
if not member_id:
127131
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
128132
return self._put(
@@ -141,7 +145,7 @@ def update(
141145
def list(
142146
self,
143147
*,
144-
account_id: object,
148+
account_id: str,
145149
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
146150
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
147151
page: float | NotGiven = NOT_GIVEN,
@@ -176,6 +180,8 @@ def list(
176180
177181
timeout: Override the client-level default timeout for this request, in seconds
178182
"""
183+
if not account_id:
184+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
179185
return self._get_api_list(
180186
f"/accounts/{account_id}/members",
181187
page=SyncV4PagePaginationArray[MemberListResponse],
@@ -202,7 +208,7 @@ def delete(
202208
self,
203209
member_id: str,
204210
*,
205-
account_id: object,
211+
account_id: str,
206212
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
207213
# The extra values given here take precedence over values defined on the client or passed to this method.
208214
extra_headers: Headers | None = None,
@@ -224,6 +230,8 @@ def delete(
224230
225231
timeout: Override the client-level default timeout for this request, in seconds
226232
"""
233+
if not account_id:
234+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
227235
if not member_id:
228236
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
229237
return self._delete(
@@ -242,7 +250,7 @@ def get(
242250
self,
243251
member_id: str,
244252
*,
245-
account_id: object,
253+
account_id: str,
246254
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
247255
# The extra values given here take precedence over values defined on the client or passed to this method.
248256
extra_headers: Headers | None = None,
@@ -264,6 +272,8 @@ def get(
264272
265273
timeout: Override the client-level default timeout for this request, in seconds
266274
"""
275+
if not account_id:
276+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
267277
if not member_id:
268278
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
269279
return self._get(
@@ -291,7 +301,7 @@ def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse:
291301
async def create(
292302
self,
293303
*,
294-
account_id: object,
304+
account_id: str,
295305
email: str,
296306
roles: List[str],
297307
status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN,
@@ -318,6 +328,8 @@ async def create(
318328
319329
timeout: Override the client-level default timeout for this request, in seconds
320330
"""
331+
if not account_id:
332+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
321333
return await self._post(
322334
f"/accounts/{account_id}/members",
323335
body=await async_maybe_transform(
@@ -342,7 +354,7 @@ async def update(
342354
self,
343355
member_id: str,
344356
*,
345-
account_id: object,
357+
account_id: str,
346358
roles: Iterable[member_update_params.Role],
347359
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
348360
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -367,6 +379,8 @@ async def update(
367379
368380
timeout: Override the client-level default timeout for this request, in seconds
369381
"""
382+
if not account_id:
383+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
370384
if not member_id:
371385
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
372386
return await self._put(
@@ -385,7 +399,7 @@ async def update(
385399
def list(
386400
self,
387401
*,
388-
account_id: object,
402+
account_id: str,
389403
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
390404
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN,
391405
page: float | NotGiven = NOT_GIVEN,
@@ -420,6 +434,8 @@ def list(
420434
421435
timeout: Override the client-level default timeout for this request, in seconds
422436
"""
437+
if not account_id:
438+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
423439
return self._get_api_list(
424440
f"/accounts/{account_id}/members",
425441
page=AsyncV4PagePaginationArray[MemberListResponse],
@@ -446,7 +462,7 @@ async def delete(
446462
self,
447463
member_id: str,
448464
*,
449-
account_id: object,
465+
account_id: str,
450466
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
451467
# The extra values given here take precedence over values defined on the client or passed to this method.
452468
extra_headers: Headers | None = None,
@@ -468,6 +484,8 @@ async def delete(
468484
469485
timeout: Override the client-level default timeout for this request, in seconds
470486
"""
487+
if not account_id:
488+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
471489
if not member_id:
472490
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
473491
return await self._delete(
@@ -486,7 +504,7 @@ async def get(
486504
self,
487505
member_id: str,
488506
*,
489-
account_id: object,
507+
account_id: str,
490508
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
491509
# The extra values given here take precedence over values defined on the client or passed to this method.
492510
extra_headers: Headers | None = None,
@@ -508,6 +526,8 @@ async def get(
508526
509527
timeout: Override the client-level default timeout for this request, in seconds
510528
"""
529+
if not account_id:
530+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
511531
if not member_id:
512532
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
513533
return await self._get(

src/cloudflare/resources/accounts/roles.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def with_streaming_response(self) -> RolesResourceWithStreamingResponse:
3939
def list(
4040
self,
4141
*,
42-
account_id: object,
42+
account_id: str,
4343
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4444
# The extra values given here take precedence over values defined on the client or passed to this method.
4545
extra_headers: Headers | None = None,
@@ -59,6 +59,8 @@ def list(
5959
6060
timeout: Override the client-level default timeout for this request, in seconds
6161
"""
62+
if not account_id:
63+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
6264
return self._get_api_list(
6365
f"/accounts/{account_id}/roles",
6466
page=SyncSinglePage[Role],
@@ -72,7 +74,7 @@ def get(
7274
self,
7375
role_id: object,
7476
*,
75-
account_id: object,
77+
account_id: str,
7678
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7779
# The extra values given here take precedence over values defined on the client or passed to this method.
7880
extra_headers: Headers | None = None,
@@ -92,6 +94,8 @@ def get(
9294
9395
timeout: Override the client-level default timeout for this request, in seconds
9496
"""
97+
if not account_id:
98+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
9599
return cast(
96100
RoleGetResponse,
97101
self._get(
@@ -122,7 +126,7 @@ def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse:
122126
def list(
123127
self,
124128
*,
125-
account_id: object,
129+
account_id: str,
126130
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127131
# The extra values given here take precedence over values defined on the client or passed to this method.
128132
extra_headers: Headers | None = None,
@@ -142,6 +146,8 @@ def list(
142146
143147
timeout: Override the client-level default timeout for this request, in seconds
144148
"""
149+
if not account_id:
150+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
145151
return self._get_api_list(
146152
f"/accounts/{account_id}/roles",
147153
page=AsyncSinglePage[Role],
@@ -155,7 +161,7 @@ async def get(
155161
self,
156162
role_id: object,
157163
*,
158-
account_id: object,
164+
account_id: str,
159165
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
160166
# The extra values given here take precedence over values defined on the client or passed to this method.
161167
extra_headers: Headers | None = None,
@@ -175,6 +181,8 @@ async def get(
175181
176182
timeout: Override the client-level default timeout for this request, in seconds
177183
"""
184+
if not account_id:
185+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
178186
return cast(
179187
RoleGetResponse,
180188
await self._get(

src/cloudflare/types/accounts/member_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class MemberCreateParams(TypedDict, total=False):
12-
account_id: Required[object]
12+
account_id: Required[str]
1313

1414
email: Required[str]
1515
"""The contact email address of the user."""

src/cloudflare/types/accounts/member_list_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class MemberListParams(TypedDict, total=False):
11-
account_id: Required[object]
11+
account_id: Required[str]
1212

1313
direction: Literal["asc", "desc"]
1414
"""Direction to order results."""

src/cloudflare/types/accounts/member_update_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class MemberUpdateParams(TypedDict, total=False):
12-
account_id: Required[object]
12+
account_id: Required[str]
1313

1414
roles: Required[Iterable[Role]]
1515
"""Roles assigned to this member."""

0 commit comments

Comments
 (0)