Skip to content

Commit c31e274

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

File tree

8 files changed

+263
-56
lines changed

8 files changed

+263
-56
lines changed

api.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -4771,21 +4771,24 @@ Types:
47714771
from cloudflare.types.zero_trust.devices import (
47724772
DeviceInput,
47734773
DeviceMatch,
4774-
DevicePostureRule,
47754774
UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930,
47764775
UnnamedSchemaRef41885dd46b9e0294254c49305a273681,
47774776
UnnamedSchemaRef9e35ef84511131488ae286ce78ac4b27,
4777+
PostureCreateResponse,
4778+
PostureUpdateResponse,
4779+
PostureListResponse,
47784780
PostureDeleteResponse,
4781+
PostureGetResponse,
47794782
)
47804783
```
47814784

47824785
Methods:
47834786

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>
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>
47874790
- <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>
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>
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>
47894792

47904793
#### Integrations
47914794

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

+22-19
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@
3737
from .....types.zero_trust.devices import (
3838
DeviceInputParam,
3939
DeviceMatchParam,
40-
DevicePostureRule,
40+
PostureGetResponse,
41+
PostureListResponse,
42+
PostureCreateResponse,
4143
PostureDeleteResponse,
44+
PostureUpdateResponse,
4245
posture_create_params,
4346
posture_delete_params,
4447
posture_update_params,
@@ -97,7 +100,7 @@ def create(
97100
extra_query: Query | None = None,
98101
extra_body: Body | None = None,
99102
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
100-
) -> Optional[DevicePostureRule]:
103+
) -> Optional[PostureCreateResponse]:
101104
"""
102105
Creates a new device posture rule.
103106
@@ -149,7 +152,7 @@ def create(
149152
timeout=timeout,
150153
post_parser=ResultWrapper._unwrapper,
151154
),
152-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
155+
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
153156
)
154157

155158
def update(
@@ -190,7 +193,7 @@ def update(
190193
extra_query: Query | None = None,
191194
extra_body: Body | None = None,
192195
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
193-
) -> Optional[DevicePostureRule]:
196+
) -> Optional[PostureUpdateResponse]:
194197
"""
195198
Updates a device posture rule.
196199
@@ -246,7 +249,7 @@ def update(
246249
timeout=timeout,
247250
post_parser=ResultWrapper._unwrapper,
248251
),
249-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
252+
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
250253
)
251254

252255
def list(
@@ -259,7 +262,7 @@ def list(
259262
extra_query: Query | None = None,
260263
extra_body: Body | None = None,
261264
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
262-
) -> SyncSinglePage[DevicePostureRule]:
265+
) -> SyncSinglePage[PostureListResponse]:
263266
"""
264267
Fetches device posture rules for a Zero Trust account.
265268
@@ -276,11 +279,11 @@ def list(
276279
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
277280
return self._get_api_list(
278281
f"/accounts/{account_id}/devices/posture",
279-
page=SyncSinglePage[DevicePostureRule],
282+
page=SyncSinglePage[PostureListResponse],
280283
options=make_request_options(
281284
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
282285
),
283-
model=DevicePostureRule,
286+
model=PostureListResponse,
284287
)
285288

286289
def delete(
@@ -338,7 +341,7 @@ def get(
338341
extra_query: Query | None = None,
339342
extra_body: Body | None = None,
340343
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
341-
) -> Optional[DevicePostureRule]:
344+
) -> Optional[PostureGetResponse]:
342345
"""
343346
Fetches a single device posture rule.
344347
@@ -366,7 +369,7 @@ def get(
366369
timeout=timeout,
367370
post_parser=ResultWrapper._unwrapper,
368371
),
369-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
372+
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
370373
)
371374

372375

@@ -420,7 +423,7 @@ async def create(
420423
extra_query: Query | None = None,
421424
extra_body: Body | None = None,
422425
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
423-
) -> Optional[DevicePostureRule]:
426+
) -> Optional[PostureCreateResponse]:
424427
"""
425428
Creates a new device posture rule.
426429
@@ -472,7 +475,7 @@ async def create(
472475
timeout=timeout,
473476
post_parser=ResultWrapper._unwrapper,
474477
),
475-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
478+
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
476479
)
477480

478481
async def update(
@@ -513,7 +516,7 @@ async def update(
513516
extra_query: Query | None = None,
514517
extra_body: Body | None = None,
515518
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
516-
) -> Optional[DevicePostureRule]:
519+
) -> Optional[PostureUpdateResponse]:
517520
"""
518521
Updates a device posture rule.
519522
@@ -569,7 +572,7 @@ async def update(
569572
timeout=timeout,
570573
post_parser=ResultWrapper._unwrapper,
571574
),
572-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
575+
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
573576
)
574577

575578
def list(
@@ -582,7 +585,7 @@ def list(
582585
extra_query: Query | None = None,
583586
extra_body: Body | None = None,
584587
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
585-
) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]:
588+
) -> AsyncPaginator[PostureListResponse, AsyncSinglePage[PostureListResponse]]:
586589
"""
587590
Fetches device posture rules for a Zero Trust account.
588591
@@ -599,11 +602,11 @@ def list(
599602
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
600603
return self._get_api_list(
601604
f"/accounts/{account_id}/devices/posture",
602-
page=AsyncSinglePage[DevicePostureRule],
605+
page=AsyncSinglePage[PostureListResponse],
603606
options=make_request_options(
604607
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
605608
),
606-
model=DevicePostureRule,
609+
model=PostureListResponse,
607610
)
608611

609612
async def delete(
@@ -661,7 +664,7 @@ async def get(
661664
extra_query: Query | None = None,
662665
extra_body: Body | None = None,
663666
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
664-
) -> Optional[DevicePostureRule]:
667+
) -> Optional[PostureGetResponse]:
665668
"""
666669
Fetches a single device posture rule.
667670
@@ -689,7 +692,7 @@ async def get(
689692
timeout=timeout,
690693
post_parser=ResultWrapper._unwrapper,
691694
),
692-
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
695+
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
693696
)
694697

695698

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,26 @@
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
1716
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
1817
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
2526
from .posture_update_params import PostureUpdateParams as PostureUpdateParams
2627
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
2728
from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams
2829
from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams
2930
from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse
3031
from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams
3132
from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse
33+
from .posture_create_response import PostureCreateResponse as PostureCreateResponse
3234
from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse
35+
from .posture_update_response import PostureUpdateResponse as PostureUpdateResponse
3336
from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse
3437
from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse
3538
from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from typing_extensions import Literal
5+
6+
from ...._models import BaseModel
7+
from .device_input import DeviceInput
8+
from .device_match import DeviceMatch
9+
10+
__all__ = ["PostureCreateResponse"]
11+
12+
13+
class PostureCreateResponse(BaseModel):
14+
id: Optional[str] = None
15+
"""API UUID."""
16+
17+
description: Optional[str] = None
18+
"""The description of the device posture rule."""
19+
20+
expiration: Optional[str] = None
21+
"""Sets the expiration time for a posture check result.
22+
23+
If empty, the result remains valid until it is overwritten by new data from the
24+
WARP client.
25+
"""
26+
27+
input: Optional[DeviceInput] = None
28+
"""The value to be checked against."""
29+
30+
match: Optional[List[DeviceMatch]] = None
31+
"""The conditions that the client must match to run the rule."""
32+
33+
name: Optional[str] = None
34+
"""The name of the device posture rule."""
35+
36+
schedule: Optional[str] = None
37+
"""Polling frequency for the WARP client posture check.
38+
39+
Default: `5m` (poll every five minutes). Minimum: `1m`.
40+
"""
41+
42+
type: Optional[
43+
Literal[
44+
"file",
45+
"application",
46+
"tanium",
47+
"gateway",
48+
"warp",
49+
"disk_encryption",
50+
"sentinelone",
51+
"carbonblack",
52+
"firewall",
53+
"os_version",
54+
"domain_joined",
55+
"client_certificate",
56+
"unique_client_id",
57+
"kolide",
58+
"tanium_s2s",
59+
"crowdstrike_s2s",
60+
"intune",
61+
"workspace_one",
62+
"sentinelone_s2s",
63+
]
64+
] = None
65+
"""The type of device posture rule."""

src/cloudflare/types/zero_trust/devices/device_posture_rule.py src/cloudflare/types/zero_trust/devices/posture_get_response.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__ = ["DevicePostureRule"]
10+
__all__ = ["PostureGetResponse"]
1111

1212

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from typing_extensions import Literal
5+
6+
from ...._models import BaseModel
7+
from .device_input import DeviceInput
8+
from .device_match import DeviceMatch
9+
10+
__all__ = ["PostureListResponse"]
11+
12+
13+
class PostureListResponse(BaseModel):
14+
id: Optional[str] = None
15+
"""API UUID."""
16+
17+
description: Optional[str] = None
18+
"""The description of the device posture rule."""
19+
20+
expiration: Optional[str] = None
21+
"""Sets the expiration time for a posture check result.
22+
23+
If empty, the result remains valid until it is overwritten by new data from the
24+
WARP client.
25+
"""
26+
27+
input: Optional[DeviceInput] = None
28+
"""The value to be checked against."""
29+
30+
match: Optional[List[DeviceMatch]] = None
31+
"""The conditions that the client must match to run the rule."""
32+
33+
name: Optional[str] = None
34+
"""The name of the device posture rule."""
35+
36+
schedule: Optional[str] = None
37+
"""Polling frequency for the WARP client posture check.
38+
39+
Default: `5m` (poll every five minutes). Minimum: `1m`.
40+
"""
41+
42+
type: Optional[
43+
Literal[
44+
"file",
45+
"application",
46+
"tanium",
47+
"gateway",
48+
"warp",
49+
"disk_encryption",
50+
"sentinelone",
51+
"carbonblack",
52+
"firewall",
53+
"os_version",
54+
"domain_joined",
55+
"client_certificate",
56+
"unique_client_id",
57+
"kolide",
58+
"tanium_s2s",
59+
"crowdstrike_s2s",
60+
"intune",
61+
"workspace_one",
62+
"sentinelone_s2s",
63+
]
64+
] = None
65+
"""The type of device posture rule."""

0 commit comments

Comments
 (0)