Skip to content

Commit e4f36e1

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#286)
1 parent ad4380d commit e4f36e1

Some content is hidden

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

62 files changed

+529
-900
lines changed

api.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
```python
44
from cloudflare.types import (
5+
AuditLog,
56
ErrorData,
7+
IamRole,
68
Identifier,
79
LoadBalancerPreview,
810
PaginationInfo,
@@ -52,12 +54,12 @@ Methods:
5254
Types:
5355

5456
```python
55-
from cloudflare.types.accounts import PermissionGrant, RoleListResponse, RoleGetResponse
57+
from cloudflare.types.accounts import PermissionGrant, RoleGetResponse
5658
```
5759

5860
Methods:
5961

60-
- <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>
62+
- <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/iam_role.py">SyncSinglePage[IamRole]</a></code>
6163
- <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">RoleGetResponse</a></code>
6264

6365
# OriginCACertificates
@@ -127,15 +129,9 @@ Methods:
127129

128130
## AuditLogs
129131

130-
Types:
131-
132-
```python
133-
from cloudflare.types.user import AuditLogListResponse
134-
```
135-
136132
Methods:
137133

138-
- <code title="get /user/audit_logs">client.user.audit_logs.<a href="./src/cloudflare/resources/user/audit_logs.py">list</a>(\*\*<a href="src/cloudflare/types/user/audit_log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/user/audit_log_list_response.py">SyncV4PagePaginationArray[AuditLogListResponse]</a></code>
134+
- <code title="get /user/audit_logs">client.user.audit_logs.<a href="./src/cloudflare/resources/user/audit_logs.py">list</a>(\*\*<a href="src/cloudflare/types/user/audit_log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/shared/audit_log.py">SyncV4PagePaginationArray[AuditLog]</a></code>
139135

140136
## Billing
141137

@@ -197,7 +193,11 @@ Types:
197193

198194
```python
199195
from cloudflare.types.user import (
196+
RatePlan,
200197
Subscription,
198+
SubscriptionComponent,
199+
SubscriptionComponentValue,
200+
SubscriptionZone,
201201
SubscriptionUpdateResponse,
202202
SubscriptionDeleteResponse,
203203
SubscriptionEditResponse,
@@ -3019,6 +3019,8 @@ Types:
30193019

30203020
```python
30213021
from cloudflare.types import (
3022+
RequestRule,
3023+
ResponeRule,
30223024
Ruleset,
30233025
RulesetCreateResponse,
30243026
RulesetUpdateResponse,
@@ -3382,15 +3384,9 @@ Methods:
33823384

33833385
# AuditLogs
33843386

3385-
Types:
3386-
3387-
```python
3388-
from cloudflare.types import AuditLogListResponse
3389-
```
3390-
33913387
Methods:
33923388

3393-
- <code title="get /accounts/{account_id}/audit_logs">client.audit_logs.<a href="./src/cloudflare/resources/audit_logs.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/audit_log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/audit_log_list_response.py">SyncV4PagePaginationArray[AuditLogListResponse]</a></code>
3389+
- <code title="get /accounts/{account_id}/audit_logs">client.audit_logs.<a href="./src/cloudflare/resources/audit_logs.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/audit_log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/shared/audit_log.py">SyncV4PagePaginationArray[AuditLog]</a></code>
33943390

33953391
# Billing
33963392

@@ -5435,7 +5431,7 @@ Methods:
54355431
Types:
54365432

54375433
```python
5438-
from cloudflare.types.zero_trust import Tunnel, WARPConnectorTunnel
5434+
from cloudflare.types.zero_trust import Tunnel, TunnelConnection, WARPConnectorTunnel
54395435
```
54405436

54415437
Methods:

src/cloudflare/resources/accounts/members.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
)
2929
from ...types.accounts import (
3030
Member,
31+
MemberRoleParam,
3132
MemberListResponse,
3233
MemberDeleteResponse,
3334
MemberWithInviteCode,
@@ -104,7 +105,7 @@ def update(
104105
member_id: str,
105106
*,
106107
account_id: object,
107-
roles: Iterable[member_update_params.Role],
108+
roles: Iterable[MemberRoleParam],
108109
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
109110
# The extra values given here take precedence over values defined on the client or passed to this method.
110111
extra_headers: Headers | None = None,
@@ -350,7 +351,7 @@ async def update(
350351
member_id: str,
351352
*,
352353
account_id: object,
353-
roles: Iterable[member_update_params.Role],
354+
roles: Iterable[MemberRoleParam],
354355
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
355356
# The extra values given here take precedence over values defined on the client or passed to this method.
356357
extra_headers: Headers | None = None,

src/cloudflare/resources/accounts/roles.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
AsyncPaginator,
2222
make_request_options,
2323
)
24-
from ...types.accounts import RoleGetResponse, RoleListResponse
24+
from ...types.shared import IamRole
25+
from ...types.accounts import RoleGetResponse
2526

2627
__all__ = ["Roles", "AsyncRoles"]
2728

@@ -45,7 +46,7 @@ def list(
4546
extra_query: Query | None = None,
4647
extra_body: Body | None = None,
4748
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
48-
) -> SyncSinglePage[RoleListResponse]:
49+
) -> SyncSinglePage[IamRole]:
4950
"""
5051
Get all available roles for an account.
5152
@@ -60,11 +61,11 @@ def list(
6061
"""
6162
return self._get_api_list(
6263
f"/accounts/{account_id}/roles",
63-
page=SyncSinglePage[RoleListResponse],
64+
page=SyncSinglePage[IamRole],
6465
options=make_request_options(
6566
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
6667
),
67-
model=RoleListResponse,
68+
model=IamRole,
6869
)
6970

7071
def get(
@@ -128,7 +129,7 @@ def list(
128129
extra_query: Query | None = None,
129130
extra_body: Body | None = None,
130131
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
131-
) -> AsyncPaginator[RoleListResponse, AsyncSinglePage[RoleListResponse]]:
132+
) -> AsyncPaginator[IamRole, AsyncSinglePage[IamRole]]:
132133
"""
133134
Get all available roles for an account.
134135
@@ -143,11 +144,11 @@ def list(
143144
"""
144145
return self._get_api_list(
145146
f"/accounts/{account_id}/roles",
146-
page=AsyncSinglePage[RoleListResponse],
147+
page=AsyncSinglePage[IamRole],
147148
options=make_request_options(
148149
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
149150
),
150-
model=RoleListResponse,
151+
model=IamRole,
151152
)
152153

153154
async def get(

src/cloudflare/resources/audit_logs.py

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

99
import httpx
1010

11-
from ..types import AuditLogListResponse, audit_log_list_params
11+
from ..types import audit_log_list_params
1212
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1313
from .._utils import maybe_transform
1414
from .._compat import cached_property
@@ -24,6 +24,7 @@
2424
AsyncPaginator,
2525
make_request_options,
2626
)
27+
from ..types.shared import AuditLog
2728

2829
__all__ = ["AuditLogs", "AsyncAuditLogs"]
2930

@@ -58,7 +59,7 @@ def list(
5859
extra_query: Query | None = None,
5960
extra_body: Body | None = None,
6061
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61-
) -> SyncV4PagePaginationArray[AuditLogListResponse]:
62+
) -> SyncV4PagePaginationArray[AuditLog]:
6263
"""Gets a list of audit logs for an account.
6364
6465
Can be filtered by who made the
@@ -97,7 +98,7 @@ def list(
9798
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
9899
return self._get_api_list(
99100
f"/accounts/{account_id}/audit_logs",
100-
page=SyncV4PagePaginationArray[AuditLogListResponse],
101+
page=SyncV4PagePaginationArray[AuditLog],
101102
options=make_request_options(
102103
extra_headers=extra_headers,
103104
extra_query=extra_query,
@@ -120,7 +121,7 @@ def list(
120121
audit_log_list_params.AuditLogListParams,
121122
),
122123
),
123-
model=AuditLogListResponse,
124+
model=AuditLog,
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[AuditLogListResponse, AsyncV4PagePaginationArray[AuditLogListResponse]]:
158+
) -> AsyncPaginator[AuditLog, AsyncV4PagePaginationArray[AuditLog]]:
158159
"""Gets a list of audit logs for an account.
159160
160161
Can be filtered by who made the
@@ -193,7 +194,7 @@ def list(
193194
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
194195
return self._get_api_list(
195196
f"/accounts/{account_id}/audit_logs",
196-
page=AsyncV4PagePaginationArray[AuditLogListResponse],
197+
page=AsyncV4PagePaginationArray[AuditLog],
197198
options=make_request_options(
198199
extra_headers=extra_headers,
199200
extra_query=extra_query,
@@ -216,7 +217,7 @@ def list(
216217
audit_log_list_params.AuditLogListParams,
217218
),
218219
),
219-
model=AuditLogListResponse,
220+
model=AuditLog,
220221
)
221222

222223

src/cloudflare/resources/rulesets/phases/phases.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import httpx
99

10+
from ....types import RequestRuleParam
1011
from .versions import (
1112
Versions,
1213
AsyncVersions,
@@ -78,7 +79,7 @@ def update(
7879
"magic_transit_managed",
7980
],
8081
*,
81-
rules: Iterable[phase_update_params.Rule],
82+
rules: Iterable[RequestRuleParam],
8283
account_id: str | NotGiven = NOT_GIVEN,
8384
zone_id: str | NotGiven = NOT_GIVEN,
8485
description: str | NotGiven = NOT_GIVEN,
@@ -311,7 +312,7 @@ async def update(
311312
"magic_transit_managed",
312313
],
313314
*,
314-
rules: Iterable[phase_update_params.Rule],
315+
rules: Iterable[RequestRuleParam],
315316
account_id: str | NotGiven = NOT_GIVEN,
316317
zone_id: str | NotGiven = NOT_GIVEN,
317318
description: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/rulesets/rulesets.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
)
2626
from ...types import (
2727
Ruleset,
28+
RequestRuleParam,
2829
RulesetGetResponse,
2930
RulesetCreateResponse,
3031
RulesetUpdateResponse,
@@ -115,7 +116,7 @@ def create(
115116
"magic_transit_ids_managed",
116117
"magic_transit_managed",
117118
],
118-
rules: Iterable[ruleset_create_params.Rule],
119+
rules: Iterable[RequestRuleParam],
119120
account_id: str | NotGiven = NOT_GIVEN,
120121
zone_id: str | NotGiven = NOT_GIVEN,
121122
description: str | NotGiven = NOT_GIVEN,
@@ -193,7 +194,7 @@ def update(
193194
self,
194195
ruleset_id: str,
195196
*,
196-
rules: Iterable[ruleset_update_params.Rule],
197+
rules: Iterable[RequestRuleParam],
197198
account_id: str | NotGiven = NOT_GIVEN,
198199
zone_id: str | NotGiven = NOT_GIVEN,
199200
description: str | NotGiven = NOT_GIVEN,
@@ -520,7 +521,7 @@ async def create(
520521
"magic_transit_ids_managed",
521522
"magic_transit_managed",
522523
],
523-
rules: Iterable[ruleset_create_params.Rule],
524+
rules: Iterable[RequestRuleParam],
524525
account_id: str | NotGiven = NOT_GIVEN,
525526
zone_id: str | NotGiven = NOT_GIVEN,
526527
description: str | NotGiven = NOT_GIVEN,
@@ -598,7 +599,7 @@ async def update(
598599
self,
599600
ruleset_id: str,
600601
*,
601-
rules: Iterable[ruleset_update_params.Rule],
602+
rules: Iterable[RequestRuleParam],
602603
account_id: str | NotGiven = NOT_GIVEN,
603604
zone_id: str | NotGiven = NOT_GIVEN,
604605
description: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/subscriptions.py

+18-13
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
)
3232
from .._wrappers import ResultWrapper
3333
from ..pagination import SyncSinglePage, AsyncSinglePage
34-
from ..types.user import Subscription
34+
from ..types.user import (
35+
Subscription,
36+
RatePlanParam,
37+
SubscriptionZoneParam,
38+
SubscriptionComponentParam,
39+
)
3540
from .._base_client import (
3641
AsyncPaginator,
3742
make_request_options,
@@ -54,10 +59,10 @@ def create(
5459
identifier: str,
5560
*,
5661
app: subscription_create_params.App | NotGiven = NOT_GIVEN,
57-
component_values: Iterable[subscription_create_params.ComponentValue] | NotGiven = NOT_GIVEN,
62+
component_values: Iterable[SubscriptionComponentParam] | NotGiven = NOT_GIVEN,
5863
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
59-
rate_plan: subscription_create_params.RatePlan | NotGiven = NOT_GIVEN,
60-
zone: subscription_create_params.Zone | NotGiven = NOT_GIVEN,
64+
rate_plan: RatePlanParam | NotGiven = NOT_GIVEN,
65+
zone: SubscriptionZoneParam | NotGiven = NOT_GIVEN,
6166
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6267
# The extra values given here take precedence over values defined on the client or passed to this method.
6368
extra_headers: Headers | None = None,
@@ -122,10 +127,10 @@ def update(
122127
*,
123128
account_identifier: str,
124129
app: subscription_update_params.App | NotGiven = NOT_GIVEN,
125-
component_values: Iterable[subscription_update_params.ComponentValue] | NotGiven = NOT_GIVEN,
130+
component_values: Iterable[SubscriptionComponentParam] | NotGiven = NOT_GIVEN,
126131
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
127-
rate_plan: subscription_update_params.RatePlan | NotGiven = NOT_GIVEN,
128-
zone: subscription_update_params.Zone | NotGiven = NOT_GIVEN,
132+
rate_plan: RatePlanParam | NotGiven = NOT_GIVEN,
133+
zone: SubscriptionZoneParam | NotGiven = NOT_GIVEN,
129134
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130135
# The extra values given here take precedence over values defined on the client or passed to this method.
131136
extra_headers: Headers | None = None,
@@ -333,10 +338,10 @@ async def create(
333338
identifier: str,
334339
*,
335340
app: subscription_create_params.App | NotGiven = NOT_GIVEN,
336-
component_values: Iterable[subscription_create_params.ComponentValue] | NotGiven = NOT_GIVEN,
341+
component_values: Iterable[SubscriptionComponentParam] | NotGiven = NOT_GIVEN,
337342
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
338-
rate_plan: subscription_create_params.RatePlan | NotGiven = NOT_GIVEN,
339-
zone: subscription_create_params.Zone | NotGiven = NOT_GIVEN,
343+
rate_plan: RatePlanParam | NotGiven = NOT_GIVEN,
344+
zone: SubscriptionZoneParam | NotGiven = NOT_GIVEN,
340345
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341346
# The extra values given here take precedence over values defined on the client or passed to this method.
342347
extra_headers: Headers | None = None,
@@ -401,10 +406,10 @@ async def update(
401406
*,
402407
account_identifier: str,
403408
app: subscription_update_params.App | NotGiven = NOT_GIVEN,
404-
component_values: Iterable[subscription_update_params.ComponentValue] | NotGiven = NOT_GIVEN,
409+
component_values: Iterable[SubscriptionComponentParam] | NotGiven = NOT_GIVEN,
405410
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN,
406-
rate_plan: subscription_update_params.RatePlan | NotGiven = NOT_GIVEN,
407-
zone: subscription_update_params.Zone | NotGiven = NOT_GIVEN,
411+
rate_plan: RatePlanParam | NotGiven = NOT_GIVEN,
412+
zone: SubscriptionZoneParam | NotGiven = NOT_GIVEN,
408413
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
409414
# The extra values given here take precedence over values defined on the client or passed to this method.
410415
extra_headers: Headers | None = None,

0 commit comments

Comments
 (0)