{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.therealer.com/docs/api/schemas/mqtt-feed-data-ack.schema.json",
  "title": "Realer MQTT feed-data application acknowledgement",
  "type": "object",
  "required": [
    "version",
    "status",
    "retryable",
    "device_id",
    "route_id",
    "resource_id",
    "source_type",
    "source_id",
    "message_id",
    "received_at",
    "processed_at",
    "error"
  ],
  "properties": {
    "version": {
      "type": "string",
      "const": "iot.v1.mqtt.feed_data_ack"
    },
    "status": {
      "type": "string",
      "enum": ["accepted", "replayed", "conflict", "rejected", "error"]
    },
    "retryable": { "type": "boolean" },
    "device_id": { "type": "string" },
    "route_id": { "type": "string" },
    "resource_id": { "type": "string" },
    "source_type": {
      "type": "string",
      "enum": ["command", "sensor"]
    },
    "source_id": { "type": "string" },
    "desired_id": { "type": ["string", "null"] },
    "message_id": { "type": "string" },
    "sequence_number": { "type": ["integer", "null"] },
    "received_at": { "type": "string", "format": "date-time" },
    "processed_at": { "type": "string", "format": "date-time" },
    "error": {
      "type": ["object", "null"],
      "properties": {
        "type": { "type": "string" },
        "message": { "type": "string" },
        "details": { "type": "object" }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
