{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "type": "object",
  "title": "ActionsResponse",
  "description": "ActionsResponse PI_JSON",
  "additionalProperties": false,
  "required": [
    "results"
  ],
  "properties": {
    "resultsNotAvailableForRequest": {
      "type": "boolean"
    },
    "results": {
      "type": "array",
      "description": "ActionsResults",
      "items": {
        "$ref": "#/definitions/ActionResult"
      }
    },
    "taskRunIds": {
      "type": "array",
      "description": "TaskRunIds",
      "items": {
        "type": "string"
      }
    }
  },
  "definitions": {
    "ActionResult": {
      "type": "object",
      "required": [
        "type",
        "requests"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PI",
            "SSD",
            "PDF",
            "URL",
            "WMS"
          ]
        },
        "title": {
          "type": "string"
        },
        "requests": {
          "type": "array",
          "description": "ActionRequests",
          "items": {
            "$ref": "#/definitions/ActionRequest"
          }
        },
        "config": {
          "$ref": "#/definitions/ActionRequestConfig"
        }
      }
    },
    "ActionPeriod": {
      "type": "object",
      "required": [
        "startDate",
        "endDate"
      ],
      "additionalProperties": false,
      "properties": {
        "startDate": {
          "$ref": "#/definitions/ActionsPeriodDate"
        },
        "endDate": {
          "$ref": "#/definitions/ActionsPeriodDate"
        }
      }
    },
    "ActionRequest": {
      "type": "object",
      "required": [
        "request"
      ],
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string"
        },
        "request": {
          "type": "string"
        },
        "editRequest": {
          "type": "string",
          "description": "URL to post changes to the timeseries. In case of an ensemble the ensembleMemberId has to be added. Only relevant for PI requests. If the timeSeries is not editable, the editRequest is missing."
        },
        "editPermissions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "values",
              "comments",
              "flags"
            ]
          }
        },
        "historyRequest": {
          "type": "string",
          "description": "URL to show of the timeseries. The time parameter has to be added to show the history. In case of an ensemble the ensembleMemberId has to be added. Only relevant for PI requests."
        }
      }
    },
    "ActionRequestConfig": {
      "type": "object",
      "title": "ActionRequestConfig",
      "additionalProperties": false,
      "properties": {
        "timeSeriesDisplay": {
          "$ref": "#/definitions/timeSeriesDisplayConfig"
        },
        "scalar1DDisplay": {
          "$ref": "#/definitions/timeSeriesDisplayConfig"
        }
      }
    },
    "timeSeriesDisplayConfig": {
      "type": "object",
      "title": "TimeSeriesDisplayConfig",
      "additionalProperties": false,
      "properties": {
        "error": {
          "type": "string",
          "description": "Error in case a not supported configuration is used."
        },
        "title": {
          "type": "string"
        },
        "plotId": {
          "type": "string"
        },
        "period": {
          "$ref": "#/definitions/ActionPeriod"
        },
        "index": {
          "type": "number"
        },
        "forecastLegend": {
          "type": "string"
        },
        "subplots": {
          "items": {
            "$ref": "#/definitions/timeSeriesDisplaySubplot"
          }
        }
      }
    },
    "timeSeriesDisplaySubplot": {
      "type": "object",
      "required": [
        "items"
      ],
      "title": "TimeSeriesDisplaySubplot",
      "additionalProperties": false,
      "properties": {
        "xAxis": {
          "$ref": "#/definitions/TimeSeriesDisplayPlotItemXAxis"
        },
        "items": {
          "items": {
            "$ref": "#/definitions/timeSeriesDisplaySubplotItem"
          }
        }
      }
    },
    "timeSeriesDisplaySubplotItem": {
      "type": "object",
      "required": [
        "type",
        "visibleInLegend",
        "visibleInPlot",
        "visibleInTable"
      ],
      "title": "TimeSeriesDisplaySubplotItem",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "line",
            "area",
            "horizontalColorCode"
          ]
        },
        "barMargin": {
          "type": "number",
          "description": "Bar margin in pixels. Only supported for type horizontalColorCode."
        },
        "classBreaks": {
          "type": "array",
          "description": "Class Breaks",
          "items": {
            "$ref": "#/definitions/TimeSeriesDisplaySubplotItemClassBreaks"
          }
        },
        "legend": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "lineStyle": {
          "type": "string"
        },
        "plotWeight": {
          "type": "number",
          "description": "Plot weight."
        },
        "visibleInLegend": {
          "type": "boolean"
        },
        "visibleInPlot": {
          "type": "boolean"
        },
        "visibleInTable": {
          "type": "boolean"
        },
        "lineWidth": {
          "type": "number"
        },
        "opaquenessPercentage": {
          "type": "number"
        },
        "markerStyle": {
          "type": "string"
        },
        "markerSize": {
          "type": "number"
        },
        "locationId": {
          "type": "string"
        },
        "taskRunId": {
          "type": "string"
        },
        "yAxis": {
          "$ref": "#/definitions/TimeSeriesDisplaySubplotItemAxis"
        },
        "inverted": {
          "type": "boolean",
          "description": "Inverted y-axis."
        },
        "logarithmic": {
          "type": "boolean",
          "description": "Logarithmic y-axis."
        },
        "thresholdAxis": {
          "type": "string",
          "enum": [
            "left",
            "right",
            "both",
            "none"
          ]
        },
        "thresholdAxisScaling": {
          "type": "string",
          "enum": [
            "two thresholds",
            "no thresholds",
            "all thresholds"
          ]
        },
        "thresholds": {
          "type": "array",
          "description": "Thresholds",
          "items": {
            "$ref": "#/definitions/TimeSeriesDisplaySubplotItemThreshold"
          }
        },
        "request": {
          "description": "Key of the request. Only used if there is only one request.",
          "type": "string"
        },
        "requests": {
          "description": "Array with the keys of the requests. Only used if there are multiple requests.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "TimeSeriesDisplaySubplotItemClassBreaks": {
      "type": "object",
      "title": "ClassBreaks",
      "additionalProperties": false,
      "required": [
        "lowerValue",
        "color",
        "label"
      ],
      "properties": {
        "lowerValue": {
          "type": "number"
        },
        "color": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "TimeSeriesDisplayPlotItemXAxis": {
      "type": "object",
      "title": "TimeSeriesDisplayPlotItemXAxis",
      "additionalProperties": false,
      "required": [
        "axisLabel"
      ],
      "properties": {
        "axisLabel": {
          "type": "string"
        },
        "axisMinValue": {
          "type": "number"
        },
        "axisMaxValue": {
          "type": "number"
        }
      }
    },
    "TimeSeriesDisplaySubplotItemAxis": {
      "type": "object",
      "title": "TimeSeriesDisplaySubplotItemAxis",
      "additionalProperties": false,
      "properties": {
        "axisPosition": {
          "type": "string"
        },
        "axisLabel": {
          "type": "string"
        },
        "axisMinValue": {
          "type": "number"
        },
        "axisMaxValue": {
          "type": "number"
        }
      }
    },
    "TimeSeriesDisplaySubplotItemThreshold": {
      "type": "object",
      "title": "TimeSeriesDisplaySubplotItemThreshold",
      "description": "Threshold",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "label": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "labelAlignment": {
          "type": "string",
          "enum": [
            "left",
            "right"
          ],
          "description": "Label alignment for the threshold label."
        }
      }
    },
    "ActionsPeriodDate": {
      "additionalProperties": false,
      "type": "object",
      "description": "Date",
      "required": [
        "date",
        "time"
      ],
      "properties": {
        "date": {
          "type": "string",
          "description": "Date"
        },
        "time": {
          "type": "string",
          "description": "Time"
        }
      }
    }
  }
}
