{
  "documentation": "A template for a saved query in Humio.",
  "properties": {
    "name": {
      "documentation": "The name of the saved query.",
      "minLength": 1,
      "type": "string",
      "maxLength": 200
    },
    "interactions": {
      "type": "array",
      "documentation": "A list of user interactions available for this widget.",
      "items": {
        "type": "object",
        "oneOf": [{
          "required": ["arguments", "dashboardReference", "name", "openInNewTab", "useWidgetTimeWindow"],
          "additionalProperties": false,
          "properties": {
            "conditions": {
              "type": "array",
              "documentation": "A list of conditions that needs to be fulfilled before this interaction is enabled.",
              "items": {
                "properties": {
                  "argument": {
                    "documentation": "Argument to apply.",
                    "type": "string"
                  },
                  "fieldName": {
                    "documentation": "Name of the field.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "operator": {
                    "documentation": "Operator to apply.",
                    "oneOf": [{
                      "const": "equal"
                    }, {
                      "const": "not-equal"
                    }, {
                      "const": "contains"
                    }, {
                      "const": "not-contains"
                    }, {
                      "const": "starts-with"
                    }, {
                      "const": "ends-with"
                    }, {
                      "const": "present"
                    }, {
                      "const": "not-present"
                    }, {
                      "const": "unknown"
                    }]
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": ["argument", "fieldName", "operator"]
              }
            },
            "name": {
              "documentation": "The name of the interaction, this will be the default title if no title template is provided.",
              "minLength": 1,
              "type": "string",
              "maxLength": 128
            },
            "titleTemplate": {
              "documentation": "A template used for producing the title shown when interacting. You can use template expressions like `{{myField}}` inside to insert values from the context.",
              "type": "string",
              "maxLength": 128
            },
            "useWidgetTimeWindow": {
              "type": "boolean",
              "documentation": "Setting whether or not to use the time window for the target dashboard",
              "default": true
            },
            "dashboardReference": {
              "documentation": "The name of the referenced dashboard. When set in an application package, whatever asset this interaction is assigned to will be connected to this dashboard upon installation, but only if the dashboard is inside the package. In library packages, this nas have no effect.",
              "properties": {
                "packageSpecifier": {
                  "pattern": "^(?:([a-z][a-z0-9_-]+[a-z0-9]+)/([a-z][a-z0-9_-]+[a-z0-9]+))$",
                  "documentation": "The optional package specifier of the referenced dashboard.",
                  "type": "string",
                  "maxLength": 114
                },
                "name": {
                  "documentation": "The name of the referenced dashboard.",
                  "minLength": 1,
                  "type": "string"
                },
                "repoOrViewName": {
                  "documentation": "The repository or view name of the referenced dashboard.",
                  "minLength": 1,
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "type": "object",
              "required": ["name"]
            },
            "arguments": {
              "type": "object",
              "documentation": "Arguments to pass along to the dashboard.",
              "propertyNames": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              },
              "additionalProperties": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              }
            },
            "openInNewTab": {
              "type": "boolean",
              "documentation": "Setting whether or not to open the dashboard in a new tab.",
              "default": false
            },
            "type": {
              "const": "dashboardlink"
            }
          }
        }, {
          "required": ["name", "openInNewTab", "urlTemplate"],
          "additionalProperties": false,
          "properties": {
            "conditions": {
              "type": "array",
              "documentation": "A list of conditions that needs to be fulfilled before this interaction is enabled.",
              "items": {
                "properties": {
                  "argument": {
                    "documentation": "Argument to apply.",
                    "type": "string"
                  },
                  "fieldName": {
                    "documentation": "Name of the field.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "operator": {
                    "documentation": "Operator to apply.",
                    "oneOf": [{
                      "const": "equal"
                    }, {
                      "const": "not-equal"
                    }, {
                      "const": "contains"
                    }, {
                      "const": "not-contains"
                    }, {
                      "const": "starts-with"
                    }, {
                      "const": "ends-with"
                    }, {
                      "const": "present"
                    }, {
                      "const": "not-present"
                    }, {
                      "const": "unknown"
                    }]
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": ["argument", "fieldName", "operator"]
              }
            },
            "name": {
              "documentation": "The name of the interaction, this will be the default title if no title template is provided.",
              "minLength": 1,
              "type": "string",
              "maxLength": 128
            },
            "urlEncodeArgs": {
              "type": "boolean",
              "documentation": "Url encode arguments injected into url template.",
              "default": true
            },
            "titleTemplate": {
              "documentation": "A template used for producing the title shown when interacting. You can use template expressions like `{{myField}}` inside to insert values from the context.",
              "type": "string",
              "maxLength": 128
            },
            "urlTemplate": {
              "documentation": "Url template. See documentation for dynamic parameters and variables.",
              "minLength": 1,
              "type": "string"
            },
            "openInNewTab": {
              "type": "boolean",
              "documentation": "Setting whether or not to open the link in a new tab.",
              "default": false
            },
            "type": {
              "const": "customlink"
            }
          }
        }, {
          "required": ["arguments", "isLive", "name", "openInNewTab", "queryString", "useWidgetTimeWindow"],
          "additionalProperties": false,
          "properties": {
            "conditions": {
              "type": "array",
              "documentation": "A list of conditions that needs to be fulfilled before this interaction is enabled.",
              "items": {
                "properties": {
                  "argument": {
                    "documentation": "Argument to apply.",
                    "type": "string"
                  },
                  "fieldName": {
                    "documentation": "Name of the field.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "operator": {
                    "documentation": "Operator to apply.",
                    "oneOf": [{
                      "const": "equal"
                    }, {
                      "const": "not-equal"
                    }, {
                      "const": "contains"
                    }, {
                      "const": "not-contains"
                    }, {
                      "const": "starts-with"
                    }, {
                      "const": "ends-with"
                    }, {
                      "const": "present"
                    }, {
                      "const": "not-present"
                    }, {
                      "const": "unknown"
                    }]
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": ["argument", "fieldName", "operator"]
              }
            },
            "name": {
              "documentation": "The name of the interaction, this will be the default title if no title template is provided.",
              "minLength": 1,
              "type": "string",
              "maxLength": 128
            },
            "titleTemplate": {
              "documentation": "A template used for producing the title shown when interacting. You can use template expressions like `{{myField}}` inside to insert values from the context.",
              "type": "string",
              "maxLength": 128
            },
            "queryString": {
              "documentation": "The query to execute.",
              "minLength": 1,
              "type": "string"
            },
            "useWidgetTimeWindow": {
              "type": "boolean",
              "documentation": "Setting whether or not to use the time window for the target search.",
              "default": true
            },
            "repoOrViewName": {
              "documentation": "The repository or view name to link to. If nothing is specified then the repo or view that are parent to this interaction will be used.",
              "minLength": 1,
              "type": "string"
            },
            "arguments": {
              "type": "object",
              "documentation": "Arguments to pass along to the search.",
              "propertyNames": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              },
              "additionalProperties": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              }
            },
            "openInNewTab": {
              "type": "boolean",
              "documentation": "Setting whether or not to open the search in a new tab.",
              "default": false
            },
            "isLive": {
              "type": "boolean",
              "documentation": "Setting whether or not the linked search should be live.",
              "default": false
            },
            "type": {
              "const": "searchlink"
            }
          }
        }, {
          "required": ["arguments", "name", "useWidgetTimeWindow"],
          "additionalProperties": false,
          "properties": {
            "conditions": {
              "type": "array",
              "documentation": "A list of conditions that needs to be fulfilled before this interaction is enabled.",
              "items": {
                "properties": {
                  "argument": {
                    "documentation": "Argument to apply.",
                    "type": "string"
                  },
                  "fieldName": {
                    "documentation": "Name of the field.",
                    "minLength": 1,
                    "type": "string"
                  },
                  "operator": {
                    "documentation": "Operator to apply.",
                    "oneOf": [{
                      "const": "equal"
                    }, {
                      "const": "not-equal"
                    }, {
                      "const": "contains"
                    }, {
                      "const": "not-contains"
                    }, {
                      "const": "starts-with"
                    }, {
                      "const": "ends-with"
                    }, {
                      "const": "present"
                    }, {
                      "const": "not-present"
                    }, {
                      "const": "unknown"
                    }]
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": ["argument", "fieldName", "operator"]
              }
            },
            "name": {
              "documentation": "The name of the interaction, this will be the default title if no title template is provided.",
              "minLength": 1,
              "type": "string",
              "maxLength": 128
            },
            "titleTemplate": {
              "documentation": "A template used for producing the title shown when interacting. You can use template expressions like `{{myField}}` inside to insert values from the context.",
              "type": "string",
              "maxLength": 128
            },
            "useWidgetTimeWindow": {
              "type": "boolean",
              "documentation": "Setting whether or not to use the widget time window.",
              "default": true
            },
            "type": {
              "const": "updateparameters"
            },
            "arguments": {
              "type": "object",
              "documentation": "Arguments for parameters to update.",
              "propertyNames": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              },
              "additionalProperties": {
                "minLength": 1,
                "type": "string",
                "maxLength": 1024
              }
            }
          }
        }]
      }
    },
    "description": {
      "documentation": "A description of what the saved query does, how it works, notes or similar.",
      "minLength": 1,
      "type": "string",
      "maxLength": 2000
    },
    "visualization": {
      "documentation": "An object containing styling and other options for the query's visualization.",
      "properties": {
        "options": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "documentation": "An object containing the styling and other options for the visualization. The content depends on the visualization type."
        },
        "type": {
          "examples": ["pie", "timechart", "package-name/my-visualization"],
          "documentation": "The ID of the visualization type.",
          "minLength": 1,
          "type": "string",
          "maxLength": 200
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["type"]
    },
    "labels": {
      "type": "array",
      "documentation": "A list of labels",
      "items": {
        "type": "string"
      }
    },
    "$schema": {
      "enum": ["https://schemas.humio.com/query/v0.7.0"],
      "type": "string"
    },
    "timeInterval": {
      "documentation": "The default time interval for the query.",
      "oneOf": [{
        "properties": {
          "isLive": {
            "const": false
          },
          "start": {
            "documentation": "The start of the time interval as milliseconds since the epoch.",
            "minimum": 0,
            "type": "integer"
          },
          "end": {
            "pattern": "(^calendar:.+)|(.+@.+)|(^(\\d+) ?(years?|y|yrs?|quarters?|q|qtrs?|months?|mon|weeks?|w|days?|d|hours?|hr?|hrs|minutes?|m|min|seconds?|s|secs?|milliseconds?|millis|ms))|(^now)$",
            "documentation": "The end of the time interval as a relative time point, e.g. `now`.",
            "type": "string"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": ["end", "start"]
      }, {
        "properties": {
          "isLive": {
            "type": "boolean",
            "documentation": "True if the search should be live.",
            "default": false
          },
          "start": {
            "pattern": "(^calendar:.+)|(.+@.+)|(^(\\d+) ?(years?|y|yrs?|quarters?|q|qtrs?|months?|mon|weeks?|w|days?|d|hours?|hr?|hrs|minutes?|m|min|seconds?|s|secs?|milliseconds?|millis|ms))|(^now)$",
            "documentation": "The start of the sliding window, e.g. 24h. This defines the size of the search interval.",
            "type": "string"
          },
          "end": {
            "const": "now",
            "deprecated": true,
            "deprecationReason": "Should be left out since it is redundant for relative time intervals."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": ["start"]
      }, {
        "properties": {
          "isLive": {
            "const": false
          },
          "start": {
            "documentation": "The start of the time interval as milliseconds since the epoch.",
            "minimum": 0,
            "type": "integer"
          },
          "end": {
            "documentation": "The end of the time interval as milliseconds since the epoch.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": ["end", "start"]
      }, {
        "pattern": "(^calendar:.+)|(.+@.+)|(^(\\d+) ?(years?|y|yrs?|quarters?|q|qtrs?|months?|mon|weeks?|w|days?|d|hours?|hr?|hrs|minutes?|m|min|seconds?|s|secs?|milliseconds?|millis|ms))|(^now)$",
        "type": "string"
      }]
    },
    "queryString": {
      "documentation": "The query string, in Humio Language v1.",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": ["$schema", "name", "queryString"]
}