# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import datetime
from typing import Any, Dict, List, Optional, Union
from azure.core.exceptions import HttpResponseError
import msrest.serialization
from ._policy_insights_client_enums import *
[docs]class Resource(msrest.serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
[docs]class Attestation(Resource):
"""An attestation resource.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.policyinsights.models.SystemData
:param policy_assignment_id: Required. The resource ID of the policy assignment that the
attestation is setting the state for.
:type policy_assignment_id: str
:param policy_definition_reference_id: The policy definition reference ID from a policy set
definition that the attestation is setting the state for. If the policy assignment assigns a
policy set definition the attestation can choose a definition within the set definition with
this property or omit this and set the state for the entire set definition.
:type policy_definition_reference_id: str
:param compliance_state: The compliance state that should be set on the resource. Possible
values include: "Compliant", "NonCompliant", "Unknown".
:type compliance_state: str or ~azure.mgmt.policyinsights.models.ComplianceState
:param expires_on: The time the compliance state should expire.
:type expires_on: ~datetime.datetime
:param owner: The person responsible for setting the state of the resource. This value is
typically an Azure Active Directory object ID.
:type owner: str
:param comments: Comments describing why this attestation was created.
:type comments: str
:param evidence: The evidence supporting the compliance state set in this attestation.
:type evidence: list[~azure.mgmt.policyinsights.models.AttestationEvidence]
:ivar provisioning_state: The status of the attestation.
:vartype provisioning_state: str
:ivar last_compliance_state_change_at: The time the compliance state was last changed in this
attestation.
:vartype last_compliance_state_change_at: ~datetime.datetime
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'system_data': {'readonly': True},
'policy_assignment_id': {'required': True},
'provisioning_state': {'readonly': True},
'last_compliance_state_change_at': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'policy_assignment_id': {'key': 'properties.policyAssignmentId', 'type': 'str'},
'policy_definition_reference_id': {'key': 'properties.policyDefinitionReferenceId', 'type': 'str'},
'compliance_state': {'key': 'properties.complianceState', 'type': 'str'},
'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'},
'owner': {'key': 'properties.owner', 'type': 'str'},
'comments': {'key': 'properties.comments', 'type': 'str'},
'evidence': {'key': 'properties.evidence', 'type': '[AttestationEvidence]'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'last_compliance_state_change_at': {'key': 'properties.lastComplianceStateChangeAt', 'type': 'iso-8601'},
}
def __init__(
self,
*,
policy_assignment_id: str,
policy_definition_reference_id: Optional[str] = None,
compliance_state: Optional[Union[str, "ComplianceState"]] = None,
expires_on: Optional[datetime.datetime] = None,
owner: Optional[str] = None,
comments: Optional[str] = None,
evidence: Optional[List["AttestationEvidence"]] = None,
**kwargs
):
super(Attestation, self).__init__(**kwargs)
self.system_data = None
self.policy_assignment_id = policy_assignment_id
self.policy_definition_reference_id = policy_definition_reference_id
self.compliance_state = compliance_state
self.expires_on = expires_on
self.owner = owner
self.comments = comments
self.evidence = evidence
self.provisioning_state = None
self.last_compliance_state_change_at = None
[docs]class AttestationEvidence(msrest.serialization.Model):
"""A piece of evidence supporting the compliance state set in the attestation.
:param description: The description for this piece of evidence.
:type description: str
:param source_uri: The URI location of the evidence.
:type source_uri: str
"""
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'source_uri': {'key': 'sourceUri', 'type': 'str'},
}
def __init__(
self,
*,
description: Optional[str] = None,
source_uri: Optional[str] = None,
**kwargs
):
super(AttestationEvidence, self).__init__(**kwargs)
self.description = description
self.source_uri = source_uri
[docs]class AttestationListResult(msrest.serialization.Model):
"""List of attestations.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: Array of attestation definitions.
:vartype value: list[~azure.mgmt.policyinsights.models.Attestation]
:ivar next_link: The URL to get the next set of results.
:vartype next_link: str
"""
_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[Attestation]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(AttestationListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
[docs]class CheckRestrictionsRequest(msrest.serialization.Model):
"""The check policy restrictions parameters describing the resource that is being evaluated.
All required parameters must be populated in order to send to Azure.
:param resource_details: Required. The information about the resource that will be evaluated.
:type resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails
:param pending_fields: The list of fields and values that should be evaluated for potential
restrictions.
:type pending_fields: list[~azure.mgmt.policyinsights.models.PendingField]
"""
_validation = {
'resource_details': {'required': True},
}
_attribute_map = {
'resource_details': {'key': 'resourceDetails', 'type': 'CheckRestrictionsResourceDetails'},
'pending_fields': {'key': 'pendingFields', 'type': '[PendingField]'},
}
def __init__(
self,
*,
resource_details: "CheckRestrictionsResourceDetails",
pending_fields: Optional[List["PendingField"]] = None,
**kwargs
):
super(CheckRestrictionsRequest, self).__init__(**kwargs)
self.resource_details = resource_details
self.pending_fields = pending_fields
[docs]class CheckRestrictionsResourceDetails(msrest.serialization.Model):
"""The information about the resource that will be evaluated.
All required parameters must be populated in order to send to Azure.
:param resource_content: Required. The resource content. This should include whatever
properties are already known and can be a partial set of all resource properties.
:type resource_content: any
:param api_version: The api-version of the resource content.
:type api_version: str
:param scope: The scope where the resource is being created. For example, if the resource is a
child resource this would be the parent resource's resource ID.
:type scope: str
"""
_validation = {
'resource_content': {'required': True},
}
_attribute_map = {
'resource_content': {'key': 'resourceContent', 'type': 'object'},
'api_version': {'key': 'apiVersion', 'type': 'str'},
'scope': {'key': 'scope', 'type': 'str'},
}
def __init__(
self,
*,
resource_content: Any,
api_version: Optional[str] = None,
scope: Optional[str] = None,
**kwargs
):
super(CheckRestrictionsResourceDetails, self).__init__(**kwargs)
self.resource_content = resource_content
self.api_version = api_version
self.scope = scope
[docs]class CheckRestrictionsResult(msrest.serialization.Model):
"""The result of a check policy restrictions evaluation on a resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar field_restrictions: The restrictions that will be placed on various fields in the
resource by policy.
:vartype field_restrictions: list[~azure.mgmt.policyinsights.models.FieldRestrictions]
:ivar content_evaluation_result: Evaluation results for the provided partial resource content.
:vartype content_evaluation_result:
~azure.mgmt.policyinsights.models.CheckRestrictionsResultContentEvaluationResult
"""
_validation = {
'field_restrictions': {'readonly': True},
'content_evaluation_result': {'readonly': True},
}
_attribute_map = {
'field_restrictions': {'key': 'fieldRestrictions', 'type': '[FieldRestrictions]'},
'content_evaluation_result': {'key': 'contentEvaluationResult', 'type': 'CheckRestrictionsResultContentEvaluationResult'},
}
def __init__(
self,
**kwargs
):
super(CheckRestrictionsResult, self).__init__(**kwargs)
self.field_restrictions = None
self.content_evaluation_result = None
[docs]class CheckRestrictionsResultContentEvaluationResult(msrest.serialization.Model):
"""Evaluation results for the provided partial resource content.
:param policy_evaluations: Policy evaluation results against the given resource content. This
will indicate if the partial content that was provided will be denied as-is.
:type policy_evaluations: list[~azure.mgmt.policyinsights.models.PolicyEvaluationResult]
"""
_attribute_map = {
'policy_evaluations': {'key': 'policyEvaluations', 'type': '[PolicyEvaluationResult]'},
}
def __init__(
self,
*,
policy_evaluations: Optional[List["PolicyEvaluationResult"]] = None,
**kwargs
):
super(CheckRestrictionsResultContentEvaluationResult, self).__init__(**kwargs)
self.policy_evaluations = policy_evaluations
[docs]class ComplianceDetail(msrest.serialization.Model):
"""The compliance state rollup.
:param compliance_state: The compliance state.
:type compliance_state: str
:param count: Summarized count value for this compliance state.
:type count: int
"""
_attribute_map = {
'compliance_state': {'key': 'complianceState', 'type': 'str'},
'count': {'key': 'count', 'type': 'int'},
}
def __init__(
self,
*,
compliance_state: Optional[str] = None,
count: Optional[int] = None,
**kwargs
):
super(ComplianceDetail, self).__init__(**kwargs)
self.compliance_state = compliance_state
self.count = count
[docs]class ComponentEventDetails(msrest.serialization.Model):
"""Component event details.
:param additional_properties: Unmatched properties from the message are deserialized to this
collection.
:type additional_properties: dict[str, any]
:param id: Component Id.
:type id: str
:param type: Component type.
:type type: str
:param name: Component name.
:type name: str
:param timestamp: Timestamp for component policy event record.
:type timestamp: ~datetime.datetime
:param tenant_id: Tenant ID for the policy event record.
:type tenant_id: str
:param principal_oid: Principal object ID for the user who initiated the resource component
operation that triggered the policy event.
:type principal_oid: str
:param policy_definition_action: Policy definition action, i.e. effect.
:type policy_definition_action: str
"""
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'principal_oid': {'key': 'principalOid', 'type': 'str'},
'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
id: Optional[str] = None,
type: Optional[str] = None,
name: Optional[str] = None,
timestamp: Optional[datetime.datetime] = None,
tenant_id: Optional[str] = None,
principal_oid: Optional[str] = None,
policy_definition_action: Optional[str] = None,
**kwargs
):
super(ComponentEventDetails, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.id = id
self.type = type
self.name = name
self.timestamp = timestamp
self.tenant_id = tenant_id
self.principal_oid = principal_oid
self.policy_definition_action = policy_definition_action
[docs]class ComponentStateDetails(msrest.serialization.Model):
"""Component state details.
:param additional_properties: Unmatched properties from the message are deserialized to this
collection.
:type additional_properties: dict[str, any]
:param id: Component Id.
:type id: str
:param type: Component type.
:type type: str
:param name: Component name.
:type name: str
:param timestamp: Component compliance evaluation timestamp.
:type timestamp: ~datetime.datetime
:param compliance_state: Component compliance state.
:type compliance_state: str
"""
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'compliance_state': {'key': 'complianceState', 'type': 'str'},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
id: Optional[str] = None,
type: Optional[str] = None,
name: Optional[str] = None,
timestamp: Optional[datetime.datetime] = None,
compliance_state: Optional[str] = None,
**kwargs
):
super(ComponentStateDetails, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.id = id
self.type = type
self.name = name
self.timestamp = timestamp
self.compliance_state = compliance_state
[docs]class ErrorDefinition(msrest.serialization.Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: Service specific error code which serves as the substatus for the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
:ivar target: The target of the error.
:vartype target: str
:ivar details: Internal error details.
:vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinition]
:ivar additional_info: Additional scenario specific error details.
:vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo]
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
'details': {'readonly': True},
'additional_info': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinition]'},
'additional_info': {'key': 'additionalInfo', 'type': '[TypedErrorInfo]'},
}
def __init__(
self,
**kwargs
):
super(ErrorDefinition, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = None
self.additional_info = None
[docs]class ErrorDefinitionAutoGenerated(msrest.serialization.Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: Service specific error code which serves as the substatus for the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
:ivar target: The target of the error.
:vartype target: str
:ivar details: Internal error details.
:vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated]
:ivar additional_info: Additional scenario specific error details.
:vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo]
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
'details': {'readonly': True},
'additional_info': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinitionAutoGenerated]'},
'additional_info': {'key': 'additionalInfo', 'type': '[TypedErrorInfo]'},
}
def __init__(
self,
**kwargs
):
super(ErrorDefinitionAutoGenerated, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = None
self.additional_info = None
[docs]class ErrorDefinitionAutoGenerated2(msrest.serialization.Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: Service specific error code which serves as the substatus for the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
:ivar target: The target of the error.
:vartype target: str
:ivar details: Internal error details.
:vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated2]
:ivar additional_info: Additional scenario specific error details.
:vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo]
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
'details': {'readonly': True},
'additional_info': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinitionAutoGenerated2]'},
'additional_info': {'key': 'additionalInfo', 'type': '[TypedErrorInfo]'},
}
def __init__(
self,
**kwargs
):
super(ErrorDefinitionAutoGenerated2, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = None
self.additional_info = None
[docs]class ErrorResponse(msrest.serialization.Model):
"""Error response.
:param error: The error details.
:type error: ~azure.mgmt.policyinsights.models.ErrorDefinition
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinition'},
}
def __init__(
self,
*,
error: Optional["ErrorDefinition"] = None,
**kwargs
):
super(ErrorResponse, self).__init__(**kwargs)
self.error = error
[docs]class ErrorResponseAutoGenerated(msrest.serialization.Model):
"""Error response.
:param error: The error details.
:type error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinitionAutoGenerated'},
}
def __init__(
self,
*,
error: Optional["ErrorDefinitionAutoGenerated"] = None,
**kwargs
):
super(ErrorResponseAutoGenerated, self).__init__(**kwargs)
self.error = error
[docs]class ErrorResponseAutoGenerated2(msrest.serialization.Model):
"""Error response.
:param error: The error details.
:type error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated2
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinitionAutoGenerated2'},
}
def __init__(
self,
*,
error: Optional["ErrorDefinitionAutoGenerated2"] = None,
**kwargs
):
super(ErrorResponseAutoGenerated2, self).__init__(**kwargs)
self.error = error
[docs]class ExpressionEvaluationDetails(msrest.serialization.Model):
"""Evaluation details of policy language expressions.
Variables are only populated by the server, and will be ignored when sending a request.
:param result: Evaluation result.
:type result: str
:param expression: Expression evaluated.
:type expression: str
:ivar expression_kind: The kind of expression that was evaluated.
:vartype expression_kind: str
:param path: Property path if the expression is a field or an alias.
:type path: str
:param expression_value: Value of the expression.
:type expression_value: any
:param target_value: Target value to be compared with the expression value.
:type target_value: any
:param operator: Operator to compare the expression value and the target value.
:type operator: str
"""
_validation = {
'expression_kind': {'readonly': True},
}
_attribute_map = {
'result': {'key': 'result', 'type': 'str'},
'expression': {'key': 'expression', 'type': 'str'},
'expression_kind': {'key': 'expressionKind', 'type': 'str'},
'path': {'key': 'path', 'type': 'str'},
'expression_value': {'key': 'expressionValue', 'type': 'object'},
'target_value': {'key': 'targetValue', 'type': 'object'},
'operator': {'key': 'operator', 'type': 'str'},
}
def __init__(
self,
*,
result: Optional[str] = None,
expression: Optional[str] = None,
path: Optional[str] = None,
expression_value: Optional[Any] = None,
target_value: Optional[Any] = None,
operator: Optional[str] = None,
**kwargs
):
super(ExpressionEvaluationDetails, self).__init__(**kwargs)
self.result = result
self.expression = expression
self.expression_kind = None
self.path = path
self.expression_value = expression_value
self.target_value = target_value
self.operator = operator
[docs]class FieldRestriction(msrest.serialization.Model):
"""The restrictions on a field imposed by a specific policy.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar result: The type of restriction that is imposed on the field. Possible values include:
"Required", "Removed", "Deny".
:vartype result: str or ~azure.mgmt.policyinsights.models.FieldRestrictionResult
:ivar default_value: The value that policy will set for the field if the user does not provide
a value.
:vartype default_value: str
:ivar values: The values that policy either requires or denies for the field.
:vartype values: list[str]
:ivar policy: The details of the policy that is causing the field restriction.
:vartype policy: ~azure.mgmt.policyinsights.models.PolicyReference
"""
_validation = {
'result': {'readonly': True},
'default_value': {'readonly': True},
'values': {'readonly': True},
'policy': {'readonly': True},
}
_attribute_map = {
'result': {'key': 'result', 'type': 'str'},
'default_value': {'key': 'defaultValue', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
'policy': {'key': 'policy', 'type': 'PolicyReference'},
}
def __init__(
self,
**kwargs
):
super(FieldRestriction, self).__init__(**kwargs)
self.result = None
self.default_value = None
self.values = None
self.policy = None
[docs]class FieldRestrictions(msrest.serialization.Model):
"""The restrictions that will be placed on a field in the resource by policy.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar field: The name of the field. This can be a top-level property like 'name' or 'type' or
an Azure Policy field alias.
:vartype field: str
:param restrictions: The restrictions placed on that field by policy.
:type restrictions: list[~azure.mgmt.policyinsights.models.FieldRestriction]
"""
_validation = {
'field': {'readonly': True},
}
_attribute_map = {
'field': {'key': 'field', 'type': 'str'},
'restrictions': {'key': 'restrictions', 'type': '[FieldRestriction]'},
}
def __init__(
self,
*,
restrictions: Optional[List["FieldRestriction"]] = None,
**kwargs
):
super(FieldRestrictions, self).__init__(**kwargs)
self.field = None
self.restrictions = restrictions
[docs]class IfNotExistsEvaluationDetails(msrest.serialization.Model):
"""Evaluation details of IfNotExists effect.
:param resource_id: ID of the last evaluated resource for IfNotExists effect.
:type resource_id: str
:param total_resources: Total number of resources to which the existence condition is
applicable.
:type total_resources: int
"""
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'total_resources': {'key': 'totalResources', 'type': 'int'},
}
def __init__(
self,
*,
resource_id: Optional[str] = None,
total_resources: Optional[int] = None,
**kwargs
):
super(IfNotExistsEvaluationDetails, self).__init__(**kwargs)
self.resource_id = resource_id
self.total_resources = total_resources
[docs]class Operation(msrest.serialization.Model):
"""Operation definition.
:param name: Operation name.
:type name: str
:param display: Display metadata associated with the operation.
:type display: ~azure.mgmt.policyinsights.models.OperationDisplay
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
}
def __init__(
self,
*,
name: Optional[str] = None,
display: Optional["OperationDisplay"] = None,
**kwargs
):
super(Operation, self).__init__(**kwargs)
self.name = name
self.display = display
[docs]class OperationDisplay(msrest.serialization.Model):
"""Display metadata associated with the operation.
:param provider: Resource provider name.
:type provider: str
:param resource: Resource name on which the operation is performed.
:type resource: str
:param operation: Operation name.
:type operation: str
:param description: Operation description.
:type description: str
"""
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(
self,
*,
provider: Optional[str] = None,
resource: Optional[str] = None,
operation: Optional[str] = None,
description: Optional[str] = None,
**kwargs
):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
[docs]class OperationsListResults(msrest.serialization.Model):
"""List of available operations.
:param odata_count: OData entity count; represents the number of operations returned.
:type odata_count: int
:param value: List of available operations.
:type value: list[~azure.mgmt.policyinsights.models.Operation]
"""
_validation = {
'odata_count': {'minimum': 1},
}
_attribute_map = {
'odata_count': {'key': '@odata\\.count', 'type': 'int'},
'value': {'key': 'value', 'type': '[Operation]'},
}
def __init__(
self,
*,
odata_count: Optional[int] = None,
value: Optional[List["Operation"]] = None,
**kwargs
):
super(OperationsListResults, self).__init__(**kwargs)
self.odata_count = odata_count
self.value = value
[docs]class PendingField(msrest.serialization.Model):
"""A field that should be evaluated against Azure Policy to determine restrictions.
All required parameters must be populated in order to send to Azure.
:param field: Required. The name of the field. This can be a top-level property like 'name' or
'type' or an Azure Policy field alias.
:type field: str
:param values: The list of potential values for the field that should be evaluated against
Azure Policy.
:type values: list[str]
"""
_validation = {
'field': {'required': True},
}
_attribute_map = {
'field': {'key': 'field', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
}
def __init__(
self,
*,
field: str,
values: Optional[List[str]] = None,
**kwargs
):
super(PendingField, self).__init__(**kwargs)
self.field = field
self.values = values
[docs]class PolicyAssignmentSummary(msrest.serialization.Model):
"""Policy assignment summary.
:param policy_assignment_id: Policy assignment ID.
:type policy_assignment_id: str
:param policy_set_definition_id: Policy set definition ID, if the policy assignment is for a
policy set.
:type policy_set_definition_id: str
:param results: Compliance summary for the policy assignment.
:type results: ~azure.mgmt.policyinsights.models.SummaryResults
:param policy_definitions: Policy definitions summary.
:type policy_definitions: list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary]
:param policy_groups: Policy definition group summary.
:type policy_groups: list[~azure.mgmt.policyinsights.models.PolicyGroupSummary]
"""
_attribute_map = {
'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'},
'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'},
'results': {'key': 'results', 'type': 'SummaryResults'},
'policy_definitions': {'key': 'policyDefinitions', 'type': '[PolicyDefinitionSummary]'},
'policy_groups': {'key': 'policyGroups', 'type': '[PolicyGroupSummary]'},
}
def __init__(
self,
*,
policy_assignment_id: Optional[str] = None,
policy_set_definition_id: Optional[str] = None,
results: Optional["SummaryResults"] = None,
policy_definitions: Optional[List["PolicyDefinitionSummary"]] = None,
policy_groups: Optional[List["PolicyGroupSummary"]] = None,
**kwargs
):
super(PolicyAssignmentSummary, self).__init__(**kwargs)
self.policy_assignment_id = policy_assignment_id
self.policy_set_definition_id = policy_set_definition_id
self.results = results
self.policy_definitions = policy_definitions
self.policy_groups = policy_groups
[docs]class PolicyDefinitionSummary(msrest.serialization.Model):
"""Policy definition summary.
:param policy_definition_id: Policy definition ID.
:type policy_definition_id: str
:param policy_definition_reference_id: Policy definition reference ID.
:type policy_definition_reference_id: str
:param policy_definition_group_names: Policy definition group names.
:type policy_definition_group_names: list[str]
:param effect: Policy effect, i.e. policy definition action.
:type effect: str
:param results: Compliance summary for the policy definition.
:type results: ~azure.mgmt.policyinsights.models.SummaryResults
"""
_attribute_map = {
'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'},
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
'policy_definition_group_names': {'key': 'policyDefinitionGroupNames', 'type': '[str]'},
'effect': {'key': 'effect', 'type': 'str'},
'results': {'key': 'results', 'type': 'SummaryResults'},
}
def __init__(
self,
*,
policy_definition_id: Optional[str] = None,
policy_definition_reference_id: Optional[str] = None,
policy_definition_group_names: Optional[List[str]] = None,
effect: Optional[str] = None,
results: Optional["SummaryResults"] = None,
**kwargs
):
super(PolicyDefinitionSummary, self).__init__(**kwargs)
self.policy_definition_id = policy_definition_id
self.policy_definition_reference_id = policy_definition_reference_id
self.policy_definition_group_names = policy_definition_group_names
self.effect = effect
self.results = results
[docs]class PolicyDetails(msrest.serialization.Model):
"""The policy details.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar policy_definition_id: The ID of the policy definition.
:vartype policy_definition_id: str
:ivar policy_assignment_id: The ID of the policy assignment.
:vartype policy_assignment_id: str
:ivar policy_assignment_display_name: The display name of the policy assignment.
:vartype policy_assignment_display_name: str
:ivar policy_assignment_scope: The scope of the policy assignment.
:vartype policy_assignment_scope: str
:ivar policy_set_definition_id: The ID of the policy set definition.
:vartype policy_set_definition_id: str
:ivar policy_definition_reference_id: The policy definition reference ID within the policy set
definition.
:vartype policy_definition_reference_id: str
"""
_validation = {
'policy_definition_id': {'readonly': True},
'policy_assignment_id': {'readonly': True},
'policy_assignment_display_name': {'readonly': True},
'policy_assignment_scope': {'readonly': True},
'policy_set_definition_id': {'readonly': True},
'policy_definition_reference_id': {'readonly': True},
}
_attribute_map = {
'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'},
'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'},
'policy_assignment_display_name': {'key': 'policyAssignmentDisplayName', 'type': 'str'},
'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'},
'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'},
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(PolicyDetails, self).__init__(**kwargs)
self.policy_definition_id = None
self.policy_assignment_id = None
self.policy_assignment_display_name = None
self.policy_assignment_scope = None
self.policy_set_definition_id = None
self.policy_definition_reference_id = None
[docs]class PolicyEvaluationDetails(msrest.serialization.Model):
"""Policy evaluation details.
:param evaluated_expressions: Details of the evaluated expressions.
:type evaluated_expressions:
list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails]
:param if_not_exists_details: Evaluation details of IfNotExists effect.
:type if_not_exists_details: ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails
"""
_attribute_map = {
'evaluated_expressions': {'key': 'evaluatedExpressions', 'type': '[ExpressionEvaluationDetails]'},
'if_not_exists_details': {'key': 'ifNotExistsDetails', 'type': 'IfNotExistsEvaluationDetails'},
}
def __init__(
self,
*,
evaluated_expressions: Optional[List["ExpressionEvaluationDetails"]] = None,
if_not_exists_details: Optional["IfNotExistsEvaluationDetails"] = None,
**kwargs
):
super(PolicyEvaluationDetails, self).__init__(**kwargs)
self.evaluated_expressions = evaluated_expressions
self.if_not_exists_details = if_not_exists_details
[docs]class PolicyEvaluationResult(msrest.serialization.Model):
"""The result of a non-compliant policy evaluation against the given resource content.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar policy_info: The details of the policy that was evaluated.
:vartype policy_info: ~azure.mgmt.policyinsights.models.PolicyReference
:ivar evaluation_result: The result of the policy evaluation against the resource. This will
typically be 'NonCompliant' but may contain other values if errors were encountered.
:vartype evaluation_result: str
:ivar evaluation_details: The detailed results of the policy expressions and values that were
evaluated.
:vartype evaluation_details: ~azure.mgmt.policyinsights.models.PolicyEvaluationDetails
"""
_validation = {
'policy_info': {'readonly': True},
'evaluation_result': {'readonly': True},
'evaluation_details': {'readonly': True},
}
_attribute_map = {
'policy_info': {'key': 'policyInfo', 'type': 'PolicyReference'},
'evaluation_result': {'key': 'evaluationResult', 'type': 'str'},
'evaluation_details': {'key': 'evaluationDetails', 'type': 'PolicyEvaluationDetails'},
}
def __init__(
self,
**kwargs
):
super(PolicyEvaluationResult, self).__init__(**kwargs)
self.policy_info = None
self.evaluation_result = None
self.evaluation_details = None
[docs]class PolicyEvent(msrest.serialization.Model):
"""Policy event record.
:param additional_properties: Unmatched properties from the message are deserialized to this
collection.
:type additional_properties: dict[str, any]
:param odata_id: OData entity ID; always set to null since policy event records do not have an
entity ID.
:type odata_id: str
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param timestamp: Timestamp for the policy event record.
:type timestamp: ~datetime.datetime
:param resource_id: Resource ID.
:type resource_id: str
:param policy_assignment_id: Policy assignment ID.
:type policy_assignment_id: str
:param policy_definition_id: Policy definition ID.
:type policy_definition_id: str
:param effective_parameters: Effective parameters for the policy assignment.
:type effective_parameters: str
:param is_compliant: Flag which states whether the resource is compliant against the policy
assignment it was evaluated against.
:type is_compliant: bool
:param subscription_id: Subscription ID.
:type subscription_id: str
:param resource_type: Resource type.
:type resource_type: str
:param resource_location: Resource location.
:type resource_location: str
:param resource_group: Resource group name.
:type resource_group: str
:param resource_tags: List of resource tags.
:type resource_tags: str
:param policy_assignment_name: Policy assignment name.
:type policy_assignment_name: str
:param policy_assignment_owner: Policy assignment owner.
:type policy_assignment_owner: str
:param policy_assignment_parameters: Policy assignment parameters.
:type policy_assignment_parameters: str
:param policy_assignment_scope: Policy assignment scope.
:type policy_assignment_scope: str
:param policy_definition_name: Policy definition name.
:type policy_definition_name: str
:param policy_definition_action: Policy definition action, i.e. effect.
:type policy_definition_action: str
:param policy_definition_category: Policy definition category.
:type policy_definition_category: str
:param policy_set_definition_id: Policy set definition ID, if the policy assignment is for a
policy set.
:type policy_set_definition_id: str
:param policy_set_definition_name: Policy set definition name, if the policy assignment is for
a policy set.
:type policy_set_definition_name: str
:param policy_set_definition_owner: Policy set definition owner, if the policy assignment is
for a policy set.
:type policy_set_definition_owner: str
:param policy_set_definition_category: Policy set definition category, if the policy assignment
is for a policy set.
:type policy_set_definition_category: str
:param policy_set_definition_parameters: Policy set definition parameters, if the policy
assignment is for a policy set.
:type policy_set_definition_parameters: str
:param management_group_ids: Comma separated list of management group IDs, which represent the
hierarchy of the management groups the resource is under.
:type management_group_ids: str
:param policy_definition_reference_id: Reference ID for the policy definition inside the policy
set, if the policy assignment is for a policy set.
:type policy_definition_reference_id: str
:param compliance_state: Compliance state of the resource.
:type compliance_state: str
:param tenant_id: Tenant ID for the policy event record.
:type tenant_id: str
:param principal_oid: Principal object ID for the user who initiated the resource operation
that triggered the policy event.
:type principal_oid: str
:param components: Components events records populated only when URL contains
$expand=components clause.
:type components: list[~azure.mgmt.policyinsights.models.ComponentEventDetails]
"""
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'odata_id': {'key': '@odata\\.id', 'type': 'str'},
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'},
'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'},
'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'},
'is_compliant': {'key': 'isCompliant', 'type': 'bool'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_location': {'key': 'resourceLocation', 'type': 'str'},
'resource_group': {'key': 'resourceGroup', 'type': 'str'},
'resource_tags': {'key': 'resourceTags', 'type': 'str'},
'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'},
'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'},
'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'},
'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'},
'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'},
'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'},
'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'},
'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'},
'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'},
'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'},
'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'},
'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'},
'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'},
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
'compliance_state': {'key': 'complianceState', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'principal_oid': {'key': 'principalOid', 'type': 'str'},
'components': {'key': 'components', 'type': '[ComponentEventDetails]'},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
odata_id: Optional[str] = None,
odata_context: Optional[str] = None,
timestamp: Optional[datetime.datetime] = None,
resource_id: Optional[str] = None,
policy_assignment_id: Optional[str] = None,
policy_definition_id: Optional[str] = None,
effective_parameters: Optional[str] = None,
is_compliant: Optional[bool] = None,
subscription_id: Optional[str] = None,
resource_type: Optional[str] = None,
resource_location: Optional[str] = None,
resource_group: Optional[str] = None,
resource_tags: Optional[str] = None,
policy_assignment_name: Optional[str] = None,
policy_assignment_owner: Optional[str] = None,
policy_assignment_parameters: Optional[str] = None,
policy_assignment_scope: Optional[str] = None,
policy_definition_name: Optional[str] = None,
policy_definition_action: Optional[str] = None,
policy_definition_category: Optional[str] = None,
policy_set_definition_id: Optional[str] = None,
policy_set_definition_name: Optional[str] = None,
policy_set_definition_owner: Optional[str] = None,
policy_set_definition_category: Optional[str] = None,
policy_set_definition_parameters: Optional[str] = None,
management_group_ids: Optional[str] = None,
policy_definition_reference_id: Optional[str] = None,
compliance_state: Optional[str] = None,
tenant_id: Optional[str] = None,
principal_oid: Optional[str] = None,
components: Optional[List["ComponentEventDetails"]] = None,
**kwargs
):
super(PolicyEvent, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.odata_id = odata_id
self.odata_context = odata_context
self.timestamp = timestamp
self.resource_id = resource_id
self.policy_assignment_id = policy_assignment_id
self.policy_definition_id = policy_definition_id
self.effective_parameters = effective_parameters
self.is_compliant = is_compliant
self.subscription_id = subscription_id
self.resource_type = resource_type
self.resource_location = resource_location
self.resource_group = resource_group
self.resource_tags = resource_tags
self.policy_assignment_name = policy_assignment_name
self.policy_assignment_owner = policy_assignment_owner
self.policy_assignment_parameters = policy_assignment_parameters
self.policy_assignment_scope = policy_assignment_scope
self.policy_definition_name = policy_definition_name
self.policy_definition_action = policy_definition_action
self.policy_definition_category = policy_definition_category
self.policy_set_definition_id = policy_set_definition_id
self.policy_set_definition_name = policy_set_definition_name
self.policy_set_definition_owner = policy_set_definition_owner
self.policy_set_definition_category = policy_set_definition_category
self.policy_set_definition_parameters = policy_set_definition_parameters
self.management_group_ids = management_group_ids
self.policy_definition_reference_id = policy_definition_reference_id
self.compliance_state = compliance_state
self.tenant_id = tenant_id
self.principal_oid = principal_oid
self.components = components
[docs]class PolicyEventsQueryResults(msrest.serialization.Model):
"""Query results.
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param odata_count: OData entity count; represents the number of policy event records returned.
:type odata_count: int
:param odata_next_link: Odata next link; URL to get the next set of results.
:type odata_next_link: str
:param value: Query results.
:type value: list[~azure.mgmt.policyinsights.models.PolicyEvent]
"""
_validation = {
'odata_count': {'minimum': 0},
}
_attribute_map = {
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'odata_count': {'key': '@odata\\.count', 'type': 'int'},
'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'},
'value': {'key': 'value', 'type': '[PolicyEvent]'},
}
def __init__(
self,
*,
odata_context: Optional[str] = None,
odata_count: Optional[int] = None,
odata_next_link: Optional[str] = None,
value: Optional[List["PolicyEvent"]] = None,
**kwargs
):
super(PolicyEventsQueryResults, self).__init__(**kwargs)
self.odata_context = odata_context
self.odata_count = odata_count
self.odata_next_link = odata_next_link
self.value = value
[docs]class PolicyGroupSummary(msrest.serialization.Model):
"""Policy definition group summary.
:param policy_group_name: Policy group name.
:type policy_group_name: str
:param results: Compliance summary for the policy definition group.
:type results: ~azure.mgmt.policyinsights.models.SummaryResults
"""
_attribute_map = {
'policy_group_name': {'key': 'policyGroupName', 'type': 'str'},
'results': {'key': 'results', 'type': 'SummaryResults'},
}
def __init__(
self,
*,
policy_group_name: Optional[str] = None,
results: Optional["SummaryResults"] = None,
**kwargs
):
super(PolicyGroupSummary, self).__init__(**kwargs)
self.policy_group_name = policy_group_name
self.results = results
[docs]class PolicyReference(msrest.serialization.Model):
"""Resource identifiers for a policy.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar policy_definition_id: The resource identifier of the policy definition.
:vartype policy_definition_id: str
:ivar policy_set_definition_id: The resource identifier of the policy set definition.
:vartype policy_set_definition_id: str
:ivar policy_definition_reference_id: The reference identifier of a specific policy definition
within a policy set definition.
:vartype policy_definition_reference_id: str
:ivar policy_assignment_id: The resource identifier of the policy assignment.
:vartype policy_assignment_id: str
"""
_validation = {
'policy_definition_id': {'readonly': True},
'policy_set_definition_id': {'readonly': True},
'policy_definition_reference_id': {'readonly': True},
'policy_assignment_id': {'readonly': True},
}
_attribute_map = {
'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'},
'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'},
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(PolicyReference, self).__init__(**kwargs)
self.policy_definition_id = None
self.policy_set_definition_id = None
self.policy_definition_reference_id = None
self.policy_assignment_id = None
[docs]class PolicyState(msrest.serialization.Model):
"""Policy state record.
Variables are only populated by the server, and will be ignored when sending a request.
:param additional_properties: Unmatched properties from the message are deserialized to this
collection.
:type additional_properties: dict[str, any]
:param odata_id: OData entity ID; always set to null since policy state records do not have an
entity ID.
:type odata_id: str
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param timestamp: Timestamp for the policy state record.
:type timestamp: ~datetime.datetime
:param resource_id: Resource ID.
:type resource_id: str
:param policy_assignment_id: Policy assignment ID.
:type policy_assignment_id: str
:param policy_definition_id: Policy definition ID.
:type policy_definition_id: str
:param effective_parameters: Effective parameters for the policy assignment.
:type effective_parameters: str
:param is_compliant: Flag which states whether the resource is compliant against the policy
assignment it was evaluated against. This property is deprecated; please use ComplianceState
instead.
:type is_compliant: bool
:param subscription_id: Subscription ID.
:type subscription_id: str
:param resource_type: Resource type.
:type resource_type: str
:param resource_location: Resource location.
:type resource_location: str
:param resource_group: Resource group name.
:type resource_group: str
:param resource_tags: List of resource tags.
:type resource_tags: str
:param policy_assignment_name: Policy assignment name.
:type policy_assignment_name: str
:param policy_assignment_owner: Policy assignment owner.
:type policy_assignment_owner: str
:param policy_assignment_parameters: Policy assignment parameters.
:type policy_assignment_parameters: str
:param policy_assignment_scope: Policy assignment scope.
:type policy_assignment_scope: str
:param policy_definition_name: Policy definition name.
:type policy_definition_name: str
:param policy_definition_action: Policy definition action, i.e. effect.
:type policy_definition_action: str
:param policy_definition_category: Policy definition category.
:type policy_definition_category: str
:param policy_set_definition_id: Policy set definition ID, if the policy assignment is for a
policy set.
:type policy_set_definition_id: str
:param policy_set_definition_name: Policy set definition name, if the policy assignment is for
a policy set.
:type policy_set_definition_name: str
:param policy_set_definition_owner: Policy set definition owner, if the policy assignment is
for a policy set.
:type policy_set_definition_owner: str
:param policy_set_definition_category: Policy set definition category, if the policy assignment
is for a policy set.
:type policy_set_definition_category: str
:param policy_set_definition_parameters: Policy set definition parameters, if the policy
assignment is for a policy set.
:type policy_set_definition_parameters: str
:param management_group_ids: Comma separated list of management group IDs, which represent the
hierarchy of the management groups the resource is under.
:type management_group_ids: str
:param policy_definition_reference_id: Reference ID for the policy definition inside the policy
set, if the policy assignment is for a policy set.
:type policy_definition_reference_id: str
:param compliance_state: Compliance state of the resource.
:type compliance_state: str
:param policy_evaluation_details: Policy evaluation details.
:type policy_evaluation_details: ~azure.mgmt.policyinsights.models.PolicyEvaluationDetails
:param policy_definition_group_names: Policy definition group names.
:type policy_definition_group_names: list[str]
:param components: Components state compliance records populated only when URL contains
$expand=components clause.
:type components: list[~azure.mgmt.policyinsights.models.ComponentStateDetails]
:ivar policy_definition_version: Evaluated policy definition version.
:vartype policy_definition_version: str
:ivar policy_set_definition_version: Evaluated policy set definition version.
:vartype policy_set_definition_version: str
:ivar policy_assignment_version: Evaluated policy assignment version.
:vartype policy_assignment_version: str
"""
_validation = {
'policy_definition_version': {'readonly': True},
'policy_set_definition_version': {'readonly': True},
'policy_assignment_version': {'readonly': True},
}
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'odata_id': {'key': '@odata\\.id', 'type': 'str'},
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'},
'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'},
'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'},
'is_compliant': {'key': 'isCompliant', 'type': 'bool'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'resource_type': {'key': 'resourceType', 'type': 'str'},
'resource_location': {'key': 'resourceLocation', 'type': 'str'},
'resource_group': {'key': 'resourceGroup', 'type': 'str'},
'resource_tags': {'key': 'resourceTags', 'type': 'str'},
'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'},
'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'},
'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'},
'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'},
'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'},
'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'},
'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'},
'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'},
'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'},
'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'},
'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'},
'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'},
'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'},
'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'},
'compliance_state': {'key': 'complianceState', 'type': 'str'},
'policy_evaluation_details': {'key': 'policyEvaluationDetails', 'type': 'PolicyEvaluationDetails'},
'policy_definition_group_names': {'key': 'policyDefinitionGroupNames', 'type': '[str]'},
'components': {'key': 'components', 'type': '[ComponentStateDetails]'},
'policy_definition_version': {'key': 'policyDefinitionVersion', 'type': 'str'},
'policy_set_definition_version': {'key': 'policySetDefinitionVersion', 'type': 'str'},
'policy_assignment_version': {'key': 'policyAssignmentVersion', 'type': 'str'},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
odata_id: Optional[str] = None,
odata_context: Optional[str] = None,
timestamp: Optional[datetime.datetime] = None,
resource_id: Optional[str] = None,
policy_assignment_id: Optional[str] = None,
policy_definition_id: Optional[str] = None,
effective_parameters: Optional[str] = None,
is_compliant: Optional[bool] = None,
subscription_id: Optional[str] = None,
resource_type: Optional[str] = None,
resource_location: Optional[str] = None,
resource_group: Optional[str] = None,
resource_tags: Optional[str] = None,
policy_assignment_name: Optional[str] = None,
policy_assignment_owner: Optional[str] = None,
policy_assignment_parameters: Optional[str] = None,
policy_assignment_scope: Optional[str] = None,
policy_definition_name: Optional[str] = None,
policy_definition_action: Optional[str] = None,
policy_definition_category: Optional[str] = None,
policy_set_definition_id: Optional[str] = None,
policy_set_definition_name: Optional[str] = None,
policy_set_definition_owner: Optional[str] = None,
policy_set_definition_category: Optional[str] = None,
policy_set_definition_parameters: Optional[str] = None,
management_group_ids: Optional[str] = None,
policy_definition_reference_id: Optional[str] = None,
compliance_state: Optional[str] = None,
policy_evaluation_details: Optional["PolicyEvaluationDetails"] = None,
policy_definition_group_names: Optional[List[str]] = None,
components: Optional[List["ComponentStateDetails"]] = None,
**kwargs
):
super(PolicyState, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.odata_id = odata_id
self.odata_context = odata_context
self.timestamp = timestamp
self.resource_id = resource_id
self.policy_assignment_id = policy_assignment_id
self.policy_definition_id = policy_definition_id
self.effective_parameters = effective_parameters
self.is_compliant = is_compliant
self.subscription_id = subscription_id
self.resource_type = resource_type
self.resource_location = resource_location
self.resource_group = resource_group
self.resource_tags = resource_tags
self.policy_assignment_name = policy_assignment_name
self.policy_assignment_owner = policy_assignment_owner
self.policy_assignment_parameters = policy_assignment_parameters
self.policy_assignment_scope = policy_assignment_scope
self.policy_definition_name = policy_definition_name
self.policy_definition_action = policy_definition_action
self.policy_definition_category = policy_definition_category
self.policy_set_definition_id = policy_set_definition_id
self.policy_set_definition_name = policy_set_definition_name
self.policy_set_definition_owner = policy_set_definition_owner
self.policy_set_definition_category = policy_set_definition_category
self.policy_set_definition_parameters = policy_set_definition_parameters
self.management_group_ids = management_group_ids
self.policy_definition_reference_id = policy_definition_reference_id
self.compliance_state = compliance_state
self.policy_evaluation_details = policy_evaluation_details
self.policy_definition_group_names = policy_definition_group_names
self.components = components
self.policy_definition_version = None
self.policy_set_definition_version = None
self.policy_assignment_version = None
[docs]class PolicyStatesQueryResults(msrest.serialization.Model):
"""Query results.
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param odata_count: OData entity count; represents the number of policy state records returned.
:type odata_count: int
:param odata_next_link: Odata next link; URL to get the next set of results.
:type odata_next_link: str
:param value: Query results.
:type value: list[~azure.mgmt.policyinsights.models.PolicyState]
"""
_validation = {
'odata_count': {'minimum': 0},
}
_attribute_map = {
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'odata_count': {'key': '@odata\\.count', 'type': 'int'},
'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'},
'value': {'key': 'value', 'type': '[PolicyState]'},
}
def __init__(
self,
*,
odata_context: Optional[str] = None,
odata_count: Optional[int] = None,
odata_next_link: Optional[str] = None,
value: Optional[List["PolicyState"]] = None,
**kwargs
):
super(PolicyStatesQueryResults, self).__init__(**kwargs)
self.odata_context = odata_context
self.odata_count = odata_count
self.odata_next_link = odata_next_link
self.value = value
[docs]class PolicyTrackedResource(msrest.serialization.Model):
"""Policy tracked resource record.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar tracked_resource_id: The ID of the policy tracked resource.
:vartype tracked_resource_id: str
:ivar policy_details: The details of the policy that require the tracked resource.
:vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails
:ivar created_by: The details of the policy triggered deployment that created the tracked
resource.
:vartype created_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails
:ivar last_modified_by: The details of the policy triggered deployment that modified the
tracked resource.
:vartype last_modified_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails
:ivar last_update_utc: Timestamp of the last update to the tracked resource.
:vartype last_update_utc: ~datetime.datetime
"""
_validation = {
'tracked_resource_id': {'readonly': True},
'policy_details': {'readonly': True},
'created_by': {'readonly': True},
'last_modified_by': {'readonly': True},
'last_update_utc': {'readonly': True},
}
_attribute_map = {
'tracked_resource_id': {'key': 'trackedResourceId', 'type': 'str'},
'policy_details': {'key': 'policyDetails', 'type': 'PolicyDetails'},
'created_by': {'key': 'createdBy', 'type': 'TrackedResourceModificationDetails'},
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'TrackedResourceModificationDetails'},
'last_update_utc': {'key': 'lastUpdateUtc', 'type': 'iso-8601'},
}
def __init__(
self,
**kwargs
):
super(PolicyTrackedResource, self).__init__(**kwargs)
self.tracked_resource_id = None
self.policy_details = None
self.created_by = None
self.last_modified_by = None
self.last_update_utc = None
[docs]class PolicyTrackedResourcesQueryResults(msrest.serialization.Model):
"""Query results.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: Query results.
:vartype value: list[~azure.mgmt.policyinsights.models.PolicyTrackedResource]
:ivar next_link: The URL to get the next set of results.
:vartype next_link: str
"""
_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[PolicyTrackedResource]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(PolicyTrackedResourcesQueryResults, self).__init__(**kwargs)
self.value = None
self.next_link = None
[docs]class QueryFailure(msrest.serialization.Model):
"""Error response.
:param error: Error definition.
:type error: ~azure.mgmt.policyinsights.models.QueryFailureError
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'QueryFailureError'},
}
def __init__(
self,
*,
error: Optional["QueryFailureError"] = None,
**kwargs
):
super(QueryFailure, self).__init__(**kwargs)
self.error = error
[docs]class QueryFailureError(msrest.serialization.Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: Service specific error code which serves as the substatus for the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(QueryFailureError, self).__init__(**kwargs)
self.code = None
self.message = None
[docs]class QueryOptions(msrest.serialization.Model):
"""Parameter group.
:param top: Maximum number of records to return.
:type top: int
:param filter: OData filter expression.
:type filter: str
:param order_by: Ordering expression using OData notation. One or more comma-separated column
names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId,
ResourceId asc".
:type order_by: str
:param select: Select expression using OData notation. Limits the columns on each record to
just those requested, e.g. "$select=PolicyAssignmentId, ResourceId".
:type select: str
:param from_property: ISO 8601 formatted timestamp specifying the start time of the interval to
query. When not specified, the service uses ($to - 1-day).
:type from_property: ~datetime.datetime
:param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When
not specified, the service uses request time.
:type to: ~datetime.datetime
:param apply: OData apply expression for aggregations.
:type apply: str
:param skip_token: Skiptoken is only provided if a previous response returned a partial result
as a part of nextLink element.
:type skip_token: str
:param expand: The $expand query parameter. For example, to expand components use
$expand=components.
:type expand: str
"""
_validation = {
'top': {'minimum': 0},
}
_attribute_map = {
'top': {'key': 'Top', 'type': 'int'},
'filter': {'key': 'Filter', 'type': 'str'},
'order_by': {'key': 'OrderBy', 'type': 'str'},
'select': {'key': 'Select', 'type': 'str'},
'from_property': {'key': 'FromProperty', 'type': 'iso-8601'},
'to': {'key': 'To', 'type': 'iso-8601'},
'apply': {'key': 'Apply', 'type': 'str'},
'skip_token': {'key': 'SkipToken', 'type': 'str'},
'expand': {'key': 'Expand', 'type': 'str'},
}
def __init__(
self,
*,
top: Optional[int] = None,
filter: Optional[str] = None,
order_by: Optional[str] = None,
select: Optional[str] = None,
from_property: Optional[datetime.datetime] = None,
to: Optional[datetime.datetime] = None,
apply: Optional[str] = None,
skip_token: Optional[str] = None,
expand: Optional[str] = None,
**kwargs
):
super(QueryOptions, self).__init__(**kwargs)
self.top = top
self.filter = filter
self.order_by = order_by
self.select = select
self.from_property = from_property
self.to = to
self.apply = apply
self.skip_token = skip_token
self.expand = expand
[docs]class SummarizeResults(msrest.serialization.Model):
"""Summarize action results.
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param odata_count: OData entity count; represents the number of summaries returned; always set
to 1.
:type odata_count: int
:param value: Summarize action results.
:type value: list[~azure.mgmt.policyinsights.models.Summary]
"""
_validation = {
'odata_count': {'maximum': 1, 'minimum': 1},
}
_attribute_map = {
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'odata_count': {'key': '@odata\\.count', 'type': 'int'},
'value': {'key': 'value', 'type': '[Summary]'},
}
def __init__(
self,
*,
odata_context: Optional[str] = None,
odata_count: Optional[int] = None,
value: Optional[List["Summary"]] = None,
**kwargs
):
super(SummarizeResults, self).__init__(**kwargs)
self.odata_context = odata_context
self.odata_count = odata_count
self.value = value
[docs]class Summary(msrest.serialization.Model):
"""Summary results.
:param odata_id: OData entity ID; always set to null since summaries do not have an entity ID.
:type odata_id: str
:param odata_context: OData context string; used by OData clients to resolve type information
based on metadata.
:type odata_context: str
:param results: Compliance summary for all policy assignments.
:type results: ~azure.mgmt.policyinsights.models.SummaryResults
:param policy_assignments: Policy assignments summary.
:type policy_assignments: list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary]
"""
_attribute_map = {
'odata_id': {'key': '@odata\\.id', 'type': 'str'},
'odata_context': {'key': '@odata\\.context', 'type': 'str'},
'results': {'key': 'results', 'type': 'SummaryResults'},
'policy_assignments': {'key': 'policyAssignments', 'type': '[PolicyAssignmentSummary]'},
}
def __init__(
self,
*,
odata_id: Optional[str] = None,
odata_context: Optional[str] = None,
results: Optional["SummaryResults"] = None,
policy_assignments: Optional[List["PolicyAssignmentSummary"]] = None,
**kwargs
):
super(Summary, self).__init__(**kwargs)
self.odata_id = odata_id
self.odata_context = odata_context
self.results = results
self.policy_assignments = policy_assignments
[docs]class SummaryResults(msrest.serialization.Model):
"""Compliance summary on a particular summary level.
:param query_results_uri: HTTP POST URI for queryResults action on Microsoft.PolicyInsights to
retrieve raw results for the compliance summary. This property will not be available by default
in future API versions, but could be queried explicitly.
:type query_results_uri: str
:param non_compliant_resources: Number of non-compliant resources.
:type non_compliant_resources: int
:param non_compliant_policies: Number of non-compliant policies.
:type non_compliant_policies: int
:param resource_details: The resources summary at this level.
:type resource_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail]
:param policy_details: The policy artifact summary at this level. For query scope level, it
represents policy assignment summary. For policy assignment level, it represents policy
definitions summary.
:type policy_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail]
:param policy_group_details: The policy definition group summary at this level.
:type policy_group_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail]
"""
_validation = {
'non_compliant_resources': {'minimum': 0},
'non_compliant_policies': {'minimum': 0},
}
_attribute_map = {
'query_results_uri': {'key': 'queryResultsUri', 'type': 'str'},
'non_compliant_resources': {'key': 'nonCompliantResources', 'type': 'int'},
'non_compliant_policies': {'key': 'nonCompliantPolicies', 'type': 'int'},
'resource_details': {'key': 'resourceDetails', 'type': '[ComplianceDetail]'},
'policy_details': {'key': 'policyDetails', 'type': '[ComplianceDetail]'},
'policy_group_details': {'key': 'policyGroupDetails', 'type': '[ComplianceDetail]'},
}
def __init__(
self,
*,
query_results_uri: Optional[str] = None,
non_compliant_resources: Optional[int] = None,
non_compliant_policies: Optional[int] = None,
resource_details: Optional[List["ComplianceDetail"]] = None,
policy_details: Optional[List["ComplianceDetail"]] = None,
policy_group_details: Optional[List["ComplianceDetail"]] = None,
**kwargs
):
super(SummaryResults, self).__init__(**kwargs)
self.query_results_uri = query_results_uri
self.non_compliant_resources = non_compliant_resources
self.non_compliant_policies = non_compliant_policies
self.resource_details = resource_details
self.policy_details = policy_details
self.policy_group_details = policy_group_details
[docs]class SystemData(msrest.serialization.Model):
"""Metadata pertaining to creation and last modification of the resource.
:param created_by: The identity that created the resource.
:type created_by: str
:param created_by_type: The type of identity that created the resource. Possible values
include: "User", "Application", "ManagedIdentity", "Key".
:type created_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType
:param created_at: The timestamp of resource creation (UTC).
:type created_at: ~datetime.datetime
:param last_modified_by: The identity that last modified the resource.
:type last_modified_by: str
:param last_modified_by_type: The type of identity that last modified the resource. Possible
values include: "User", "Application", "ManagedIdentity", "Key".
:type last_modified_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType
:param last_modified_at: The timestamp of resource last modification (UTC).
:type last_modified_at: ~datetime.datetime
"""
_attribute_map = {
'created_by': {'key': 'createdBy', 'type': 'str'},
'created_by_type': {'key': 'createdByType', 'type': 'str'},
'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'},
'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
}
def __init__(
self,
*,
created_by: Optional[str] = None,
created_by_type: Optional[Union[str, "CreatedByType"]] = None,
created_at: Optional[datetime.datetime] = None,
last_modified_by: Optional[str] = None,
last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None,
last_modified_at: Optional[datetime.datetime] = None,
**kwargs
):
super(SystemData, self).__init__(**kwargs)
self.created_by = created_by
self.created_by_type = created_by_type
self.created_at = created_at
self.last_modified_by = last_modified_by
self.last_modified_by_type = last_modified_by_type
self.last_modified_at = last_modified_at
[docs]class TrackedResourceModificationDetails(msrest.serialization.Model):
"""The details of the policy triggered deployment that created or modified the tracked resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar policy_details: The details of the policy that created or modified the tracked resource.
:vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails
:ivar deployment_id: The ID of the deployment that created or modified the tracked resource.
:vartype deployment_id: str
:ivar deployment_time: Timestamp of the deployment that created or modified the tracked
resource.
:vartype deployment_time: ~datetime.datetime
"""
_validation = {
'policy_details': {'readonly': True},
'deployment_id': {'readonly': True},
'deployment_time': {'readonly': True},
}
_attribute_map = {
'policy_details': {'key': 'policyDetails', 'type': 'PolicyDetails'},
'deployment_id': {'key': 'deploymentId', 'type': 'str'},
'deployment_time': {'key': 'deploymentTime', 'type': 'iso-8601'},
}
def __init__(
self,
**kwargs
):
super(TrackedResourceModificationDetails, self).__init__(**kwargs)
self.policy_details = None
self.deployment_id = None
self.deployment_time = None
[docs]class TypedErrorInfo(msrest.serialization.Model):
"""Scenario specific error details.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar type: The type of included error details.
:vartype type: str
:ivar info: The scenario specific error details.
:vartype info: any
"""
_validation = {
'type': {'readonly': True},
'info': {'readonly': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'info': {'key': 'info', 'type': 'object'},
}
def __init__(
self,
**kwargs
):
super(TypedErrorInfo, self).__init__(**kwargs)
self.type = None
self.info = None