Skip to content

Commit d0d46ed

Browse files
msyycSDK Automation
and
SDK Automation
authored
[T1] policyinsight 2020 11 11 (Azure#15197)
* Generated from af54d44692949d0f789184a5f5f94b058b5091d4 * version,changelog Co-authored-by: SDK Automation <[email protected]>
1 parent b0c23e2 commit d0d46ed

File tree

9 files changed

+1401
-1064
lines changed

9 files changed

+1401
-1064
lines changed

sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 0.6.0 (2020-11-11)
4+
5+
**Features**
6+
7+
- Model PolicyState has a new parameter components
8+
- Model QueryOptions has a new parameter skip_token
9+
- Model PolicyEvent has a new parameter compliance_state
10+
- Model PolicyEvent has a new parameter components
11+
12+
**Breaking changes**
13+
14+
- Removed operation PolicyEventsOperations.get_metadata
15+
316
## 0.5.0 (2020-03-20)
417

518
**Features**

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
try:
1313
from ._models_py3 import ComplianceDetail
14+
from ._models_py3 import ComponentEventDetails
15+
from ._models_py3 import ComponentStateDetails
1416
from ._models_py3 import ErrorDefinition
1517
from ._models_py3 import ErrorResponse, ErrorResponseException
1618
from ._models_py3 import ExpressionEvaluationDetails
@@ -23,11 +25,9 @@
2325
from ._models_py3 import PolicyDetails
2426
from ._models_py3 import PolicyEvaluationDetails
2527
from ._models_py3 import PolicyEvent
26-
from ._models_py3 import PolicyEventsQueryResults
2728
from ._models_py3 import PolicyGroupSummary
2829
from ._models_py3 import PolicyMetadata
2930
from ._models_py3 import PolicyState
30-
from ._models_py3 import PolicyStatesQueryResults
3131
from ._models_py3 import PolicyTrackedResource
3232
from ._models_py3 import QueryFailure, QueryFailureException
3333
from ._models_py3 import QueryFailureError
@@ -44,6 +44,8 @@
4444
from ._models_py3 import TypedErrorInfo
4545
except (SyntaxError, ImportError):
4646
from ._models import ComplianceDetail
47+
from ._models import ComponentEventDetails
48+
from ._models import ComponentStateDetails
4749
from ._models import ErrorDefinition
4850
from ._models import ErrorResponse, ErrorResponseException
4951
from ._models import ExpressionEvaluationDetails
@@ -56,11 +58,9 @@
5658
from ._models import PolicyDetails
5759
from ._models import PolicyEvaluationDetails
5860
from ._models import PolicyEvent
59-
from ._models import PolicyEventsQueryResults
6061
from ._models import PolicyGroupSummary
6162
from ._models import PolicyMetadata
6263
from ._models import PolicyState
63-
from ._models import PolicyStatesQueryResults
6464
from ._models import PolicyTrackedResource
6565
from ._models import QueryFailure, QueryFailureException
6666
from ._models import QueryFailureError
@@ -75,6 +75,8 @@
7575
from ._models import SummaryResults
7676
from ._models import TrackedResourceModificationDetails
7777
from ._models import TypedErrorInfo
78+
from ._paged_models import PolicyEventPaged
79+
from ._paged_models import PolicyStatePaged
7880
from ._paged_models import PolicyTrackedResourcePaged
7981
from ._paged_models import RemediationDeploymentPaged
8082
from ._paged_models import RemediationPaged
@@ -86,6 +88,8 @@
8688

8789
__all__ = [
8890
'ComplianceDetail',
91+
'ComponentEventDetails',
92+
'ComponentStateDetails',
8993
'ErrorDefinition',
9094
'ErrorResponse', 'ErrorResponseException',
9195
'ExpressionEvaluationDetails',
@@ -98,11 +102,9 @@
98102
'PolicyDetails',
99103
'PolicyEvaluationDetails',
100104
'PolicyEvent',
101-
'PolicyEventsQueryResults',
102105
'PolicyGroupSummary',
103106
'PolicyMetadata',
104107
'PolicyState',
105-
'PolicyStatesQueryResults',
106108
'PolicyTrackedResource',
107109
'QueryFailure', 'QueryFailureException',
108110
'QueryFailureError',
@@ -120,6 +122,8 @@
120122
'PolicyTrackedResourcePaged',
121123
'RemediationDeploymentPaged',
122124
'RemediationPaged',
125+
'PolicyEventPaged',
126+
'PolicyStatePaged',
123127
'SlimPolicyMetadataPaged',
124128
'ResourceDiscoveryMode',
125129
'PolicyStatesResource',

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models.py

Lines changed: 105 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,89 @@ def __init__(self, **kwargs):
4141
self.count = kwargs.get('count', None)
4242

4343

44+
class ComponentEventDetails(Model):
45+
"""Component event details.
46+
47+
:param additional_properties: Unmatched properties from the message are
48+
deserialized this collection
49+
:type additional_properties: dict[str, object]
50+
:param id: Component Id.
51+
:type id: str
52+
:param type: Component type.
53+
:type type: str
54+
:param name: Component name.
55+
:type name: str
56+
:param timestamp: Timestamp for component policy event record.
57+
:type timestamp: datetime
58+
:param tenant_id: Tenant ID for the policy event record.
59+
:type tenant_id: str
60+
:param principal_oid: Principal object ID for the user who initiated the
61+
resource component operation that triggered the policy event.
62+
:type principal_oid: str
63+
:param policy_definition_action: Policy definition action, i.e. effect.
64+
:type policy_definition_action: str
65+
"""
66+
67+
_attribute_map = {
68+
'additional_properties': {'key': '', 'type': '{object}'},
69+
'id': {'key': 'id', 'type': 'str'},
70+
'type': {'key': 'type', 'type': 'str'},
71+
'name': {'key': 'name', 'type': 'str'},
72+
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
73+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
74+
'principal_oid': {'key': 'principalOid', 'type': 'str'},
75+
'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'},
76+
}
77+
78+
def __init__(self, **kwargs):
79+
super(ComponentEventDetails, self).__init__(**kwargs)
80+
self.additional_properties = kwargs.get('additional_properties', None)
81+
self.id = kwargs.get('id', None)
82+
self.type = kwargs.get('type', None)
83+
self.name = kwargs.get('name', None)
84+
self.timestamp = kwargs.get('timestamp', None)
85+
self.tenant_id = kwargs.get('tenant_id', None)
86+
self.principal_oid = kwargs.get('principal_oid', None)
87+
self.policy_definition_action = kwargs.get('policy_definition_action', None)
88+
89+
90+
class ComponentStateDetails(Model):
91+
"""Component state details.
92+
93+
:param additional_properties: Unmatched properties from the message are
94+
deserialized this collection
95+
:type additional_properties: dict[str, object]
96+
:param id: Component Id.
97+
:type id: str
98+
:param type: Component type.
99+
:type type: str
100+
:param name: Component name.
101+
:type name: str
102+
:param timestamp: Component compliance evaluation timestamp.
103+
:type timestamp: datetime
104+
:param compliance_state: Component compliance state.
105+
:type compliance_state: str
106+
"""
107+
108+
_attribute_map = {
109+
'additional_properties': {'key': '', 'type': '{object}'},
110+
'id': {'key': 'id', 'type': 'str'},
111+
'type': {'key': 'type', 'type': 'str'},
112+
'name': {'key': 'name', 'type': 'str'},
113+
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
114+
'compliance_state': {'key': 'complianceState', 'type': 'str'},
115+
}
116+
117+
def __init__(self, **kwargs):
118+
super(ComponentStateDetails, self).__init__(**kwargs)
119+
self.additional_properties = kwargs.get('additional_properties', None)
120+
self.id = kwargs.get('id', None)
121+
self.type = kwargs.get('type', None)
122+
self.name = kwargs.get('name', None)
123+
self.timestamp = kwargs.get('timestamp', None)
124+
self.compliance_state = kwargs.get('compliance_state', None)
125+
126+
44127
class ErrorDefinition(Model):
45128
"""Error definition.
46129
@@ -459,11 +542,17 @@ class PolicyEvent(Model):
459542
definition inside the policy set, if the policy assignment is for a policy
460543
set.
461544
:type policy_definition_reference_id: str
545+
:param compliance_state: Compliance state of the resource.
546+
:type compliance_state: str
462547
:param tenant_id: Tenant ID for the policy event record.
463548
:type tenant_id: str
464549
:param principal_oid: Principal object ID for the user who initiated the
465550
resource operation that triggered the policy event.
466551
:type principal_oid: str
552+
:param components: Components events records populated only when URL
553+
contains $expand=components clause.
554+
:type components:
555+
list[~azure.mgmt.policyinsights.models.ComponentEventDetails]
467556
"""
468557

469558
_attribute_map = {
@@ -495,8 +584,10 @@ class PolicyEvent(Model):
495584
'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'},
496585
'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'},
497586
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
587+
'compliance_state': {'key': 'complianceState', 'type': 'str'},
498588
'tenant_id': {'key': 'tenantId', 'type': 'str'},
499589
'principal_oid': {'key': 'principalOid', 'type': 'str'},
590+
'components': {'key': 'components', 'type': '[ComponentEventDetails]'},
500591
}
501592

