{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-import-config-schema.json",
  "title": "Import configuration",
  "description": "An import configuration grouping one or more streams.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-configurations-api-openapi.yml#/components/schemas/ImportConfig",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The configuration identifier."
    },
    "tenant": {
      "type": "string",
      "description": "The owning tenant."
    },
    "name": {
      "type": "string",
      "description": "The configuration name."
    },
    "description": {
      "type": "string",
      "description": "A free-text description."
    },
    "sourceConnId": {
      "type": "string",
      "format": "uuid",
      "description": "The default source connection for the configuration's streams."
    },
    "aiEnabled": {
      "type": "boolean",
      "description": "Whether AI-assisted mapping suggestions are enabled for the configuration."
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether the configuration is active."
    },
    "version": {
      "type": "integer",
      "description": "Incremented on every change to the configuration."
    },
    "healthThresholds": {
      "$ref": "#/$defs/HealthThresholds"
    },
    "createdBy": {
      "type": "string",
      "description": "The identifier of the user who created the configuration."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the configuration was created."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the configuration was last updated."
    }
  },
  "$defs": {
    "HealthThresholds": {
      "title": "Health thresholds",
      "type": "object",
      "description": "The limits that decide whether a stream is reported as `GREEN`, `AMBER`, or `RED`. Each field is optional and resolves independently. An unset field falls back through the hierarchy, from the most specific level to the least specific: stream, configuration, tenant, then the built-in default.",
      "properties": {
        "failureRatioAmber": {
          "type": "number",
          "format": "double",
          "description": "The share of failed records (0..1) at or above which the stream is `AMBER`."
        },
        "failureRatioRed": {
          "type": "number",
          "format": "double",
          "description": "The share of failed records (0..1) at or above which the stream is `RED`."
        },
        "staleAmberHours": {
          "type": "integer",
          "description": "The age threshold, in hours, for the stream's newest data. The stream is `AMBER` when the data's age reaches or exceeds this threshold."
        },
        "staleRedHours": {
          "type": "integer",
          "description": "The age threshold, in hours, for the stream's newest data. The stream is `RED` when the data's age reaches or exceeds this threshold."
        },
        "failedRunIsRed": {
          "type": "boolean",
          "description": "Whether a failed most-recent run makes the stream `RED` regardless of the other limits."
        }
      }
    }
  }
}