{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-top-queries-list-result-schema.json",
  "title": "TopQueriesListResult",
  "description": "A list of top resource consuming queries on managed instance",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-managedinstances-api-openapi.yml#/components/schemas/TopQueriesListResult",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The TopQueries items on this page",
      "items": {
        "$ref": "#/$defs/TopQueries"
      }
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The link to the next page of items"
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "QueryMetricInterval": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "QueryStatisticsProperties": {
      "type": "object",
      "description": "Properties of a query execution statistics.",
      "properties": {
        "databaseName": {
          "type": "string",
          "description": "Database name of the database in which this query was executed.",
          "readOnly": true
        },
        "queryId": {
          "type": "string",
          "description": "Unique query id (unique within one database).",
          "readOnly": true
        },
        "startTime": {
          "type": "string",
          "description": "The start time for the metric (ISO-8601 format).",
          "readOnly": true
        },
        "endTime": {
          "type": "string",
          "description": "The end time for the metric (ISO-8601 format).",
          "readOnly": true
        },
        "intervals": {
          "type": "array",
          "description": "List of intervals with appropriate metric data",
          "items": {
            "$ref": "#/$defs/QueryMetricInterval"
          },
          "x-ms-identifiers": []
        }
      }
    },
    "QueryTimeGrainType": {
      "type": "string",
      "description": "Interval type (length).",
      "enum": [
        "PT1H",
        "P1D"
      ],
      "x-ms-enum": {
        "name": "QueryTimeGrainType",
        "modelAsString": true,
        "values": [
          {
            "name": "PT1H",
            "value": "PT1H",
            "description": "PT1H"
          },
          {
            "name": "P1D",
            "value": "P1D",
            "description": "P1D"
          }
        ]
      }
    },
    "TopQueries": {
      "type": "object",
      "properties": {
        "numberOfQueries": {
          "type": "integer",
          "format": "int32",
          "description": "Requested number of top queries.",
          "readOnly": true
        },
        "aggregationFunction": {
          "type": "string",
          "description": "Aggregation function used to calculate query metrics.",
          "readOnly": true
        },
        "observationMetric": {
          "type": "string",
          "description": "Metric used to rank queries.",
          "readOnly": true
        },
        "intervalType": {
          "$ref": "#/$defs/QueryTimeGrainType",
          "description": "Interval type (length).",
          "readOnly": true
        },
        "startTime": {
          "type": "string",
          "description": "The start time for the metric (ISO-8601 format).",
          "readOnly": true
        },
        "endTime": {
          "type": "string",
          "description": "The end time for the metric (ISO-8601 format).",
          "readOnly": true
        },
        "queries": {
          "type": "array",
          "description": "List of top resource consuming queries with appropriate metric data",
          "items": {
            "$ref": "#/$defs/QueryStatisticsProperties"
          },
          "x-ms-identifiers": []
        }
      }
    }
  }
}