{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-postgresql/json-schema/microsoft-azure-postgresql-object-recommendation-list-schema.json",
  "title": "ObjectRecommendationList",
  "description": "List of available object recommendations.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-postgresql-tuningoptionsoperationgroup-api-openapi.yml#/components/schemas/ObjectRecommendationList",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The ObjectRecommendation items on this page",
      "items": {
        "$ref": "#/$defs/ObjectRecommendation"
      },
      "x-ms-identifiers": [
        "name"
      ]
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The link to the next page of items"
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "ImpactRecord": {
      "type": "object",
      "description": "Impact on some metric if this recommended action is applied.",
      "properties": {
        "dimensionName": {
          "type": "string",
          "description": "Dimension name."
        },
        "unit": {
          "type": "string",
          "description": "Dimension unit."
        },
        "queryId": {
          "type": "integer",
          "format": "int64",
          "description": "Optional property that can be used to store the identifier of the query, if the metric is for a specific query."
        },
        "absoluteValue": {
          "type": "number",
          "format": "double",
          "description": "Absolute value."
        }
      }
    },
    "ObjectRecommendation": {
      "type": "object",
      "description": "Object recommendation properties.",
      "properties": {
        "kind": {
          "type": "string",
          "description": "Always empty."
        },
        "properties": {
          "$ref": "#/$defs/ObjectRecommendationProperties",
          "description": "Properties of an object recommendation.",
          "readOnly": true,
          "x-ms-client-flatten": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/ProxyResource"
        }
      ]
    },
    "ObjectRecommendationDetails": {
      "type": "object",
      "description": "Recommendation details for the recommended action.",
      "properties": {
        "databaseName": {
          "type": "string",
          "description": "Database name."
        },
        "schema": {
          "type": "string",
          "description": "Schema name."
        },
        "table": {
          "type": "string",
          "description": "Table name."
        },
        "indexType": {
          "type": "string",
          "description": "Index type."
        },
        "indexName": {
          "type": "string",
          "description": "Index name."
        },
        "indexColumns": {
          "type": "array",
          "description": "Index columns.",
          "items": {
            "type": "string"
          }
        },
        "includedColumns": {
          "type": "array",
          "description": "Index included columns.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ObjectRecommendationProperties": {
      "type": "object",
      "description": "Object recommendation properties.",
      "properties": {
        "initialRecommendedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Creation time (UTC) of this recommendation."
        },
        "lastRecommendedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last time (UTC) that this recommendation was produced."
        },
        "timesRecommended": {
          "type": "integer",
          "format": "int32",
          "description": "Number of times this recommendation has been produced."
        },
        "improvedQueryIds": {
          "type": "array",
          "description": "List of identifiers for all queries identified as targets for improvement if the recommendation is applied. The list is only populated for CREATE INDEX recommendations.",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        },
        "recommendationReason": {
          "type": "string",
          "description": "Reason for this recommendation."
        },
        "currentState": {
          "type": "string",
          "description": "Current state."
        },
        "recommendationType": {
          "$ref": "#/$defs/RecommendationTypeEnum",
          "description": "Type for this recommendation."
        },
        "implementationDetails": {
          "$ref": "#/$defs/ObjectRecommendationPropertiesImplementationDetails",
          "description": "Implementation details for the recommended action."
        },
        "analyzedWorkload": {
          "$ref": "#/$defs/ObjectRecommendationPropertiesAnalyzedWorkload",
          "description": "Workload information for the recommended action."
        },
        "estimatedImpact": {
          "type": "array",
          "description": "Estimated impact of this recommended action.",
          "items": {
            "$ref": "#/$defs/ImpactRecord"
          },
          "readOnly": true,
          "x-ms-identifiers": [
            "dimensionName"
          ]
        },
        "details": {
          "$ref": "#/$defs/ObjectRecommendationDetails",
          "description": "Recommendation details for the recommended action.",
          "readOnly": true
        }
      }
    },
    "ObjectRecommendationPropertiesAnalyzedWorkload": {
      "type": "object",
      "description": "Workload information for the recommended action.",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "Start time (UTC) of the workload analyzed."
        },
        "endTime": {
          "type": "string",
          "format": "date-time",
          "description": "End time (UTC) of the workload analyzed."
        },
        "queryCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of queries from the workload that were examined to produce this recommendation. For DROP INDEX recommendations it's 0 (zero)."
        }
      }
    },
    "ObjectRecommendationPropertiesImplementationDetails": {
      "type": "object",
      "description": "Implementation details for the recommended action.",
      "properties": {
        "method": {
          "type": "string",
          "description": "Method of implementation for recommended action."
        },
        "script": {
          "type": "string",
          "description": "Implementation script for the recommended action."
        }
      }
    },
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "RecommendationTypeEnum": {
      "type": "string",
      "description": "Type for this recommendation.",
      "enum": [
        "CreateIndex",
        "DropIndex",
        "ReIndex",
        "AnalyzeTable",
        "VacuumTable"
      ],
      "x-ms-enum": {
        "name": "RecommendationTypeEnum",
        "modelAsString": true,
        "values": [
          {
            "name": "CreateIndex",
            "value": "CreateIndex",
            "description": "Recommendation to create an index to improve query performance."
          },
          {
            "name": "DropIndex",
            "value": "DropIndex",
            "description": "Recommendation to drop an existing index because it's duplicate or unused."
          },
          {
            "name": "ReIndex",
            "value": "ReIndex",
            "description": "Recommendation to reindex an existing invalid index."
          },
          {
            "name": "AnalyzeTable",
            "value": "AnalyzeTable",
            "description": "Recommendation to analyze a table to update statistics for the query optimizer."
          },
          {
            "name": "VacuumTable",
            "value": "VacuumTable",
            "description": "Recommendation to vacuum a table to reclaim storage and optimize performance."
          }
        ]
      }
    },
    "Resource": {
      "type": "object",
      "title": "Resource",
      "description": "Common fields that are returned in the response for all Azure Resource Manager resources",
      "properties": {
        "id": {
          "type": "string",
          "format": "arm-id",
          "description": "Fully qualified resource ID for the resource. E.g. \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}\"",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "The name of the resource",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"",
          "readOnly": true
        },
        "systemData": {
          "$ref": "#/$defs/systemData",
          "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.",
          "readOnly": true
        }
      },
      "x-ms-azure-resource": true
    }
  }
}