Skip to content

Commit a138540

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#257)
1 parent c31e274 commit a138540

File tree

13 files changed

+81
-301
lines changed

13 files changed

+81
-301
lines changed

api.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -4771,24 +4771,21 @@ Types:
47714771
from cloudflare.types.zero_trust.devices import (
47724772
DeviceInput,
47734773
DeviceMatch,
4774+
DevicePostureRule,
47744775
UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930,
47754776
UnnamedSchemaRef41885dd46b9e0294254c49305a273681,
47764777
UnnamedSchemaRef9e35ef84511131488ae286ce78ac4b27,
4777-
PostureCreateResponse,
4778-
PostureUpdateResponse,
4779-
PostureListResponse,
47804778
PostureDeleteResponse,
4781-
PostureGetResponse,
47824779
)
47834780
```
47844781

47854782
Methods:
47864783

4787-
- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_create_response.py">Optional</a></code>
4788-
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_update_response.py">Optional</a></code>
4789-
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_list_response.py">SyncSinglePage[PostureListResponse]</a></code>
4784+
- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
4785+
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
4786+
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">SyncSinglePage[DevicePostureRule]</a></code>
47904787
- <code title="delete /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">delete</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_delete_response.py">Optional</a></code>
4791-
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_get_response.py">Optional</a></code>
4788+
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
47924789

47934790
#### Integrations
47944791

@@ -4903,7 +4900,6 @@ Types:
49034900

49044901
```python
49054902
from cloudflare.types.zero_trust import (
4906-
AccessDevicePostureRule,
49074903
AccessRule,
49084904
AnyValidServiceTokenRule,
49094905
AuthenticationMethodRule,

src/cloudflare/resources/zero_trust/devices/posture/posture.py

+19-22
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@
3737
from .....types.zero_trust.devices import (
3838
DeviceInputParam,
3939
DeviceMatchParam,
40-
PostureGetResponse,
41-
PostureListResponse,
42-
PostureCreateResponse,
40+
DevicePostureRule,
4341
PostureDeleteResponse,
44-
PostureUpdateResponse,
4542
posture_create_params,
4643
posture_delete_params,
4744
posture_update_params,
@@ -100,7 +97,7 @@ def create(
10097
extra_query: Query | None = None,
10198
extra_body: Body | None = None,
10299
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
103-
) -> Optional[PostureCreateResponse]:
100+
) -> Optional[DevicePostureRule]:
104101
"""
105102
Creates a new device posture rule.
106103
@@ -152,7 +149,7 @@ def create(
152149
timeout=timeout,
153150
post_parser=ResultWrapper._unwrapper,
154151
),
155-
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
152+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
156153
)
157154

158155
def update(
@@ -193,7 +190,7 @@ def update(
193190
extra_query: Query | None = None,
194191
extra_body: Body | None = None,
195192
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
196-
) -> Optional[PostureUpdateResponse]:
193+
) -> Optional[DevicePostureRule]:
197194
"""
198195
Updates a device posture rule.
199196
@@ -249,7 +246,7 @@ def update(
249246
timeout=timeout,
250247
post_parser=ResultWrapper._unwrapper,
251248
),
252-
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
249+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
253250
)
254251

255252
def list(
@@ -262,7 +259,7 @@ def list(
262259
extra_query: Query | None = None,
263260
extra_body: Body | None = None,
264261
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
265-
) -> SyncSinglePage[PostureListResponse]:
262+
) -> SyncSinglePage[DevicePostureRule]:
266263
"""
267264
Fetches device posture rules for a Zero Trust account.
268265
@@ -279,11 +276,11 @@ def list(
279276
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
280277
return self._get_api_list(
281278
f"/accounts/{account_id}/devices/posture",
282-
page=SyncSinglePage[PostureListResponse],
279+
page=SyncSinglePage[DevicePostureRule],
283280
options=make_request_options(
284281
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
285282
),
286-
model=PostureListResponse,
283+
model=DevicePostureRule,
287284
)
288285

289286
def delete(
@@ -341,7 +338,7 @@ def get(
341338
extra_query: Query | None = None,
342339
extra_body: Body | None = None,
343340
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
344-
) -> Optional[PostureGetResponse]:
341+
) -> Optional[DevicePostureRule]:
345342
"""
346343
Fetches a single device posture rule.
347344
@@ -369,7 +366,7 @@ def get(
369366
timeout=timeout,
370367
post_parser=ResultWrapper._unwrapper,
371368
),
372-
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
369+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
373370
)
374371

