{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-policy/json-schema/microsoft-azure-policy-component-policy-states-query-results-schema.json",
  "title": "ComponentPolicyStatesQueryResults",
  "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/ComponentPolicyStatesQueryResults",
  "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 state records returned.",
      "minimum": 0
    },
    "value": {
      "type": "array",
      "description": "Query results.",
      "items": {
        "$ref": "#/$defs/ComponentPolicyState"
      },
      "x-ms-identifiers": []
    }
  },
  "$defs": {
    "ComponentExpressionEvaluationDetails": {
      "type": "object",
      "description": "Evaluation details of policy language expressions.",
      "properties": {
        "result": {
          "type": "string",
          "description": "Evaluation result."
        },
        "expression": {
          "type": "string",
          "description": "Expression evaluated.",
          "readOnly": true
        },
        "expressionKind": {
          "type": "string",
          "description": "The kind of expression that was evaluated.",
          "readOnly": true
        },
        "path": {
          "type": "string",
          "description": "Property path if the expression is a field or an alias.",
          "readOnly": true
        },
        "expressionValue": {
          "description": "Value of the expression.",
          "readOnly": true
        },
        "targetValue": {
          "description": "Target value to be compared with the expression value.",
          "readOnly": true
        },
        "operator": {
          "type": "string",
          "description": "Operator to compare the expression value and the target value.",
          "readOnly": true
        }
      }
    },
    "ComponentPolicyEvaluationDetails": {
      "type": "object",
      "description": "Policy evaluation details.",
      "properties": {
        "evaluatedExpressions": {
          "type": "array",
          "description": "Details of the evaluated expressions.",
          "items": {
            "$ref": "#/$defs/ComponentExpressionEvaluationDetails"
          },
          "readOnly": true,
          "x-ms-identifiers": []
        },
        "reason": {
          "type": "string",
          "description": "Additional textual reason for the evaluation outcome."
        }
      }
    },
    "ComponentPolicyState": {
      "type": "object",
      "description": "Component Policy State record.",
      "properties": {
        "@odata.id": {
          "type": "string",
          "description": "OData entity ID; always set to null since component policy state records do not have an entity ID.",
          "readOnly": true
        },
        "@odata.context": {
          "type": "string",
          "description": "OData context string; used by OData clients to resolve type information based on metadata.",
          "readOnly": true
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp for the component policy state record.",
          "readOnly": true
        },
        "componentId": {
          "type": "string",
          "description": "Component Id.",
          "readOnly": true
        },
        "componentType": {
          "type": "string",
          "description": "Component type.",
          "readOnly": true
        },
        "componentName": {
          "type": "string",
          "description": "Component name.",
          "readOnly": true
        },
        "resourceId": {
          "type": "string",
          "description": "Resource ID.",
          "readOnly": true
        },
        "policyAssignmentId": {
          "type": "string",
          "description": "Policy assignment ID.",
          "readOnly": true
        },
        "policyDefinitionId": {
          "type": "string",
          "description": "Policy definition ID.",
          "readOnly": true
        },
        "subscriptionId": {
          "type": "string",
          "description": "Subscription ID.",
          "readOnly": true
        },
        "resourceType": {
          "type": "string",
          "description": "Resource type.",
          "readOnly": true
        },
        "resourceLocation": {
          "type": "string",
          "description": "Resource location.",
          "readOnly": true
        },
        "resourceGroup": {
          "type": "string",
          "description": "Resource group name.",
          "readOnly": true
        },
        "policyAssignmentName": {
          "type": "string",
          "description": "Policy assignment name.",
          "readOnly": true
        },
        "policyAssignmentOwner": {
          "type": "string",
          "description": "Policy assignment owner.",
          "readOnly": true
        },
        "policyAssignmentParameters": {
          "type": "string",
          "description": "Policy assignment parameters.",
          "readOnly": true
        },
        "policyAssignmentScope": {
          "type": "string",
          "description": "Policy assignment scope.",
          "readOnly": true
        },
        "policyDefinitionName": {
          "type": "string",
          "description": "Policy definition name.",
          "readOnly": true
        },
        "policyDefinitionAction": {
          "type": "string",
          "description": "Policy definition action, i.e. effect.",
          "readOnly": true
        },
        "policyDefinitionCategory": {
          "type": "string",
          "description": "Policy definition category.",
          "readOnly": true
        },
        "policySetDefinitionId": {
          "type": "string",
          "description": "Policy set definition ID, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "policySetDefinitionName": {
          "type": "string",
          "description": "Policy set definition name, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "policySetDefinitionOwner": {
          "type": "string",
          "description": "Policy set definition owner, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "policySetDefinitionCategory": {
          "type": "string",
          "description": "Policy set definition category, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "policySetDefinitionParameters": {
          "type": "string",
          "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "policyDefinitionReferenceId": {
          "type": "string",
          "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
          "readOnly": true
        },
        "complianceState": {
          "type": "string",
          "description": "Compliance state of the resource.",
          "readOnly": true
        },
        "policyEvaluationDetails": {
          "$ref": "#/$defs/ComponentPolicyEvaluationDetails",
          "description": "Policy evaluation details. This is only included in the response if the request contains $expand=PolicyEvaluationDetails."
        },
        "policyDefinitionGroupNames": {
          "type": "array",
          "description": "Policy definition group names.",
          "items": {
            "type": "string"
          },
          "readOnly": true
        },
        "policyDefinitionVersion": {
          "type": "string",
          "description": "Evaluated policy definition version.",
          "readOnly": true
        },
        "policySetDefinitionVersion": {
          "type": "string",
          "description": "Evaluated policy set definition version.",
          "readOnly": true
        },
        "policyAssignmentVersion": {
          "type": "string",
          "description": "Evaluated policy assignment version.",
          "readOnly": true
        }
      },
      "additionalProperties": {}
    }
  }
}