Skip to content

Commit 0b5a5d0

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2142)
1 parent d44d69e commit 0b5a5d0

25 files changed

+351
-192
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1365
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ab175377b40ec09207fa70914e51f8bec9d6030f6f628635d56f4c3321d4809.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4593529df2c582c5e4de92308af748d9f8abbca6c92fff7e99e08bd463b7271e.yml

api.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ from cloudflare.types import (
1010
ErrorData,
1111
Identifier,
1212
LoadBalancerPreview,
13-
Member,
1413
PaginationInfo,
1514
Permission,
1615
PermissionGrant,
1716
RatePlan,
1817
ResponseInfo,
1918
Result,
20-
Role,
2119
SortDirection,
2220
Subscription,
2321
SubscriptionComponent,
@@ -48,7 +46,6 @@ Types:
4846
```python
4947
from cloudflare.types.accounts import (
5048
Status,
51-
UserWithInviteCode,
5249
MemberCreateResponse,
5350
MemberUpdateResponse,
5451
MemberListResponse,
@@ -70,13 +67,13 @@ Methods:
7067
Types:
7168

7269
```python
73-
from cloudflare.types.accounts import RoleGetResponse
70+
from cloudflare.types.accounts import RoleListResponse, RoleGetResponse
7471
```
7572

7673
Methods:
7774

78-
- <code title="get /accounts/{account_id}/roles">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/shared/role.py">SyncSinglePage[Role]</a></code>
79-
- <code title="get /accounts/{account_id}/roles/{role_id}">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">get</a>(role_id, \*, account_id) -> <a href="./src/cloudflare/types/accounts/role_get_response.py">object</a></code>
75+
- <code title="get /accounts/{account_id}/roles">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/accounts/role_list_response.py">SyncSinglePage[RoleListResponse]</a></code>
76+
- <code title="get /accounts/{account_id}/roles/{role_id}">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">get</a>(role_id, \*, account_id) -> <a href="./src/cloudflare/types/accounts/role_get_response.py">Optional</a></code>
8077

8178
## Subscriptions
8279

@@ -198,14 +195,14 @@ Methods:
198195
Types:
199196

200197
```python
201-
from cloudflare.types.user import Invite, InviteEditResponse, InviteGetResponse
198+
from cloudflare.types.user import Invite
202199
```
203200

204201
Methods:
205202

206203
- <code title="get /user/invites">client.user.invites.<a href="./src/cloudflare/resources/user/invites.py">list</a>() -> <a href="./src/cloudflare/types/user/invite.py">SyncSinglePage[Invite]</a></code>
207-
- <code title="patch /user/invites/{invite_id}">client.user.invites.<a href="./src/cloudflare/resources/user/invites.py">edit</a>(invite_id, \*\*<a href="src/cloudflare/types/user/invite_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/user/invite_edit_response.py">object</a></code>
208-
- <code title="get /user/invites/{invite_id}">client.user.invites.<a href="./src/cloudflare/resources/user/invites.py">get</a>(invite_id) -> <a href="./src/cloudflare/types/user/invite_get_response.py">object</a></code>
204+
- <code title="patch /user/invites/{invite_id}">client.user.invites.<a href="./src/cloudflare/resources/user/invites.py">edit</a>(invite_id, \*\*<a href="src/cloudflare/types/user/invite_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/user/invite.py">Optional</a></code>
205+
- <code title="get /user/invites/{invite_id}">client.user.invites.<a href="./src/cloudflare/resources/user/invites.py">get</a>(invite_id) -> <a href="./src/cloudflare/types/user/invite.py">Optional</a></code>
209206

210207
## Organizations
211208

src/cloudflare/resources/accounts/members.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def update(
169169
member_id: str,
170170
*,
171171
account_id: str,
172-
roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN,
172+
roles: Iterable[member_update_params.IAMUpdateMemberWithRolesRole] | NotGiven = NOT_GIVEN,
173173
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
174174
# The extra values given here take precedence over values defined on the client or passed to this method.
175175
extra_headers: Headers | None = None,
@@ -237,7 +237,7 @@ def update(
237237
member_id: str,
238238
*,
239239
account_id: str,
240-
roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN,
240+
roles: Iterable[member_update_params.IAMUpdateMemberWithRolesRole] | NotGiven = NOT_GIVEN,
241241
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
242242
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243243
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -557,7 +557,7 @@ async def update(
557557
member_id: str,
558558
*,
559559
account_id: str,
560-
roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN,
560+
roles: Iterable[member_update_params.IAMUpdateMemberWithRolesRole] | NotGiven = NOT_GIVEN,
561561
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
562562
# The extra values given here take precedence over values defined on the client or passed to this method.
563563
extra_headers: Headers | None = None,
@@ -625,7 +625,7 @@ async def update(
625625
member_id: str,
626626
*,
627627
account_id: str,
628-
roles: Iterable[member_update_params.MemberRole] | NotGiven = NOT_GIVEN,
628+
roles: Iterable[member_update_params.IAMUpdateMemberWithRolesRole] | NotGiven = NOT_GIVEN,
629629
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN,
630630
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
631631
# The extra values given here take precedence over values defined on the client or passed to this method.

src/cloudflare/resources/accounts/roles.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
from ..._wrappers import ResultWrapper
1919
from ...pagination import SyncSinglePage, AsyncSinglePage
2020
from ..._base_client import AsyncPaginator, make_request_options
21-
from ...types.shared.role import Role
21+
from ...types.accounts.role_get_response import RoleGetResponse
22+
from ...types.accounts.role_list_response import RoleListResponse
2223

2324
__all__ = ["RolesResource", "AsyncRolesResource"]
2425

@@ -53,7 +54,7 @@ def list(
5354
extra_query: Query | None = None,
5455
extra_body: Body | None = None,
5556
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
56-
) -> SyncSinglePage[Role]:
57+
) -> SyncSinglePage[RoleListResponse]:
5758
"""
5859
Get all available roles for an account.
5960
@@ -72,11 +73,11 @@ def list(
7273
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
7374
return self._get_api_list(
7475
f"/accounts/{account_id}/roles",
75-
page=SyncSinglePage[Role],
76+
page=SyncSinglePage[RoleListResponse],
7677
options=make_request_options(
7778
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
7879
),
79-
model=Role,
80+
model=RoleListResponse,
8081
)
8182

8283
def get(
@@ -90,7 +91,7 @@ def get(
9091
extra_query: Query | None = None,
9192
extra_body: Body | None = None,
9293
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
93-
) -> object:
94+
) -> Optional[RoleGetResponse]:
9495
"""
9596
Get information about a specific role for an account.
9697
@@ -118,9 +119,9 @@ def get(
118119
extra_query=extra_query,
119120
extra_body=extra_body,
120121
timeout=timeout,
121-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
122+
post_parser=ResultWrapper[Optional[RoleGetResponse]]._unwrapper,
122123
),
123-
cast_to=cast(Type[object], ResultWrapper[object]),
124+
cast_to=cast(Type[Optional[RoleGetResponse]], ResultWrapper[RoleGetResponse]),
124125
)
125126

126127

@@ -154,7 +155,7 @@ def list(
154155
extra_query: Query | None = None,
155156
extra_body: Body | None = None,
156157
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
157-
) -> AsyncPaginator[Role, AsyncSinglePage[Role]]:
158+
) -> AsyncPaginator[RoleListResponse, AsyncSinglePage[RoleListResponse]]:
158159
"""
159160
Get all available roles for an account.
160161
@@ -173,11 +174,11 @@ def list(
173174
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
174175
return self._get_api_list(
175176
f"/accounts/{account_id}/roles",
176-
page=AsyncSinglePage[Role],
177+
page=AsyncSinglePage[RoleListResponse],
177178
options=make_request_options(
178179
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
179180
),
180-
model=Role,
181+
model=RoleListResponse,
181182
)
182183

183184
async def get(
@@ -191,7 +192,7 @@ async def get(
191192
extra_query: Query | None = None,
192193
extra_body: Body | None = None,
193194
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
194-
) -> object:
195+
) -> Optional[RoleGetResponse]:
195196
"""
196197
Get information about a specific role for an account.
197198
@@ -219,9 +220,9 @@ async def get(
219220
extra_query=extra_query,
220221
extra_body=extra_body,
221222
timeout=timeout,
222-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
223+
post_parser=ResultWrapper[Optional[RoleGetResponse]]._unwrapper,
223224
),
224-
cast_to=cast(Type[object], ResultWrapper[object]),
225+
cast_to=cast(Type[Optional[RoleGetResponse]], ResultWrapper[RoleGetResponse]),
225226
)
226227

227228

src/cloudflare/resources/user/invites.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def edit(
8080
extra_query: Query | None = None,
8181
extra_body: Body | None = None,
8282
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
83-
) -> object:
83+
) -> Optional[Invite]:
8484
"""
8585
Responds to an invitation.
8686
@@ -107,9 +107,9 @@ def edit(
107107
extra_query=extra_query,
108108
extra_body=extra_body,
109109
timeout=timeout,
110-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
110+
post_parser=ResultWrapper[Optional[Invite]]._unwrapper,
111111
),
112-
cast_to=cast(Type[object], ResultWrapper[object]),
112+
cast_to=cast(Type[Optional[Invite]], ResultWrapper[Invite]),
113113
)
114114

115115
def get(
@@ -122,7 +122,7 @@ def get(
122122
extra_query: Query | None = None,
123123
extra_body: Body | None = None,
124124
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
125-
) -> object:
125+
) -> Optional[Invite]:
126126
"""
127127
Gets the details of an invitation.
128128
@@ -146,9 +146,9 @@ def get(
146146
extra_query=extra_query,
147147
extra_body=extra_body,
148148
timeout=timeout,
149-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
149+
post_parser=ResultWrapper[Optional[Invite]]._unwrapper,
150150
),
151-
cast_to=cast(Type[object], ResultWrapper[object]),
151+
cast_to=cast(Type[Optional[Invite]], ResultWrapper[Invite]),
152152
)
153153

154154

@@ -203,7 +203,7 @@ async def edit(
203203
extra_query: Query | None = None,
204204
extra_body: Body | None = None,
205205
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
206-
) -> object:
206+
) -> Optional[Invite]:
207207
"""
208208
Responds to an invitation.
209209
@@ -230,9 +230,9 @@ async def edit(
230230
extra_query=extra_query,
231231
extra_body=extra_body,
232232
timeout=timeout,
233-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
233+
post_parser=ResultWrapper[Optional[Invite]]._unwrapper,
234234
),
235-
cast_to=cast(Type[object], ResultWrapper[object]),
235+
cast_to=cast(Type[Optional[Invite]], ResultWrapper[Invite]),
236236
)
237237

238238
async def get(
@@ -245,7 +245,7 @@ async def get(
245245
extra_query: Query | None = None,
246246
extra_body: Body | None = None,
247247
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
248-
) -> object:
248+
) -> Optional[Invite]:
249249
"""
250250
Gets the details of an invitation.
251251
@@ -269,9 +269,9 @@ async def get(
269269
extra_query=extra_query,
270270
extra_body=extra_body,
271271
timeout=timeout,
272-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
272+
post_parser=ResultWrapper[Optional[Invite]]._unwrapper,
273273
),
274-
cast_to=cast(Type[object], ResultWrapper[object]),
274+
cast_to=cast(Type[Optional[Invite]], ResultWrapper[Invite]),
275275
)
276276

277277

src/cloudflare/types/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from .shared import (
66
ASN as ASN,
7-
Role as Role,
8-
Member as Member,
97
Result as Result,
108
AuditLog as AuditLog,
119
RatePlan as RatePlan,

src/cloudflare/types/accounts/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
from .status import Status as Status
66
from .account import Account as Account
7+
from .role_get_response import RoleGetResponse as RoleGetResponse
78
from .member_list_params import MemberListParams as MemberListParams
9+
from .role_list_response import RoleListResponse as RoleListResponse
810
from .account_list_params import AccountListParams as AccountListParams
911
from .member_get_response import MemberGetResponse as MemberGetResponse
1012
from .member_create_params import MemberCreateParams as MemberCreateParams

src/cloudflare/types/accounts/account.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class Settings(BaseModel):
2525
See
2626
[Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)
2727
for more information.
28+
29+
Deprecated in favor of
30+
[DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
2831
"""
2932

3033
enforce_twofactor: Optional[bool] = None
@@ -38,7 +41,8 @@ class Settings(BaseModel):
3841
Indicates whether new zones should use the account-level custom nameservers by
3942
default.
4043
41-
Deprecated in favor of `default_nameservers`.
44+
Deprecated in favor of
45+
[DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
4246
"""
4347

4448

src/cloudflare/types/accounts/account_update_params.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class Settings(TypedDict, total=False):
3434
See
3535
[Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)
3636
for more information.
37+
38+
Deprecated in favor of
39+
[DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
3740
"""
3841

3942
enforce_twofactor: bool
@@ -47,5 +50,6 @@ class Settings(TypedDict, total=False):
4750
Indicates whether new zones should use the account-level custom nameservers by
4851
default.
4952
50-
Deprecated in favor of `default_nameservers`.
53+
Deprecated in favor of
54+
[DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).
5155
"""

0 commit comments

Comments
 (0)