{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-maintenance-config-v2-with-state-and-occurrence-schema.json",
  "title": "MaintenanceConfigV2WithStateAndOccurrence",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-maintenance-configuration-api-openapi.yml#/components/schemas/MaintenanceConfigV2WithStateAndOccurrence",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ID of the Maintenance Window configuration.",
      "maxLength": 64,
      "minLength": 0
    },
    "lastUpdated": {
      "type": "integer",
      "format": "int64",
      "minimum": 1
    },
    "name": {
      "type": "string",
      "description": "Name of the Maintenance Window configuration.",
      "maxLength": 256,
      "minLength": 0
    },
    "occurrence": {
      "$ref": "#/$defs/Occurrence"
    },
    "paused": {
      "type": "boolean",
      "description": "Boolean flag to determine if the Maintenance Window configuration is paused or still live."
    },
    "query": {
      "type": "string",
      "description": "Dynamic Focus Query that determines the scope of the Maintenance Window configuration.",
      "maxLength": 2048,
      "minLength": 0
    },
    "retriggerOpenAlertsEnabled": {
      "type": "boolean",
      "description": "Boolean flag to determine if we should retrigger open alerts to be sent out for any events that opened during this maintenance window, and continues to remain open after the window expires"
    },
    "scheduling": {
      "$ref": "#/$defs/MaintenanceConfigScheduling"
    },
    "state": {
      "type": "string",
      "description": "State of the Maintenance Window, it can be: UNSCHEDULED, SCHEDULED, ACTIVE, PAUSED, EXPIRED.",
      "enum": [
        "UNSCHEDULED",
        "SCHEDULED",
        "ACTIVE",
        "PAUSED",
        "EXPIRED"
      ]
    },
    "tagFilterExpression": {
      "$ref": "#/$defs/TagFilterExpressionElement"
    },
    "tagFilterExpressionEnabled": {
      "type": "boolean",
      "description": "Boolean flag to determine if the tagFilterExpression is enabled."
    }
  },
  "required": [
    "id",
    "name",
    "occurrence",
    "query",
    "scheduling"
  ],
  "$defs": {
    "Duration": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "unit": {
          "type": "string",
          "enum": [
            "MINUTES",
            "HOURS",
            "DAYS"
          ]
        }
      },
      "required": [
        "amount",
        "unit"
      ]
    },
    "MaintenanceConfigScheduling": {
      "type": "object",
      "description": "Time scheduling of the Maintenance Window configurations.",
      "properties": {
        "duration": {
          "$ref": "#/$defs/Duration"
        },
        "start": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "type": {
          "type": "string",
          "maxLength": 2048,
          "minLength": 0
        }
      },
      "required": [
        "duration",
        "start",
        "type"
      ]
    },
    "Occurrence": {
      "type": "object",
      "description": "Time window of the Maintence Window configuration occurrences.",
      "properties": {
        "end": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "start": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        }
      }
    },
    "TagFilterExpressionElement": {
      "type": "object",
      "description": "Boolean expression of tag filters to define the scope of relevant calls.",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}