502593
def __init__(self, **kwargs):
@@ -529,38 +620,10 @@ def __init__(self, **kwargs):
529620
self.policy_set_definition_parameters = kwargs.get('policy_set_definition_parameters', None)
530621
self.management_group_ids = kwargs.get('management_group_ids', None)
531622
self.policy_definition_reference_id = kwargs.get('policy_definition_reference_id', None)
623+
self.compliance_state = kwargs.get('compliance_state', None)
532624
self.tenant_id = kwargs.get('tenant_id', None)
533625
self.principal_oid = kwargs.get('principal_oid', None)
534-
535-
536-
class PolicyEventsQueryResults(Model):
537-
"""Query results.
538-
539-
:param odatacontext: OData context string; used by OData clients to
540-
resolve type information based on metadata.
541-
:type odatacontext: str
542-
:param odatacount: OData entity count; represents the number of policy
543-
event records returned.
544-
:type odatacount: int
545-
:param value: Query results.
546-
:type value: list[~azure.mgmt.policyinsights.models.PolicyEvent]
547-
"""
548-
549-
_validation = {
550-
'odatacount': {'minimum': 0},
551-
}
552-
553-
_attribute_map = {
554-
'odatacontext': {'key': '@odata\\.context', 'type': 'str'},
555-
'odatacount': {'key': '@odata\\.count', 'type': 'int'},
556-
'value': {'key': 'value', 'type': '[PolicyEvent]'},
557-
}
558-
559-
def __init__(self, **kwargs):
560-
super(PolicyEventsQueryResults, self).__init__(**kwargs)
561-
self.odatacontext = kwargs.get('odatacontext', None)
562-
self.odatacount = kwargs.get('odatacount', None)
563-
self.value = kwargs.get('value', None)
626+
self.components = kwargs.get('components', None)
564627

