{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foundational/json-schema/foundational-public-custom-query-monitor-response-schema.json",
  "title": "PublicCustomQueryMonitorResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foundational-monitors-api-openapi.yml#/components/schemas/PublicCustomQueryMonitorResponse",
  "properties": {
    "customQueryId": {
      "type": "string",
      "format": "uuid",
      "title": "Customqueryid"
    },
    "connectorId": {
      "type": "string",
      "format": "uuid",
      "title": "Connectorid"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "platform": {
      "type": "string",
      "title": "Platform"
    },
    "columnsNames": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Columnsnames"
    },
    "columns": {
      "additionalProperties": {
        "$ref": "#/$defs/ColumnMetricsConfig"
      },
      "type": "object",
      "title": "Columns"
    },
    "emptyResult": {
      "anyOf": [
        {
          "$ref": "#/$defs/EmptyResultPolicy"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "customQueryId",
    "connectorId",
    "name",
    "platform",
    "columnsNames",
    "columns"
  ],
  "$defs": {
    "CheckConfig": {
      "properties": {
        "min_threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min Threshold"
        },
        "max_threshold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Threshold"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pattern"
        },
        "allowed_values": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Allowed Values"
        }
      },
      "type": "object",
      "title": "CheckConfig"
    },
    "ColumnMetricsConfig": {
      "properties": {
        "column_name": {
          "type": "string",
          "title": "Column Name"
        },
        "metrics": {
          "additionalProperties": {
            "$ref": "#/$defs/CheckConfig"
          },
          "propertyNames": {
            "$ref": "#/$defs/ObservabilityMetricType"
          },
          "type": "object",
          "title": "Metrics",
          "default": {}
        },
        "fixed_case": {
          "type": "boolean",
          "title": "Fixed Case",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "column_name"
      ],
      "title": "ColumnMetricsConfig"
    },
    "EmptyResultPolicy": {
      "type": "string",
      "enum": [
        "pass",
        "alert"
      ],
      "title": "EmptyResultPolicy",
      "description": "What a monitor run that returns no rows, or NULL for every check, means to the customer."
    },
    "ObservabilityMetricType": {
      "type": "string",
      "enum": [
        "null_count",
        "zero_count",
        "true_count",
        "row_count",
        "distinct_values_count",
        "min",
        "max",
        "count",
        "sum",
        "avg",
        "pattern",
        "allowed_values"
      ],
      "title": "ObservabilityMetricType"
    }
  }
}