From a13854073aaea4ef65d3da1365f778d7955551cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:35:07 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#257) --- api.md | 14 ++-- .../zero_trust/devices/posture/posture.py | 41 ++++++------ src/cloudflare/types/zero_trust/__init__.py | 2 - .../zero_trust/access_device_posture_rule.py | 14 ---- .../access_device_posture_rule_param.py | 16 ----- .../types/zero_trust/access_rule.py | 14 +++- .../types/zero_trust/access_rule_param.py | 16 ++++- .../types/zero_trust/devices/__init__.py | 5 +- ...get_response.py => device_posture_rule.py} | 4 +- .../devices/posture_create_response.py | 65 ------------------- .../devices/posture_list_response.py | 65 ------------------- .../devices/posture_update_response.py | 65 ------------------- .../zero_trust/devices/test_posture.py | 61 +++++++++-------- 13 files changed, 81 insertions(+), 301 deletions(-) delete mode 100644 src/cloudflare/types/zero_trust/access_device_posture_rule.py delete mode 100644 src/cloudflare/types/zero_trust/access_device_posture_rule_param.py rename src/cloudflare/types/zero_trust/devices/{posture_get_response.py => device_posture_rule.py} (95%) delete mode 100644 src/cloudflare/types/zero_trust/devices/posture_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/posture_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/posture_update_response.py diff --git a/api.md b/api.md index 8e9f0ea583e..d21c136e757 100644 --- a/api.md +++ b/api.md @@ -4771,24 +4771,21 @@ Types: from cloudflare.types.zero_trust.devices import ( DeviceInput, DeviceMatch, + DevicePostureRule, UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930, UnnamedSchemaRef41885dd46b9e0294254c49305a273681, UnnamedSchemaRef9e35ef84511131488ae286ce78ac4b27, - PostureCreateResponse, - PostureUpdateResponse, - PostureListResponse, PostureDeleteResponse, - PostureGetResponse, ) ``` Methods: -- client.zero_trust.devices.posture.create(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.posture.update(rule_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.posture.list(\*, account_id) -> SyncSinglePage[PostureListResponse] +- client.zero_trust.devices.posture.create(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.posture.update(rule_id, \*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.posture.list(\*, account_id) -> SyncSinglePage[DevicePostureRule] - client.zero_trust.devices.posture.delete(rule_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.posture.get(rule_id, \*, account_id) -> Optional +- client.zero_trust.devices.posture.get(rule_id, \*, account_id) -> Optional #### Integrations @@ -4903,7 +4900,6 @@ Types: ```python from cloudflare.types.zero_trust import ( - AccessDevicePostureRule, AccessRule, AnyValidServiceTokenRule, AuthenticationMethodRule, diff --git a/src/cloudflare/resources/zero_trust/devices/posture/posture.py b/src/cloudflare/resources/zero_trust/devices/posture/posture.py index 3e05cd63fb0..3f51586138b 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/posture.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/posture.py @@ -37,11 +37,8 @@ from .....types.zero_trust.devices import ( DeviceInputParam, DeviceMatchParam, - PostureGetResponse, - PostureListResponse, - PostureCreateResponse, + DevicePostureRule, PostureDeleteResponse, - PostureUpdateResponse, posture_create_params, posture_delete_params, posture_update_params, @@ -100,7 +97,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureCreateResponse]: + ) -> Optional[DevicePostureRule]: """ Creates a new device posture rule. @@ -152,7 +149,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) def update( @@ -193,7 +190,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureUpdateResponse]: + ) -> Optional[DevicePostureRule]: """ Updates a device posture rule. @@ -249,7 +246,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) def list( @@ -262,7 +259,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PostureListResponse]: + ) -> SyncSinglePage[DevicePostureRule]: """ Fetches device posture rules for a Zero Trust account. @@ -279,11 +276,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/posture", - page=SyncSinglePage[PostureListResponse], + page=SyncSinglePage[DevicePostureRule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=PostureListResponse, + model=DevicePostureRule, ) def delete( @@ -341,7 +338,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureGetResponse]: + ) -> Optional[DevicePostureRule]: """ Fetches a single device posture rule. @@ -369,7 +366,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) @@ -423,7 +420,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureCreateResponse]: + ) -> Optional[DevicePostureRule]: """ Creates a new device posture rule. @@ -475,7 +472,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) async def update( @@ -516,7 +513,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureUpdateResponse]: + ) -> Optional[DevicePostureRule]: """ Updates a device posture rule. @@ -572,7 +569,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) def list( @@ -585,7 +582,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PostureListResponse, AsyncSinglePage[PostureListResponse]]: + ) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]: """ Fetches device posture rules for a Zero Trust account. @@ -602,11 +599,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/posture", - page=AsyncSinglePage[PostureListResponse], + page=AsyncSinglePage[DevicePostureRule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=PostureListResponse, + model=DevicePostureRule, ) async def delete( @@ -664,7 +661,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PostureGetResponse]: + ) -> Optional[DevicePostureRule]: """ Fetches a single device posture rule. @@ -692,7 +689,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]), + cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]), ) diff --git a/src/cloudflare/types/zero_trust/__init__.py b/src/cloudflare/types/zero_trust/__init__.py index 7af7ec60887..99795df55fd 100644 --- a/src/cloudflare/types/zero_trust/__init__.py +++ b/src/cloudflare/types/zero_trust/__init__.py @@ -57,7 +57,6 @@ from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam -from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule from .generic_oauth_config_param import GenericOAuthConfigParam as GenericOAuthConfigParam from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams @@ -68,7 +67,6 @@ from .identity_provider_create_params import IdentityProviderCreateParams as IdentityProviderCreateParams from .identity_provider_list_response import IdentityProviderListResponse as IdentityProviderListResponse from .identity_provider_update_params import IdentityProviderUpdateParams as IdentityProviderUpdateParams -from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam from .connectivity_setting_edit_params import ConnectivitySettingEditParams as ConnectivitySettingEditParams from .organization_revoke_users_params import OrganizationRevokeUsersParams as OrganizationRevokeUsersParams diff --git a/src/cloudflare/types/zero_trust/access_device_posture_rule.py b/src/cloudflare/types/zero_trust/access_device_posture_rule.py deleted file mode 100644 index 7465d128873..00000000000 --- a/src/cloudflare/types/zero_trust/access_device_posture_rule.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel - -__all__ = ["AccessDevicePostureRule", "DevicePosture"] - - -class DevicePosture(BaseModel): - integration_uid: str - """The ID of a device posture integration.""" - - -class AccessDevicePostureRule(BaseModel): - device_posture: DevicePosture diff --git a/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py b/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py deleted file mode 100644 index d67cc39b2c3..00000000000 --- a/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["AccessDevicePostureRuleParam", "DevicePosture"] - - -class DevicePosture(TypedDict, total=False): - integration_uid: Required[str] - """The ID of a device posture integration.""" - - -class AccessDevicePostureRuleParam(TypedDict, total=False): - device_posture: Required[DevicePosture] diff --git a/src/cloudflare/types/zero_trust/access_rule.py b/src/cloudflare/types/zero_trust/access_rule.py index 18ea411a51c..87bdc0cf4a4 100644 --- a/src/cloudflare/types/zero_trust/access_rule.py +++ b/src/cloudflare/types/zero_trust/access_rule.py @@ -3,6 +3,7 @@ from typing import Union from .ip_rule import IPRule +from ..._models import BaseModel from .email_rule import EmailRule from .group_rule import GroupRule from .domain_rule import DomainRule @@ -18,11 +19,20 @@ from .service_token_rule import ServiceTokenRule from .external_evaluation_rule import ExternalEvaluationRule from .github_organization_rule import GitHubOrganizationRule -from .access_device_posture_rule import AccessDevicePostureRule from .authentication_method_rule import AuthenticationMethodRule from .any_valid_service_token_rule import AnyValidServiceTokenRule -__all__ = ["AccessRule"] +__all__ = ["AccessRule", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"] + + +class AccessDevicePostureRuleDevicePosture(BaseModel): + integration_uid: str + """The ID of a device posture integration.""" + + +class AccessDevicePostureRule(BaseModel): + device_posture: AccessDevicePostureRuleDevicePosture + AccessRule = Union[ EmailRule, diff --git a/src/cloudflare/types/zero_trust/access_rule_param.py b/src/cloudflare/types/zero_trust/access_rule_param.py index 2aa7dfd4a41..bdf9e2ff231 100644 --- a/src/cloudflare/types/zero_trust/access_rule_param.py +++ b/src/cloudflare/types/zero_trust/access_rule_param.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Union +from typing_extensions import Required, TypedDict from .ip_rule_param import IPRuleParam from .email_rule_param import EmailRuleParam @@ -20,11 +21,20 @@ from .service_token_rule_param import ServiceTokenRuleParam from .external_evaluation_rule_param import ExternalEvaluationRuleParam from .github_organization_rule_param import GitHubOrganizationRuleParam -from .access_device_posture_rule_param import AccessDevicePostureRuleParam from .authentication_method_rule_param import AuthenticationMethodRuleParam from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam -__all__ = ["AccessRuleParam"] +__all__ = ["AccessRuleParam", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"] + + +class AccessDevicePostureRuleDevicePosture(TypedDict, total=False): + integration_uid: Required[str] + """The ID of a device posture integration.""" + + +class AccessDevicePostureRule(TypedDict, total=False): + device_posture: Required[AccessDevicePostureRuleDevicePosture] + AccessRuleParam = Union[ EmailRuleParam, @@ -45,5 +55,5 @@ ExternalEvaluationRuleParam, CountryRuleParam, AuthenticationMethodRuleParam, - AccessDevicePostureRuleParam, + AccessDevicePostureRule, ] diff --git a/src/cloudflare/types/zero_trust/devices/__init__.py b/src/cloudflare/types/zero_trust/devices/__init__.py index c2fa6a414d4..325b3488d77 100644 --- a/src/cloudflare/types/zero_trust/devices/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/__init__.py @@ -13,16 +13,15 @@ from .device_input_param import DeviceInputParam as DeviceInputParam from .device_match_param import DeviceMatchParam as DeviceMatchParam from .policy_edit_params import PolicyEditParams as PolicyEditParams +from .device_posture_rule import DevicePostureRule as DevicePostureRule from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams -from .posture_get_response import PostureGetResponse as PostureGetResponse from .revoke_create_params import RevokeCreateParams as RevokeCreateParams from .network_create_params import NetworkCreateParams as NetworkCreateParams from .network_delete_params import NetworkDeleteParams as NetworkDeleteParams from .network_update_params import NetworkUpdateParams as NetworkUpdateParams from .posture_create_params import PostureCreateParams as PostureCreateParams from .posture_delete_params import PostureDeleteParams as PostureDeleteParams -from .posture_list_response import PostureListResponse as PostureListResponse from .posture_update_params import PostureUpdateParams as PostureUpdateParams from .setting_update_params import SettingUpdateParams as SettingUpdateParams from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams @@ -30,9 +29,7 @@ from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse -from .posture_create_response import PostureCreateResponse as PostureCreateResponse from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse -from .posture_update_response import PostureUpdateResponse as PostureUpdateResponse from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import ( diff --git a/src/cloudflare/types/zero_trust/devices/posture_get_response.py b/src/cloudflare/types/zero_trust/devices/device_posture_rule.py similarity index 95% rename from src/cloudflare/types/zero_trust/devices/posture_get_response.py rename to src/cloudflare/types/zero_trust/devices/device_posture_rule.py index ec45ba1eb1d..1817b557e0b 100644 --- a/src/cloudflare/types/zero_trust/devices/posture_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/device_posture_rule.py @@ -7,10 +7,10 @@ from .device_input import DeviceInput from .device_match import DeviceMatch -__all__ = ["PostureGetResponse"] +__all__ = ["DevicePostureRule"] -class PostureGetResponse(BaseModel): +class DevicePostureRule(BaseModel): id: Optional[str] = None """API UUID.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture_create_response.py b/src/cloudflare/types/zero_trust/devices/posture_create_response.py deleted file mode 100644 index c5d6a0935a6..00000000000 --- a/src/cloudflare/types/zero_trust/devices/posture_create_response.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ...._models import BaseModel -from .device_input import DeviceInput -from .device_match import DeviceMatch - -__all__ = ["PostureCreateResponse"] - - -class PostureCreateResponse(BaseModel): - id: Optional[str] = None - """API UUID.""" - - description: Optional[str] = None - """The description of the device posture rule.""" - - expiration: Optional[str] = None - """Sets the expiration time for a posture check result. - - If empty, the result remains valid until it is overwritten by new data from the - WARP client. - """ - - input: Optional[DeviceInput] = None - """The value to be checked against.""" - - match: Optional[List[DeviceMatch]] = None - """The conditions that the client must match to run the rule.""" - - name: Optional[str] = None - """The name of the device posture rule.""" - - schedule: Optional[str] = None - """Polling frequency for the WARP client posture check. - - Default: `5m` (poll every five minutes). Minimum: `1m`. - """ - - type: Optional[ - Literal[ - "file", - "application", - "tanium", - "gateway", - "warp", - "disk_encryption", - "sentinelone", - "carbonblack", - "firewall", - "os_version", - "domain_joined", - "client_certificate", - "unique_client_id", - "kolide", - "tanium_s2s", - "crowdstrike_s2s", - "intune", - "workspace_one", - "sentinelone_s2s", - ] - ] = None - """The type of device posture rule.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture_list_response.py b/src/cloudflare/types/zero_trust/devices/posture_list_response.py deleted file mode 100644 index 21c39dca774..00000000000 --- a/src/cloudflare/types/zero_trust/devices/posture_list_response.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ...._models import BaseModel -from .device_input import DeviceInput -from .device_match import DeviceMatch - -__all__ = ["PostureListResponse"] - - -class PostureListResponse(BaseModel): - id: Optional[str] = None - """API UUID.""" - - description: Optional[str] = None - """The description of the device posture rule.""" - - expiration: Optional[str] = None - """Sets the expiration time for a posture check result. - - If empty, the result remains valid until it is overwritten by new data from the - WARP client. - """ - - input: Optional[DeviceInput] = None - """The value to be checked against.""" - - match: Optional[List[DeviceMatch]] = None - """The conditions that the client must match to run the rule.""" - - name: Optional[str] = None - """The name of the device posture rule.""" - - schedule: Optional[str] = None - """Polling frequency for the WARP client posture check. - - Default: `5m` (poll every five minutes). Minimum: `1m`. - """ - - type: Optional[ - Literal[ - "file", - "application", - "tanium", - "gateway", - "warp", - "disk_encryption", - "sentinelone", - "carbonblack", - "firewall", - "os_version", - "domain_joined", - "client_certificate", - "unique_client_id", - "kolide", - "tanium_s2s", - "crowdstrike_s2s", - "intune", - "workspace_one", - "sentinelone_s2s", - ] - ] = None - """The type of device posture rule.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture_update_response.py b/src/cloudflare/types/zero_trust/devices/posture_update_response.py deleted file mode 100644 index 72d885fc6b9..00000000000 --- a/src/cloudflare/types/zero_trust/devices/posture_update_response.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ...._models import BaseModel -from .device_input import DeviceInput -from .device_match import DeviceMatch - -__all__ = ["PostureUpdateResponse"] - - -class PostureUpdateResponse(BaseModel): - id: Optional[str] = None - """API UUID.""" - - description: Optional[str] = None - """The description of the device posture rule.""" - - expiration: Optional[str] = None - """Sets the expiration time for a posture check result. - - If empty, the result remains valid until it is overwritten by new data from the - WARP client. - """ - - input: Optional[DeviceInput] = None - """The value to be checked against.""" - - match: Optional[List[DeviceMatch]] = None - """The conditions that the client must match to run the rule.""" - - name: Optional[str] = None - """The name of the device posture rule.""" - - schedule: Optional[str] = None - """Polling frequency for the WARP client posture check. - - Default: `5m` (poll every five minutes). Minimum: `1m`. - """ - - type: Optional[ - Literal[ - "file", - "application", - "tanium", - "gateway", - "warp", - "disk_encryption", - "sentinelone", - "carbonblack", - "firewall", - "os_version", - "domain_joined", - "client_certificate", - "unique_client_id", - "kolide", - "tanium_s2s", - "crowdstrike_s2s", - "intune", - "workspace_one", - "sentinelone_s2s", - ] - ] = None - """The type of device posture rule.""" diff --git a/tests/api_resources/zero_trust/devices/test_posture.py b/tests/api_resources/zero_trust/devices/test_posture.py index e57a4229d2f..dd5f8e84962 100644 --- a/tests/api_resources/zero_trust/devices/test_posture.py +++ b/tests/api_resources/zero_trust/devices/test_posture.py @@ -11,11 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices import ( - PostureGetResponse, - PostureListResponse, - PostureCreateResponse, + DevicePostureRule, PostureDeleteResponse, - PostureUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="Admin Serial Numbers", type="file", ) - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +50,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: match=[{"platform": "windows"}, {"platform": "windows"}, {"platform": "windows"}], schedule="1h", ) - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +64,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +78,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +101,7 @@ def test_method_update(self, client: Cloudflare) -> None: name="Admin Serial Numbers", type="file", ) - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +123,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: match=[{"platform": "windows"}, {"platform": "windows"}, {"platform": "windows"}], schedule="1h", ) - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -141,7 +138,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +153,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -185,7 +182,7 @@ def test_method_list(self, client: Cloudflare) -> None: posture = client.zero_trust.devices.posture.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(SyncSinglePage[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -197,7 +194,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(SyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(SyncSinglePage[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -209,7 +206,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(SyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(SyncSinglePage[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -285,7 +282,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -298,7 +295,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +308,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = response.parse() - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -342,7 +339,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="Admin Serial Numbers", type="file", ) - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -363,7 +360,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare match=[{"platform": "windows"}, {"platform": "windows"}, {"platform": "windows"}], schedule="1h", ) - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -377,7 +374,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -391,7 +388,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureCreateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -414,7 +411,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: name="Admin Serial Numbers", type="file", ) - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -436,7 +433,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare match=[{"platform": "windows"}, {"platform": "windows"}, {"platform": "windows"}], schedule="1h", ) - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -451,7 +448,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -466,7 +463,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureUpdateResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -495,7 +492,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: posture = await async_client.zero_trust.devices.posture.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(AsyncSinglePage[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -507,7 +504,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(AsyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(AsyncSinglePage[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -519,7 +516,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(AsyncSinglePage[PostureListResponse], posture, path=["response"]) + assert_matches_type(AsyncSinglePage[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True @@ -595,7 +592,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -608,7 +605,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) @pytest.mark.skip() @parametrize @@ -621,7 +618,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" posture = await response.parse() - assert_matches_type(Optional[PostureGetResponse], posture, path=["response"]) + assert_matches_type(Optional[DevicePostureRule], posture, path=["response"]) assert cast(Any, response.is_closed) is True