{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-managed-instance-operation-schema.json",
  "title": "ManagedInstanceOperation",
  "description": "A managed instance operation.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-managedinstanceoperations-api-openapi.yml#/components/schemas/ManagedInstanceOperation",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/ManagedInstanceOperationProperties",
      "description": "Resource properties.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "$defs": {
    "ManagedInstanceOperationParametersPair": {
      "type": "object",
      "description": "The parameters of a managed instance operation.",
      "properties": {
        "currentParameters": {
          "$ref": "#/$defs/UpsertManagedServerOperationParameters",
          "description": "The current parameters.",
          "readOnly": true
        },
        "requestedParameters": {
          "$ref": "#/$defs/UpsertManagedServerOperationParameters",
          "description": "The requested parameters.",
          "readOnly": true
        }
      }
    },
    "ManagedInstanceOperationProperties": {
      "type": "object",
      "description": "The properties of a managed instance operation.",
      "properties": {
        "managedInstanceName": {
          "type": "string",
          "description": "The name of the managed instance the operation is being performed on.",
          "readOnly": true
        },
        "operation": {
          "type": "string",
          "description": "The name of operation.",
          "readOnly": true
        },
        "operationFriendlyName": {
          "type": "string",
          "description": "The friendly name of operation.",
          "readOnly": true
        },
        "percentComplete": {
          "type": "integer",
          "format": "int32",
          "description": "The percentage of the operation completed.",
          "readOnly": true
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "The operation start time.",
          "readOnly": true
        },
        "state": {
          "$ref": "#/$defs/ManagementOperationState",
          "description": "The operation state.",
          "readOnly": true
        },
        "errorCode": {
          "type": "integer",
          "format": "int32",
          "description": "The operation error code.",
          "readOnly": true
        },
        "errorDescription": {
          "type": "string",
          "description": "The operation error description.",
          "readOnly": true
        },
        "errorSeverity": {
          "type": "integer",
          "format": "int32",
          "description": "The operation error severity.",
          "readOnly": true
        },
        "isUserError": {
          "type": "boolean",
          "description": "Whether or not the error is a user error.",
          "readOnly": true
        },
        "estimatedCompletionTime": {
          "type": "string",
          "format": "date-time",
          "description": "The estimated completion time of the operation.",
          "readOnly": true
        },
        "description": {
          "type": "string",
          "description": "The operation description.",
          "readOnly": true
        },
        "isCancellable": {
          "type": "boolean",
          "description": "Whether the operation can be cancelled.",
          "readOnly": true
        },
        "operationParameters": {
          "$ref": "#/$defs/ManagedInstanceOperationParametersPair",
          "description": "The operation parameters.",
          "readOnly": true
        },
        "operationSteps": {
          "$ref": "#/$defs/ManagedInstanceOperationSteps",
          "description": "The operation steps.",
          "readOnly": true
        }
      }
    },
    "ManagedInstanceOperationSteps": {
      "type": "object",
      "description": "The steps of a managed instance operation.",
      "properties": {
        "totalSteps": {
          "type": "string",
          "description": "The total number of operation steps.",
          "readOnly": true
        },
        "currentStep": {
          "type": "integer",
          "format": "int32",
          "description": "The number of current operation steps.",
          "readOnly": true
        },
        "stepsList": {
          "type": "array",
          "description": "The operation steps list.",
          "items": {
            "$ref": "#/$defs/UpsertManagedServerOperationStepWithEstimatesAndDuration"
          },
          "readOnly": true
        }
      }
    },
    "ManagementOperationState": {
      "type": "string",
      "description": "The operation state.",
      "enum": [
        "Pending",
        "InProgress",
        "Succeeded",
        "Failed",
        "CancelInProgress",
        "Cancelled"
      ],
      "x-ms-enum": {
        "name": "ManagementOperationState",
        "modelAsString": true,
        "values": [
          {
            "name": "Pending",
            "value": "Pending",
            "description": "Pending"
          },
          {
            "name": "InProgress",
            "value": "InProgress",
            "description": "InProgress"
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Succeeded"
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "CancelInProgress",
            "value": "CancelInProgress",
            "description": "CancelInProgress"
          },
          {
            "name": "Cancelled",
            "value": "Cancelled",
            "description": "Cancelled"
          }
        ]
      }
    },
    "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"
        }
      ]
    },
    "Resource": {
      "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
    },
    "UpsertManagedServerOperationParameters": {
      "type": "object",
      "properties": {
        "family": {
          "type": "string"
        },
        "tier": {
          "type": "string"
        },
        "vCores": {
          "type": "integer",
          "format": "int32"
        },
        "storageSizeInGB": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "UpsertManagedServerOperationStepWithEstimatesAndDuration": {
      "type": "object",
      "properties": {
        "stepStartTime": {
          "type": "string",
          "format": "date-time"
        },
        "stepEndTime": {
          "type": "string",
          "format": "date-time"
        },
        "timeElapsed": {
          "type": "string"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/UpsertManagedServerOperationStepWithEstimatesAndDurationStatus"
        }
      }
    },
    "UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": {
      "type": "string",
      "enum": [
        "NotStarted",
        "InProgress",
        "SlowedDown",
        "Completed",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "UpsertManagedServerOperationStepWithEstimatesAndDurationStatus",
        "modelAsString": true,
        "values": [
          {
            "name": "NotStarted",
            "value": "NotStarted",
            "description": "NotStarted"
          },
          {
            "name": "InProgress",
            "value": "InProgress",
            "description": "InProgress"
          },
          {
            "name": "SlowedDown",
            "value": "SlowedDown",
            "description": "SlowedDown"
          },
          {
            "name": "Completed",
            "value": "Completed",
            "description": "Completed"
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "Canceled"
          }
        ]
      }
    }
  }
}