565628

566629
class PolicyGroupSummary(Model):
@@ -741,6 +804,10 @@ class PolicyState(Model):
741804
~azure.mgmt.policyinsights.models.PolicyEvaluationDetails
742805
:param policy_definition_group_names: Policy definition group names.
743806
:type policy_definition_group_names: list[str]
807+
:param components: Components state compliance records populated only when
808+
URL contains $expand=components clause.
809+
:type components:
810+
list[~azure.mgmt.policyinsights.models.ComponentStateDetails]
744811
:ivar policy_definition_version: Evaluated policy definition version.
745812
:vartype policy_definition_version: str
746813
:ivar policy_set_definition_version: Evaluated policy set definition
@@ -788,6 +855,7 @@ class PolicyState(Model):
788855
'compliance_state': {'key': 'complianceState', 'type': 'str'},
789856
'policy_evaluation_details': {'key': 'policyEvaluationDetails', 'type': 'PolicyEvaluationDetails'},
790857
'policy_definition_group_names': {'key': 'policyDefinitionGroupNames', 'type': '[str]'},
858+
'components': {'key': 'components', 'type': '[ComponentStateDetails]'},
791859
'policy_definition_version': {'key': 'policyDefinitionVersion', 'type': 'str'},
792860
'policy_set_definition_version': {'key': 'policySetDefinitionVersion', 'type': 'str'},
793861
'policy_assignment_version': {'key': 'policyAssignmentVersion', 'type': 'str'},
@@ -826,41 +894,12 @@ def __init__(self, **kwargs):
826894
self.compliance_state = kwargs.get('compliance_state', None)
827895
self.policy_evaluation_details = kwargs.get('policy_evaluation_details', None)
828896
self.policy_definition_group_names = kwargs.get('policy_definition_group_names', None)
897+
self.components = kwargs.get('components', None)
829898
self.policy_definition_version = None
830899
self.policy_set_definition_version = None
831900
self.policy_assignment_version = None
832901