375372

@@ -423,7 +420,7 @@ async def create(
423420
extra_query: Query | None = None,
424421
extra_body: Body | None = None,
425422
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
426-
) -> Optional[PostureCreateResponse]:
423+
) -> Optional[DevicePostureRule]:
427424
"""
428425
Creates a new device posture rule.
429426
@@ -475,7 +472,7 @@ async def create(
475472
timeout=timeout,
476473
post_parser=ResultWrapper._unwrapper,
477474
),
478-
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
475+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
479476
)
480477

481478
async def update(
@@ -516,7 +513,7 @@ async def update(
516513
extra_query: Query | None = None,
517514
extra_body: Body | None = None,
518515
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
519-
) -> Optional[PostureUpdateResponse]:
516+
) -> Optional[DevicePostureRule]:
520517
"""
521518
Updates a device posture rule.
522519
@@ -572,7 +569,7 @@ async def update(
572569
timeout=timeout,
573570
post_parser=ResultWrapper._unwrapper,
574571
),
575-
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
572+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
576573
)
577574

578575
def list(
@@ -585,7 +582,7 @@ def list(
585582
extra_query: Query | None = None,
586583
extra_body: Body | None = None,
587584
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
588-
) -> AsyncPaginator[PostureListResponse, AsyncSinglePage[PostureListResponse]]:
585+
) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]:
589586
"""
590587
Fetches device posture rules for a Zero Trust account.
591588
@@ -602,11 +599,11 @@ def list(
602599
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
603600
return self._get_api_list(
604601
f"/accounts/{account_id}/devices/posture",
605-
page=AsyncSinglePage[PostureListResponse],
602+
page=AsyncSinglePage[DevicePostureRule],
606603
options=make_request_options(
607604
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
608605
),
609-
model=PostureListResponse,
606+
model=DevicePostureRule,
610607
)
611608

612609
async def delete(
@@ -664,7 +661,7 @@ async def get(
664661
extra_query: Query | None = None,
665662
extra_body: Body | None = None,
666663
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
667-
) -> Optional[PostureGetResponse]:
664+
) -> Optional[DevicePostureRule]:
668665
"""
669666
Fetches a single device posture rule.
670667
@@ -692,7 +689,7 @@ async def get(
692689
timeout=timeout,
693690
post_parser=ResultWrapper._unwrapper,
694691
),
695-
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
692+
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
696693
)
697694

698695

src/cloudflare/types/zero_trust/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule
5858
from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule
5959
from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam
60-
from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule
6160
from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule
6261
from .generic_oauth_config_param import GenericOAuthConfigParam as GenericOAuthConfigParam
6362
from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams
@@ -68,7 +67,6 @@
6867
from .identity_provider_create_params import IdentityProviderCreateParams as IdentityProviderCreateParams
6968
from .identity_provider_list_response import IdentityProviderListResponse as IdentityProviderListResponse
7069
from .identity_provider_update_params import IdentityProviderUpdateParams as IdentityProviderUpdateParams
71-
from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam
7270
from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam
7371
from .connectivity_setting_edit_params import ConnectivitySettingEditParams as ConnectivitySettingEditParams
7472
from .organization_revoke_users_params import OrganizationRevokeUsersParams as OrganizationRevokeUsersParams

src/cloudflare/types/zero_trust/access_device_posture_rule.py

-14
This file was deleted.

src/cloudflare/types/zero_trust/access_device_posture_rule_param.py

-16
This file was deleted.

src/cloudflare/types/zero_trust/access_rule.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Union
44

55
from .ip_rule import IPRule
6+
from ..._models import BaseModel
67
from .email_rule import EmailRule
78
from .group_rule import GroupRule
89
from .domain_rule import DomainRule
@@ -18,11 +19,20 @@
1819
from .service_token_rule import ServiceTokenRule
1920
from .external_evaluation_rule import ExternalEvaluationRule
2021
from .github_organization_rule import GitHubOrganizationRule
21-
from .access_device_posture_rule import AccessDevicePostureRule
2222
from .authentication_method_rule import AuthenticationMethodRule
2323
from .any_valid_service_token_rule import AnyValidServiceTokenRule
2424

