Skip to content

Commit 70c6acb

Browse files
feat(api): api update
1 parent f430026 commit 70c6acb

27 files changed

+444
-298
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1741
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5dfd0a2b4beb1d5ef1a96c46dc8050e69667693f427cf0111864cbff8ca307e8.yml
3-
openapi_spec_hash: 511cf722768066572627c9fc4c637002
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b0d7a6597a0eb6b034f863cd1d6a0cede8066e49ba71c3a99ca073383792ab8f.yml
3+
openapi_spec_hash: 8c2fc678ec978dbdff7fd1de9b255aec
44
config_hash: cb36b26a5fcc81fa60c65016b1e74f0a

api.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,16 @@ Methods:
185185

186186
# User
187187

188+
Types:
189+
190+
```python
191+
from cloudflare.types.user import UserEditResponse, UserGetResponse
192+
```
193+
188194
Methods:
189195

190-
- <code title="patch /user">client.user.<a href="./src/cloudflare/resources/user/user.py">edit</a>(\*\*<a href="src/cloudflare/types/user/user_edit_params.py">params</a>) -> object</code>
191-
- <code title="get /user">client.user.<a href="./src/cloudflare/resources/user/user.py">get</a>() -> object</code>
196+
- <code title="patch /user">client.user.<a href="./src/cloudflare/resources/user/user.py">edit</a>(\*\*<a href="src/cloudflare/types/user/user_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/user/user_edit_response.py">Optional[UserEditResponse]</a></code>
197+
- <code title="get /user">client.user.<a href="./src/cloudflare/resources/user/user.py">get</a>() -> <a href="./src/cloudflare/types/user/user_get_response.py">Optional[UserGetResponse]</a></code>
192198

193199
## AuditLogs
194200

src/cloudflare/resources/accounts/accounts.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def update(
165165
self,
166166
*,
167167
account_id: str,
168+
id: str,
168169
name: str,
169170
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
170171
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -180,6 +181,8 @@ def update(
180181
Args:
181182
account_id: Account identifier tag.
182183
184+
id: Identifier
185+
183186
name: Account name
184187
185188
settings: Account settings
@@ -198,6 +201,7 @@ def update(
198201
f"/accounts/{account_id}",
199202
body=maybe_transform(
200203
{
204+
"id": id,
201205
"name": name,
202206
"settings": settings,
203207
},
@@ -448,6 +452,7 @@ async def update(
448452
self,
449453
*,
450454
account_id: str,
455+
id: str,
451456
name: str,
452457
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
453458
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -463,6 +468,8 @@ async def update(
463468
Args:
464469
account_id: Account identifier tag.
465470
471+
id: Identifier
472+
466473
name: Account name
467474
468475
settings: Account settings
@@ -481,6 +488,7 @@ async def update(
481488
f"/accounts/{account_id}",
482489
body=await async_maybe_transform(
483490
{
491+
"id": id,
484492
"name": name,
485493
"settings": settings,
486494
},

src/cloudflare/resources/user/user.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
BillingResourceWithStreamingResponse,
6868
AsyncBillingResourceWithStreamingResponse,
6969
)
70+
from ...types.user.user_get_response import UserGetResponse
71+
from ...types.user.user_edit_response import UserEditResponse
7072

7173
__all__ = ["UserResource", "AsyncUserResource"]
7274

@@ -129,7 +131,7 @@ def edit(
129131
extra_query: Query | None = None,
130132
extra_body: Body | None = None,
131133
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
132-
) -> object:
134+
) -> Optional[UserEditResponse]:
133135
"""
134136
Edit part of your user details.
135137
@@ -169,9 +171,9 @@ def edit(
169171
extra_query=extra_query,
170172
extra_body=extra_body,
171173
timeout=timeout,
172-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
174+
post_parser=ResultWrapper[Optional[UserEditResponse]]._unwrapper,
173175
),
174-
cast_to=cast(Type[object], ResultWrapper[object]),
176+
cast_to=cast(Type[Optional[UserEditResponse]], ResultWrapper[UserEditResponse]),
175177
)
176178

177179
def get(
@@ -183,7 +185,7 @@ def get(
183185
extra_query: Query | None = None,
184186
extra_body: Body | None = None,
185187
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
186-
) -> object:
188+
) -> Optional[UserGetResponse]:
187189
"""User Details"""
188190
return self._get(
189191
"/user",
@@ -192,9 +194,9 @@ def get(
192194
extra_query=extra_query,
193195
extra_body=extra_body,
194196
timeout=timeout,
195-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
197+
post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper,
196198
),
197-
cast_to=cast(Type[object], ResultWrapper[object]),
199+
cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]),
198200
)
199201

200202

@@ -256,7 +258,7 @@ async def edit(
256258
extra_query: Query | None = None,
257259
extra_body: Body | None = None,
258260
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
259-
) -> object:
261+
) -> Optional[UserEditResponse]:
260262
"""
261263
Edit part of your user details.
262264
@@ -296,9 +298,9 @@ async def edit(
296298
extra_query=extra_query,
297299
extra_body=extra_body,
298300
timeout=timeout,
299-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
301+
post_parser=ResultWrapper[Optional[UserEditResponse]]._unwrapper,
300302
),
301-
cast_to=cast(Type[object], ResultWrapper[object]),
303+
cast_to=cast(Type[Optional[UserEditResponse]], ResultWrapper[UserEditResponse]),
302304
)
303305

304306
async def get(
@@ -310,7 +312,7 @@ async def get(
310312
extra_query: Query | None = None,
311313
extra_body: Body | None = None,
312314
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
313-
) -> object:
315+
) -> Optional[UserGetResponse]:
314316
"""User Details"""
315317
return await self._get(
316318
"/user",
@@ -319,9 +321,9 @@ async def get(
319321
extra_query=extra_query,
320322
extra_body=extra_body,
321323
timeout=timeout,
322-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
324+
post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper,
323325
),
324-
cast_to=cast(Type[object], ResultWrapper[object]),
326+
cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]),
325327
)
326328

327329

src/cloudflare/types/accounts/account_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class AccountUpdateParams(TypedDict, total=False):
1111
account_id: Required[str]
1212
"""Account identifier tag."""
1313

14+
id: Required[str]
15+
"""Identifier"""
16+
1417
name: Required[str]
1518
"""Account name"""
1619

src/cloudflare/types/iam/permission_group_get_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class Meta(BaseModel):
1515

1616
class PermissionGroupGetResponse(BaseModel):
1717
id: str
18-
"""Identifier of the group."""
18+
"""Identifier of the permission group."""
1919

2020
meta: Optional[Meta] = None
2121
"""Attributes associated to the permission group."""
2222

2323
name: Optional[str] = None
24-
"""Name of the group."""
24+
"""Name of the permission group."""

src/cloudflare/types/iam/permission_group_list_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class Meta(BaseModel):
1515

1616
class PermissionGroupListResponse(BaseModel):
1717
id: str
18-
"""Identifier of the group."""
18+
"""Identifier of the permission group."""
1919

2020
meta: Optional[Meta] = None
2121
"""Attributes associated to the permission group."""
2222

2323
name: Optional[str] = None
24-
"""Name of the group."""
24+
"""Name of the permission group."""

src/cloudflare/types/iam/resource_group_get_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Meta(BaseModel):
3434

3535
class ResourceGroupGetResponse(BaseModel):
3636
id: str
37-
"""Identifier of the group."""
37+
"""Identifier of the resource group."""
3838

3939
scope: List[Scope]
4040
"""The scope associated to the resource group"""

src/cloudflare/types/iam/resource_group_list_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Meta(BaseModel):
3434

3535
class ResourceGroupListResponse(BaseModel):
3636
id: str
37-
"""Identifier of the group."""
37+
"""Identifier of the resource group."""
3838

3939
scope: List[Scope]
4040
"""The scope associated to the resource group"""

src/cloudflare/types/iam/resource_group_update_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Meta(BaseModel):
3434

3535
class ResourceGroupUpdateResponse(BaseModel):
3636
id: str
37-
"""Identifier of the group."""
37+
"""Identifier of the resource group."""
3838

3939
scope: List[Scope]
4040
"""The scope associated to the resource group"""

src/cloudflare/types/memberships/membership_get_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class PolicyPermissionGroupMeta(BaseModel):
5454

5555
class PolicyPermissionGroup(BaseModel):
5656
id: str
57-
"""Identifier of the group."""
57+
"""Identifier of the permission group."""
5858

5959
meta: Optional[PolicyPermissionGroupMeta] = None
6060
"""Attributes associated to the permission group."""
6161

6262
name: Optional[str] = None
63-
"""Name of the group."""
63+
"""Name of the permission group."""
6464

6565

6666
class PolicyResourceGroupScopeObject(BaseModel):
@@ -90,7 +90,7 @@ class PolicyResourceGroupMeta(BaseModel):
9090

9191
class PolicyResourceGroup(BaseModel):
9292
id: str
93-
"""Identifier of the group."""
93+
"""Identifier of the resource group."""
9494

9595
scope: List[PolicyResourceGroupScope]
9696
"""The scope associated to the resource group"""

src/cloudflare/types/memberships/membership_update_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class PolicyPermissionGroupMeta(BaseModel):
5454

5555
class PolicyPermissionGroup(BaseModel):
5656
id: str
57-
"""Identifier of the group."""
57+
"""Identifier of the permission group."""
5858

5959
meta: Optional[PolicyPermissionGroupMeta] = None
6060
"""Attributes associated to the permission group."""
6161

6262
name: Optional[str] = None
63-
"""Name of the group."""
63+
"""Name of the permission group."""
6464

6565

6666
class PolicyResourceGroupScopeObject(BaseModel):
@@ -90,7 +90,7 @@ class PolicyResourceGroupMeta(BaseModel):
9090

9191
class PolicyResourceGroup(BaseModel):
9292
id: str
93-
"""Identifier of the group."""
93+
"""Identifier of the resource group."""
9494

9595
scope: List[PolicyResourceGroupScope]
9696
"""The scope associated to the resource group"""

src/cloudflare/types/shared/member.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class PolicyPermissionGroupMeta(BaseModel):
2727

2828
class PolicyPermissionGroup(BaseModel):
2929
id: str
30-
"""Identifier of the group."""
30+
"""Identifier of the permission group."""
3131

3232
meta: Optional[PolicyPermissionGroupMeta] = None
3333
"""Attributes associated to the permission group."""
3434

3535
name: Optional[str] = None
36-
"""Name of the group."""
36+
"""Name of the permission group."""
3737

3838

3939
class PolicyResourceGroupScopeObject(BaseModel):
@@ -63,7 +63,7 @@ class PolicyResourceGroupMeta(BaseModel):
6363

6464
class PolicyResourceGroup(BaseModel):
6565
id: str
66-
"""Identifier of the group."""
66+
"""Identifier of the resource group."""
6767

6868
scope: List[PolicyResourceGroupScope]
6969
"""The scope associated to the resource group"""

src/cloudflare/types/shared/token_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ class PermissionGroupMeta(BaseModel):
1616

1717
class PermissionGroup(BaseModel):
1818
id: str
19-
"""Identifier of the group."""
19+
"""Identifier of the permission group."""
2020

2121
meta: Optional[PermissionGroupMeta] = None
2222
"""Attributes associated to the permission group."""
2323

2424
name: Optional[str] = None
25-
"""Name of the group."""
25+
"""Name of the permission group."""
2626

2727

2828
class TokenPolicy(BaseModel):

src/cloudflare/types/shared_params/token_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PermissionGroupMeta(TypedDict, total=False):
1616

1717
class PermissionGroup(TypedDict, total=False):
1818
id: Required[str]
19-
"""Identifier of the group."""
19+
"""Identifier of the permission group."""
2020

2121
meta: PermissionGroupMeta
2222
"""Attributes associated to the permission group."""

src/cloudflare/types/user/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
from .organization import Organization as Organization
77
from .user_edit_params import UserEditParams as UserEditParams
88
from .token_list_params import TokenListParams as TokenListParams
9+
from .user_get_response import UserGetResponse as UserGetResponse
910
from .invite_edit_params import InviteEditParams as InviteEditParams
11+
from .user_edit_response import UserEditResponse as UserEditResponse
1012
from .token_create_params import TokenCreateParams as TokenCreateParams
1113
from .token_update_params import TokenUpdateParams as TokenUpdateParams
1214
from .audit_log_list_params import AuditLogListParams as AuditLogListParams
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
5+
from ..._models import BaseModel
6+
from .organization import Organization
7+
8+
__all__ = ["UserEditResponse"]
9+
10+
11+
class UserEditResponse(BaseModel):
12+
id: Optional[str] = None
13+
"""Identifier of the user."""
14+
15+
betas: Optional[List[str]] = None
16+
"""Lists the betas that the user is participating in."""
17+
18+
country: Optional[str] = None
19+
"""The country in which the user lives."""
20+
21+
first_name: Optional[str] = None
22+
"""User's first name"""
23+
24+
has_business_zones: Optional[bool] = None
25+
"""Indicates whether user has any business zones"""
26+
27+
has_enterprise_zones: Optional[bool] = None
28+
"""Indicates whether user has any enterprise zones"""
29+
30+
has_pro_zones: Optional[bool] = None
31+
"""Indicates whether user has any pro zones"""
32+
33+
last_name: Optional[str] = None
34+
"""User's last name"""
35+
36+
organizations: Optional[List[Organization]] = None
37+
38+
suspended: Optional[bool] = None
39+
"""Indicates whether user has been suspended"""
40+
41+
telephone: Optional[str] = None
42+
"""User's telephone number"""
43+
44+
two_factor_authentication_enabled: Optional[bool] = None
45+
"""Indicates whether two-factor authentication is enabled for the user account.
46+
47+
Does not apply to API authentication.
48+
"""
49+
50+
two_factor_authentication_locked: Optional[bool] = None
51+
"""
52+
Indicates whether two-factor authentication is required by one of the accounts
53+
that the user is a member of.
54+
"""
55+
56+
zipcode: Optional[str] = None
57+
"""The zipcode or postal code where the user lives."""

0 commit comments

Comments
 (0)