833902

834-
class PolicyStatesQueryResults(Model):
835-
"""Query results.
836-
837-
:param odatacontext: OData context string; used by OData clients to
838-
resolve type information based on metadata.
839-
:type odatacontext: str
840-
:param odatacount: OData entity count; represents the number of policy
841-
state records returned.
842-
:type odatacount: int
843-
:param value: Query results.
844-
:type value: list[~azure.mgmt.policyinsights.models.PolicyState]
845-
"""
846-
847-
_validation = {
848-
'odatacount': {'minimum': 0},
849-
}
850-
851-
_attribute_map = {
852-
'odatacontext': {'key': '@odata\\.context', 'type': 'str'},
853-
'odatacount': {'key': '@odata\\.count', 'type': 'int'},
854-
'value': {'key': 'value', 'type': '[PolicyState]'},
855-
}
856-
857-
def __init__(self, **kwargs):
858-
super(PolicyStatesQueryResults, self).__init__(**kwargs)
859-
self.odatacontext = kwargs.get('odatacontext', None)
860-
self.odatacount = kwargs.get('odatacount', None)
861-
self.value = kwargs.get('value', None)
862-
863-
864903
class PolicyTrackedResource(Model):
865904
"""Policy tracked resource record.
866905
@@ -991,8 +1030,11 @@ class QueryOptions(Model):
9911030
:type to: datetime
9921031
:param apply: OData apply expression for aggregations.
9931032
:type apply: str
1033+
:param skip_token: Skiptoken is only provided if a previous response
1034+
returned a partial result as a part of nextLink element.
1035+
:type skip_token: str
9941036
:param expand: The $expand query parameter. For example, to expand
995-
policyEvaluationDetails, use $expand=policyEvaluationDetails
1037+
components use $expand=components
9961038
:type expand: str
9971039
"""
9981040

@@ -1004,6 +1046,7 @@ class QueryOptions(Model):
10041046
'from_property': {'key': '', 'type': 'iso-8601'},
10051047
'to': {'key': '', 'type': 'iso-8601'},
10061048
'apply': {'key': '', 'type': 'str'},
1049+
'skip_token': {'key': '', 'type': 'str'},
10071050
'expand': {'key': '', 'type': 'str'},
10081051
}
10091052

@@ -1016,6 +1059,7 @@ def __init__(self, **kwargs):
10161059
self.from_property = kwargs.get('from_property', None)
10171060
self.to = kwargs.get('to', None)
10181061
self.apply = kwargs.get('apply', None)
1062+
self.skip_token = kwargs.get('skip_token', None)
10191063
self.expand = kwargs.get('expand', None)
10201064

10211065

0 commit comments

Comments
 (0)