{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "DTC Filter",
  "description": "Schema for a DTC filter as returned by dtc_filter_as_json",
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "description": "Identifier derived from deviceId, functionCode and code: %03u-%03u-%06u, an absent constraint written as 0"
    },
    "functionCode": {
      "type": "integer",
      "description": "Function code the filter matches (optional, omitted when the filter does not constrain it)",
      "minimum": 0,
      "maximum": 63
    },
    "deviceId": {
      "type": "integer",
      "description": "Device ID (functionCode * 64 + instance) the filter matches (optional, omitted when the filter does not constrain it)",
      "minimum": 0,
      "maximum": 4095
    },
    "code": {
      "type": "integer",
      "description": "Alarm code the filter matches (optional, omitted when the filter does not constrain it)",
      "minimum": 0,
      "maximum": 65535
    },
    "duration": {
      "type": "integer",
      "description": "Duration of the filter in seconds"
    },
    "creationTime": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when the filter was created"
    },
    "expireTime": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when the filter will expire"
    }
  },
  "required": ["uuid", "duration", "creationTime", "expireTime"]
}
