{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hwlab.pikastech.local/protocol/schemas/gateway-session.schema.json",
  "title": "HWLAB Gateway Session",
  "type": "object",
  "required": [
    "gatewaySessionId",
    "projectId",
    "serviceId",
    "gatewayId",
    "status",
    "environment",
    "startedAt"
  ],
  "properties": {
    "gatewaySessionId": {
      "$ref": "common.json#/$defs/id"
    },
    "projectId": {
      "$ref": "common.json#/$defs/id"
    },
    "serviceId": {
      "enum": ["hwlab-gateway", "hwlab-gateway-simu"]
    },
    "gatewayId": {
      "$ref": "common.json#/$defs/id"
    },
    "endpoint": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "type": "string",
      "enum": ["starting", "connected", "degraded", "disconnected", "stopped"]
    },
    "environment": {
      "$ref": "common.json#/$defs/environment"
    },
    "startedAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "lastSeenAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "stoppedAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "labels": {
      "$ref": "common.json#/$defs/labels"
    }
  },
  "additionalProperties": false
}
