{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anomalyarmor-ai/json-schema/anomalyarmor-ai-create-row-count-schedule-request-schema.json",
  "title": "CreateRowCountScheduleRequest",
  "description": "Request to create row_count monitoring schedule.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/docs.anomalyarmor.ai-openapi.json#/components/schemas/CreateRowCountScheduleRequest",
  "properties": {
    "table_path": {
      "type": "string",
      "title": "Table Path",
      "description": "Table path (schema.table_name)"
    },
    "timestamp_column": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timestamp Column",
      "description": "Column to filter rows by time period. If NULL, counts all rows."
    },
    "time_window_hours": {
      "type": "integer",
      "enum": [
        1,
        6,
        12,
        24,
        168
      ],
      "title": "Time Window Hours",
      "description": "Time window for row count measurement (1, 6, 12, 24, or 168 hours)",
      "default": 24
    },
    "check_interval": {
      "type": "string",
      "title": "Check Interval",
      "description": "Check interval (e.g., '1h', '6h', '1d')",
      "default": "1h"
    },
    "monitoring_mode": {
      "type": "string",
      "enum": [
        "auto_learn",
        "explicit"
      ],
      "title": "Monitoring Mode",
      "description": "Monitoring mode: 'auto_learn' for ML-based or 'explicit' for manual thresholds",
      "default": "auto_learn"
    },
    "expected_min_rows": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Min Rows",
      "description": "For explicit mode: alert when row count falls below this value"
    },
    "expected_max_rows": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Max Rows",
      "description": "For explicit mode: optional upper bound for alerting"
    },
    "sensitivity": {
      "type": "integer",
      "maximum": 4.0,
      "minimum": 1.0,
      "title": "Sensitivity",
      "description": "Sensitivity (1-4): 1=tight (more alerts), 4=loose (fewer alerts)",
      "default": 2
    },
    "freshness_schedule_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Freshness Schedule Id",
      "description": "Optional link to freshness schedule UUID (for auto-creation)"
    },
    "operating_period_mode": {
      "type": "string",
      "title": "Operating Period Mode",
      "description": "Operating-period awareness (TECH-984): 'off', 'auto', or 'schedule' (segments the baseline by the linked operating schedule)",
      "default": "off"
    },
    "operating_schedule_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Operating Schedule Id",
      "description": "Operating schedule public UUID, required when operating_period_mode is 'schedule'"
    }
  },
  "type": "object",
  "required": [
    "table_path"
  ]
}