{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-core/json-schema/amazon-iot-core-list-active-violations-response-schema.json",
  "title": "ListActiveViolationsResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-core-active-violations-api-openapi.yml#/components/schemas/ListActiveViolationsResponse",
  "type": "object",
  "properties": {
    "activeViolations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActiveViolation"
      },
      "description": "The list of active violations."
    },
    "nextToken": {
      "type": "string",
      "description": "A token that can be used to retrieve the next set of results, or null if there are no additional results."
    }
  },
  "$defs": {
    "ActiveViolation": {
      "type": "object",
      "properties": {
        "violationId": {
          "type": "string",
          "description": "The ID of the active violation."
        },
        "thingName": {
          "type": "string",
          "description": "The name of the thing responsible for the active violation."
        },
        "securityProfileName": {
          "type": "string",
          "description": "The security profile with the behavior is in violation."
        },
        "behavior": {
          "$ref": "#/$defs/Behavior"
        },
        "lastViolationValue": {
          "$ref": "#/$defs/MetricValue"
        },
        "violationEventAdditionalInfo": {
          "$ref": "#/$defs/ViolationEventAdditionalInfo"
        },
        "verificationState": {
          "type": "string",
          "enum": [
            "FALSE_POSITIVE",
            "BENIGN_POSITIVE",
            "TRUE_POSITIVE",
            "UNKNOWN"
          ],
          "description": "The verification state of the violation (detect alarm)."
        },
        "verificationStateDescription": {
          "type": "string",
          "description": "The description of the verification state of the violation."
        },
        "lastViolationTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time the most recent violation occurred."
        },
        "violationStartTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time the violation started."
        }
      }
    },
    "Behavior": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name you've given to the behavior."
        },
        "metric": {
          "type": "string",
          "description": "What is measured by the behavior."
        },
        "metricDimension": {
          "$ref": "#/$defs/MetricDimension"
        },
        "criteria": {
          "$ref": "#/$defs/BehaviorCriteria"
        },
        "suppressAlerts": {
          "type": "boolean",
          "description": "Suppresses alerts."
        },
        "exportMetric": {
          "type": "boolean",
          "description": "Value indicates exporting metrics related to the behavior when it is true."
        }
      },
      "required": [
        "name"
      ]
    },
    "BehaviorCriteria": {
      "type": "object",
      "properties": {
        "comparisonOperator": {
          "type": "string",
          "enum": [
            "less-than",
            "less-than-equals",
            "greater-than",
            "greater-than-equals",
            "in-cidr-set",
            "not-in-cidr-set",
            "in-port-set",
            "not-in-port-set",
            "in-set",
            "not-in-set"
          ],
          "description": "The operator that relates the thing measured (metric) to the criteria (containing a value or statisticalThreshold). Valid operators include: string-list: in-set and not-in-set number-list: in-set and not-in-set ip-address-list: in-cidr-set and not-in-cidr-set number: less-than, less-than-equals, greater-than, and greater-than-equals"
        },
        "value": {
          "$ref": "#/$defs/MetricValue"
        },
        "durationSeconds": {
          "type": "integer",
          "description": "Use this to specify the time duration over which the behavior is evaluated, for those criteria that have a time dimension (for example, NUM_MESSAGES_SENT). For a statisticalThreshhold metric comparison, measurements from all devices are accumulated over this time duration before being used to calculate percentiles, and later, measurements from an individual device are also accumulated over this time duration before being given a percentile rank. Cannot be used with list-based metric datatypes."
        },
        "consecutiveDatapointsToAlarm": {
          "type": "integer",
          "description": "If a device is in violation of the behavior for the specified number of consecutive datapoints, an alarm occurs. If not specified, the default is 1."
        },
        "consecutiveDatapointsToClear": {
          "type": "integer",
          "description": "If an alarm has occurred and the offending device is no longer in violation of the behavior for the specified number of consecutive datapoints, the alarm is cleared. If not specified, the default is 1."
        },
        "statisticalThreshold": {
          "$ref": "#/$defs/StatisticalThreshold"
        },
        "mlDetectionConfig": {
          "$ref": "#/$defs/MachineLearningDetectionConfig"
        }
      }
    },
    "MachineLearningDetectionConfig": {
      "type": "object",
      "properties": {
        "confidenceLevel": {
          "type": "string",
          "enum": [
            "LOW",
            "MEDIUM",
            "HIGH"
          ],
          "description": "The sensitivity of anomalous behavior evaluation. Can be Low, Medium, or High."
        }
      },
      "required": [
        "confidenceLevel"
      ]
    },
    "MetricDimension": {
      "type": "object",
      "properties": {
        "dimensionName": {
          "type": "string",
          "description": "A unique identifier for the dimension."
        },
        "operator": {
          "type": "string",
          "enum": [
            "IN",
            "NOT_IN"
          ],
          "description": "Defines how the dimensionValues of a dimension are interpreted. For example, for dimension type TOPIC_FILTER, the IN operator, a message will be counted only if its topic matches one of the topic filters. With NOT_IN operator, a message will be counted only if it doesn't match any of the topic filters. The operator is optional: if it's not provided (is null), it will be interpreted as IN."
        }
      },
      "required": [
        "dimensionName"
      ]
    },
    "MetricValue": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "description": "If the comparisonOperator calls for a numeric value, use this to specify that numeric value to be compared with the metric."
        },
        "cidrs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "If the comparisonOperator calls for a set of CIDRs, use this to specify that set to be compared with the metric."
        },
        "ports": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "If the comparisonOperator calls for a set of ports, use this to specify that set to be compared with the metric."
        },
        "number": {
          "type": "number",
          "description": "The numeral value of a metric."
        },
        "numbers": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "The numeral values of a metric."
        },
        "strings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The string values of a metric."
        }
      }
    },
    "StatisticalThreshold": {
      "type": "object",
      "properties": {
        "statistic": {
          "type": "string",
          "description": "The percentile that resolves to a threshold value by which compliance with a behavior is determined. Metrics are collected over the specified period (durationSeconds) from all reporting devices in your account and statistical ranks are calculated. Then, the measurements from a device are collected over the same period. If the accumulated measurements from the device fall above or below (comparisonOperator) the value associated with the percentile specified, then the device is considered to be in compliance with the behavior, otherwise a violation occurs."
        }
      }
    },
    "ViolationEventAdditionalInfo": {
      "type": "object",
      "properties": {
        "confidenceLevel": {
          "type": "string",
          "enum": [
            "LOW",
            "MEDIUM",
            "HIGH"
          ],
          "description": "The sensitivity of anomalous behavior evaluation. Can be Low, Medium, or High."
        }
      }
    }
  }
}