{
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/IUniversalDatasetTableRow"
      }
    },
    "columnsOptions": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ColumnOptions"
      }
    },
    "showColumnHeaders": {
      "type": "boolean"
    },
    "compactMode": {
      "type": "boolean"
    },
    "hideHeader": {
      "type": "boolean"
    },
    "updateFrequency": {
      "type": ["null", "number"]
    },
    "maxAge": {
      "type": "number"
    },
    "backgroundColor": {
      "type": "object",
      "properties": {
        "dataset": {
          "type": "string"
        },
        "conditionalColors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "condition": {
                "enum": ["eq", "gt", "gte", "lt", "lte", "neq"],
                "type": "string"
              },
              "opacity": {
                "type": "number"
              },
              "color": {
                "type": "string"
              }
            },
            "required": ["color", "value"]
          }
        }
      },
      "required": ["conditionalColors", "dataset"]
    },
    "id": {
      "type": "string"
    },
    "reportOptions": {
      "type": "null"
    },
    "reportMode": {
      "type": "boolean"
    },
    "stateCb": {
      "type": "object"
    },
    "calendarType": {
      "const": "CALENDAR_445",
      "type": "string"
    }
  },
  "required": ["columnsOptions", "rows"],
  "definitions": {
    "IUniversalDatasetTableRow": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string"
        },
        "columns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/IUniversalDatasetTableColumn"
          }
        },
        "isSeparator": {
          "type": "boolean"
        }
      },
      "required": ["columns"]
    },
    "IUniversalDatasetTableColumn": {
      "type": "object",
      "properties": {
        "cell": {
          "$ref": "#/definitions/ICellConfig"
        }
      },
      "required": ["cell"]
    },
    "ICellConfig": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/CellType"
        },
        "value": {
          "type": ["null", "string", "number"]
        },
        "displayDatasetValueTime": {
          "type": "boolean"
        },
        "setMinMaxColors": {
          "type": "boolean"
        },
        "minMaxColor": {
          "type": "object",
          "properties": {
            "minTextColor": {
              "type": "string"
            },
            "maxTextColor": {
              "type": "string"
            },
            "minBgColor": {
              "type": "string"
            },
            "maxBgColor": {
              "type": "string"
            }
          }
        },
        "minMaxValue": {
          "type": "object",
          "properties": {
            "minValue": {
              "type": "number"
            },
            "maxValue": {
              "type": "number"
            }
          }
        },
        "timePattern": {
          "type": "string"
        },
        "highlightColor": {
          "type": "object",
          "properties": {
            "color": {
              "type": "string"
            },
            "bgColor": {
              "type": "string"
            }
          }
        }
      },
      "required": ["type"]
    },
    "CellType": {
      "type": "string",
      "enum": ["string", "number", "dataset", "unit", "url", "separator"]
    },
    "ColumnOptions": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "columnHeaderVisibility": {
          "type": "boolean"
        },
        "columnVisibility": {
          "type": "boolean"
        }
      },
      "required": ["columnHeaderVisibility", "columnVisibility", "id", "title"]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
