{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-test-labs/json-schema/azure-test-labs-policy-fragment-schema.json",
  "title": "PolicyFragment",
  "description": "A Policy.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-test-labs-policies-api-openapi.yml#/components/schemas/PolicyFragment",
  "allOf": [
    {
      "$ref": "#/$defs/UpdateResource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/PolicyPropertiesFragment",
      "description": "The properties of the resource.",
      "x-ms-client-flatten": true
    }
  },
  "type": "object",
  "$defs": {
    "PolicyPropertiesFragment": {
      "description": "Properties of a Policy.",
      "properties": {
        "description": {
          "description": "The description of the policy.",
          "type": "string"
        },
        "evaluatorType": {
          "description": "The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).",
          "enum": [
            "AllowedValuesPolicy",
            "MaxValuePolicy"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "PolicyEvaluatorType"
          }
        },
        "factData": {
          "description": "The fact data of the policy.",
          "type": "string"
        },
        "factName": {
          "description": "The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.",
          "enum": [
            "UserOwnedLabVmCount",
            "UserOwnedLabPremiumVmCount",
            "LabVmCount",
            "LabPremiumVmCount",
            "LabVmSize",
            "GalleryImage",
            "UserOwnedLabVmCountInSubnet",
            "LabTargetCost",
            "EnvironmentTemplate",
            "ScheduleEditPermission"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "PolicyFactName"
          }
        },
        "status": {
          "description": "The status of the policy.",
          "enum": [
            "Enabled",
            "Disabled"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "PolicyStatus"
          }
        },
        "threshold": {
          "description": "The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).",
          "type": "string"
        }
      },
      "type": "object"
    },
    "UpdateResource": {
      "description": "Represents an update resource",
      "properties": {
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The tags of the resource.",
          "type": "object"
        }
      },
      "type": "object"
    }
  }
}