{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-policy/json-schema/microsoft-azure-policy-policy-events-query-results-schema.json",
  "title": "PolicyEventsQueryResults",
  "description": "Query results.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-policy-providers-api-openapi.yml#/components/schemas/PolicyEventsQueryResults",
  "type": "object",
  "properties": {
    "@odata.context": {
      "type": "string",
      "description": "OData context string; used by OData clients to resolve type information based on metadata."
    },
    "@odata.count": {
      "type": "integer",
      "format": "int32",
      "description": "OData entity count; represents the number of policy event records returned.",
      "minimum": 0
    },
    "@odata.nextLink": {
      "type": "string",
      "description": "Odata next link; URL to get the next set of results."
    },
    "value": {
      "type": "array",
      "description": "Query results.",
      "items": {
        "$ref": "#/$defs/PolicyEvent"
      },
      "x-ms-identifiers": []
    }
  },
  "$defs": {
    "ComponentEventDetails": {
      "type": "object",
      "description": "Component event details.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Component Id."
        },
        "type": {
          "type": "string",
          "description": "Component type."
        },
        "name": {
          "type": "string",
          "description": "Component name."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp for component policy event record."
        },
        "tenantId": {
          "type": "string",
          "description": "Tenant ID for the policy event record."
        },
        "principalOid": {
          "type": "string",
          "description": "Principal object ID for the user who initiated the resource component operation that triggered the policy event."
        },
        "policyDefinitionAction": {
          "type": "string",
          "description": "Policy definition action, i.e. effect."
        }
      },
      "additionalProperties": {}
    },
    "PolicyEvent": {
      "type": "object",
      "description": "Policy event record.",
      "properties": {
        "@odata.id": {
          "type": "string",
          "description": "OData entity ID; always set to null since policy event records do not have an entity ID."
        },
        "@odata.context": {
          "type": "string",
          "description": "OData context string; used by OData clients to resolve type information based on metadata."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp for the policy event record."
        },
        "resourceId": {
          "type": "string",
          "description": "Resource ID."
        },
        "policyAssignmentId": {
          "type": "string",
          "description": "Policy assignment ID."
        },
        "policyDefinitionId": {
          "type": "string",
          "description": "Policy definition ID."
        },
        "effectiveParameters": {
          "type": "string",
          "description": "Effective parameters for the policy assignment."
        },
        "isCompliant": {
          "type": "boolean",
          "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against."
        },
        "subscriptionId": {
          "type": "string",
          "description": "Subscription ID."
        },
        "resourceType": {
          "type": "string",
          "description": "Resource type."
        },
        "resourceLocation": {
          "type": "string",
          "description": "Resource location."
        },
        "resourceGroup": {
          "type": "string",
          "description": "Resource group name."
        },
        "resourceTags": {
          "type": "string",
          "description": "List of resource tags."
        },
        "policyAssignmentName": {
          "type": "string",
          "description": "Policy assignment name."
        },
        "policyAssignmentOwner": {
          "type": "string",
          "description": "Policy assignment owner."
        },
        "policyAssignmentParameters": {
          "type": "string",
          "description": "Policy assignment parameters."
        },
        "policyAssignmentScope": {
          "type": "string",
          "description": "Policy assignment scope."
        },
        "policyDefinitionName": {
          "type": "string",
          "description": "Policy definition name."
        },
        "policyDefinitionAction": {
          "type": "string",
          "description": "Policy definition action, i.e. effect."
        },
        "policyDefinitionCategory": {
          "type": "string",
          "description": "Policy definition category."
        },
        "policySetDefinitionId": {
          "type": "string",
          "description": "Policy set definition ID, if the policy assignment is for a policy set."
        },
        "policySetDefinitionName": {
          "type": "string",
          "description": "Policy set definition name, if the policy assignment is for a policy set."
        },
        "policySetDefinitionOwner": {
          "type": "string",
          "description": "Policy set definition owner, if the policy assignment is for a policy set."
        },
        "policySetDefinitionCategory": {
          "type": "string",
          "description": "Policy set definition category, if the policy assignment is for a policy set."
        },
        "policySetDefinitionParameters": {
          "type": "string",
          "description": "Policy set definition parameters, if the policy assignment is for a policy set."
        },
        "managementGroupIds": {
          "type": "string",
          "description": "Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under."
        },
        "policyDefinitionReferenceId": {
          "type": "string",
          "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set."
        },
        "complianceState": {
          "type": "string",
          "description": "Compliance state of the resource."
        },
        "tenantId": {
          "type": "string",
          "description": "Tenant ID for the policy event record."
        },
        "principalOid": {
          "type": "string",
          "description": "Principal object ID for the user who initiated the resource operation that triggered the policy event."
        },
        "components": {
          "type": "array",
          "description": "Components events records populated only when URL contains $expand=components clause.",
          "items": {
            "$ref": "#/$defs/ComponentEventDetails"
          }
        }
      },
      "additionalProperties": {}
    }
  }
}