25-
__all__ = ["AccessRule"]
25+
__all__ = ["AccessRule", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"]
26+
27+
28+
class AccessDevicePostureRuleDevicePosture(BaseModel):
29+
integration_uid: str
30+
"""The ID of a device posture integration."""
31+
32+
33+
class AccessDevicePostureRule(BaseModel):
34+
device_posture: AccessDevicePostureRuleDevicePosture
35+
2636

2737
AccessRule = Union[
2838
EmailRule,

src/cloudflare/types/zero_trust/access_rule_param.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union
6+
from typing_extensions import Required, TypedDict
67

78
from .ip_rule_param import IPRuleParam
89
from .email_rule_param import EmailRuleParam
@@ -20,11 +21,20 @@
2021
from .service_token_rule_param import ServiceTokenRuleParam
2122
from .external_evaluation_rule_param import ExternalEvaluationRuleParam
2223
from .github_organization_rule_param import GitHubOrganizationRuleParam
23-
from .access_device_posture_rule_param import AccessDevicePostureRuleParam
2424
from .authentication_method_rule_param import AuthenticationMethodRuleParam
2525
from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam
2626

27-
__all__ = ["AccessRuleParam"]
27+
__all__ = ["AccessRuleParam", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"]
28+
29+
30+
class AccessDevicePostureRuleDevicePosture(TypedDict, total=False):
31+
integration_uid: Required[str]
32+
"""The ID of a device posture integration."""
33+
34+
35+
class AccessDevicePostureRule(TypedDict, total=False):
36+
device_posture: Required[AccessDevicePostureRuleDevicePosture]
37+
2838

2939
AccessRuleParam = Union[
3040
EmailRuleParam,
@@ -45,5 +55,5 @@
4555
ExternalEvaluationRuleParam,
4656
CountryRuleParam,
4757
AuthenticationMethodRuleParam,
48-
AccessDevicePostureRuleParam,
58+
AccessDevicePostureRule,
4959
]

src/cloudflare/types/zero_trust/devices/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,23 @@
1313
from .device_input_param import DeviceInputParam as DeviceInputParam
1414
from .device_match_param import DeviceMatchParam as DeviceMatchParam
1515
from .policy_edit_params import PolicyEditParams as PolicyEditParams
16+
from .device_posture_rule import DevicePostureRule as DevicePostureRule
1617
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
1718
from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams
18-
from .posture_get_response import PostureGetResponse as PostureGetResponse
1919
from .revoke_create_params import RevokeCreateParams as RevokeCreateParams
2020
from .network_create_params import NetworkCreateParams as NetworkCreateParams
2121
from .network_delete_params import NetworkDeleteParams as NetworkDeleteParams
2222
from .network_update_params import NetworkUpdateParams as NetworkUpdateParams
2323
from .posture_create_params import PostureCreateParams as PostureCreateParams
2424
from .posture_delete_params import PostureDeleteParams as PostureDeleteParams
25-
from .posture_list_response import PostureListResponse as PostureListResponse
2625
from .posture_update_params import PostureUpdateParams as PostureUpdateParams
2726
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
2827
from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams
2928
from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams
3029
from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse
3130
from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams
3231
from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse
33-
from .posture_create_response import PostureCreateResponse as PostureCreateResponse
3432
from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse
35-
from .posture_update_response import PostureUpdateResponse as PostureUpdateResponse
3633
from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse
3734
from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse
3835
from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import (

src/cloudflare/types/zero_trust/devices/posture_get_response.py src/cloudflare/types/zero_trust/devices/device_posture_rule.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from .device_input import DeviceInput
88
from .device_match import DeviceMatch
99

10-
__all__ = ["PostureGetResponse"]
10+
__all__ = ["DevicePostureRule"]
1111

1212

13-
class PostureGetResponse(BaseModel):
13+
class DevicePostureRule(BaseModel):
1414
id: Optional[str] = None
1515
"""API UUID."""
1616

0 commit comments

Comments
 (0)