{
  "documentation": "A template for a persisted aggregate in LogScale.",
  "properties": {
    "name": {
      "documentation": "The name of the persisted aggregate.",
      "minLength": 1,
      "type": "string"
    },
    "enabled": {
      "type": "boolean",
      "documentation": "Whether the persisted aggregate is enabled.",
      "default": false
    },
    "queryString": {
      "documentation": "The query string for the persisted aggregate.",
      "minLength": 1,
      "type": "string"
    },
    "staticFields": {
      "type": "object",
      "documentation": "Static fields to add to persisted aggregate results.",
      "propertyNames": {
        "minLength": 1,
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "labels": {
      "type": "array",
      "documentation": "A list of labels.",
      "items": {
        "type": "string"
      }
    },
    "destinationRepositoryName": {
      "documentation": "The name of the destination repository.",
      "minLength": 1,
      "type": "string"
    },
    "$schema": {
      "enum": ["https://schemas.humio.com/persistedaggregate/v0.1.0"],
      "type": "string"
    },
    "description": {
      "documentation": "A description of the persisted aggregate.",
      "type": "string"
    },
    "tag": {
      "documentation": "The tag for the persisted aggregate.",
      "minLength": 1,
      "type": "string"
    },
    "isRollupable": {
      "type": "boolean",
      "documentation": "Whether the persisted aggregate supports rollup.",
      "default": false
    },
    "bucketSerializationProtocolVersion": {
      "documentation": "Bucket Serialization Protocol version.",
      "minimum": 0,
      "type": "integer"
    },
    "schedule": {
      "documentation": "The schedule configuration for the persisted aggregate.",
      "properties": {
        "scheduleInterval": {
          "documentation": "The schedule interval type.",
          "properties": {
            "intervalType": {
              "documentation": "The interval type value.",
              "minLength": 1,
              "type": "string"
            }
          },
          "additionalProperties": false,
          "type": "object",
          "required": ["intervalType"]
        },
        "backfillInterval": {
          "documentation": "The backfill interval type.",
          "properties": {
            "intervalType": {
              "documentation": "The interval type value.",
              "minLength": 1,
              "type": "string"
            }
          },
          "additionalProperties": false,
          "type": "object",
          "required": ["intervalType"]
        },
        "queryTimestampType": {
          "documentation": "The timestamp type for the query.",
          "properties": {
            "timestampType": {
              "documentation": "The timestamp type value.",
              "minLength": 1,
              "type": "string"
            }
          },
          "additionalProperties": false,
          "type": "object",
          "required": ["timestampType"]
        },
        "scheduleMaxWaitSeconds": {
          "documentation": "Optional max wait in seconds for IngestTime schedules.",
          "type": "integer"
        },
        "scheduleOffsetSeconds": {
          "documentation": "Optional offset in seconds for EventTime schedules.",
          "type": "integer"
        },
        "backfillAmount": {
          "documentation": "Number of backfill intervals (0 means no backfill).",
          "minimum": 0,
          "type": "integer"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["backfillAmount", "backfillInterval", "queryTimestampType", "scheduleInterval"]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": ["$schema", "bucketSerializationProtocolVersion", "destinationRepositoryName", "enabled", "name", "queryString", "schedule", "tag"]
}