2121from ._configuration import PolicyInsightsClientConfiguration
2222from ._utils .serialization import Deserializer , Serializer
2323from .operations import (
24- AttestationsOperations ,
25- ComponentPolicyStatesOperations ,
2624 Operations ,
2725 PolicyEventsOperations ,
2826 PolicyMetadataOperations ,
3331)
3432
3533if TYPE_CHECKING :
34+ from azure .core import AzureClouds
3635 from azure .core .credentials import TokenCredential
3736
3837
3938class PolicyInsightsClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
40- """Query component policy states at varying resource scopes for Resource Provider mode policies .
39+ """PolicyInsightsClient .
4140
4241 :ivar policy_tracked_resources: PolicyTrackedResourcesOperations operations
4342 :vartype policy_tracked_resources:
@@ -48,37 +47,45 @@ class PolicyInsightsClient: # pylint: disable=client-accepts-api-version-keywor
4847 :vartype policy_events: azure.mgmt.policyinsights.operations.PolicyEventsOperations
4948 :ivar policy_states: PolicyStatesOperations operations
5049 :vartype policy_states: azure.mgmt.policyinsights.operations.PolicyStatesOperations
50+ :ivar operations: Operations operations
51+ :vartype operations: azure.mgmt.policyinsights.operations.Operations
5152 :ivar policy_metadata: PolicyMetadataOperations operations
5253 :vartype policy_metadata: azure.mgmt.policyinsights.operations.PolicyMetadataOperations
5354 :ivar policy_restrictions: PolicyRestrictionsOperations operations
5455 :vartype policy_restrictions: azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations
55- :ivar component_policy_states: ComponentPolicyStatesOperations operations
56- :vartype component_policy_states:
57- azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations
58- :ivar operations: Operations operations
59- :vartype operations: azure.mgmt.policyinsights.operations.Operations
60- :ivar attestations: AttestationsOperations operations
61- :vartype attestations: azure.mgmt.policyinsights.operations.AttestationsOperations
6256 :param credential: Credential needed for the client to connect to Azure. Required.
6357 :type credential: ~azure.core.credentials.TokenCredential
6458 :param subscription_id: Microsoft Azure subscription ID. Required.
6559 :type subscription_id: str
6660 :param base_url: Service URL. Default value is None.
6761 :type base_url: str
62+ :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
63+ None.
64+ :paramtype cloud_setting: ~azure.core.AzureClouds
6865 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6966 Retry-After header is present.
7067 """
7168
7269 def __init__ (
73- self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
70+ self ,
71+ credential : "TokenCredential" ,
72+ subscription_id : str ,
73+ base_url : Optional [str ] = None ,
74+ * ,
75+ cloud_setting : Optional ["AzureClouds" ] = None ,
76+ ** kwargs : Any
7477 ) -> None :
75- _cloud = kwargs . pop ( " cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
78+ _cloud = cloud_setting or settings .current .azure_cloud # type: ignore
7679 _endpoints = get_arm_endpoints (_cloud )
7780 if not base_url :
7881 base_url = _endpoints ["resource_manager" ]
7982 credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
8083 self ._config = PolicyInsightsClientConfiguration (
81- credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
84+ credential = credential ,
85+ subscription_id = subscription_id ,
86+ cloud_setting = cloud_setting ,
87+ credential_scopes = credential_scopes ,
88+ ** kwargs
8289 )
8390
8491 _policies = kwargs .pop ("policies" , None )
@@ -111,15 +118,11 @@ def __init__(
111118 self .remediations = RemediationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112119 self .policy_events = PolicyEventsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113120 self .policy_states = PolicyStatesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
114122 self .policy_metadata = PolicyMetadataOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
115123 self .policy_restrictions = PolicyRestrictionsOperations (
116124 self ._client , self ._config , self ._serialize , self ._deserialize
117125 )
118- self .component_policy_states = ComponentPolicyStatesOperations (
119- self ._client , self ._config , self ._serialize , self ._deserialize
120- )
121- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
122- self .attestations = AttestationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123126
124127 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
125128 """Runs the network request through the client's chained policies.
0 commit comments