{
  "$schema": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/schemas/comcom-meta.schema.json",
  "$id": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/profiles/v0.2/operations.digital/comcom-device-status-get/schemas/resource.schema.json",
  "title": "DeviceStatus resource for comcom.device.status.get",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "state",
    "revision",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Globally unique resource URI.",
      "format": "uri-reference"
    },
    "type": {
      "const": "DeviceStatus"
    },
    "state": {
      "type": "string",
      "description": "Profile-defined state.",
      "pattern": "^[a-z][a-zA-Z0-9.-]{0,63}$"
    },
    "revision": {
      "type": "integer",
      "minimum": 0
    },
    "createdAt": {
      "type": "string",
      "description": "Creation instant.",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "description": "Last update instant.",
      "format": "date-time"
    },
    "statusCode": {
      "type": "string",
      "description": "Profile-defined business state.",
      "pattern": "^[a-z][a-zA-Z0-9.-]{0,63}$"
    },
    "assetId": {
      "type": "string",
      "description": "Asset or device URI.",
      "format": "uri-reference"
    },
    "locationId": {
      "type": "string",
      "description": "Location URI.",
      "format": "uri-reference"
    },
    "metricCode": {
      "type": "string",
      "description": "Metric or operation code.",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    },
    "value": {
      "type": "string",
      "description": "Measured or requested numeric value.",
      "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$"
    },
    "unitCode": {
      "type": "string",
      "description": "UNECE or profile-declared unit code.",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    },
    "observedAt": {
      "type": "string",
      "description": "Observation instant.",
      "format": "date-time"
    },
    "commandCode": {
      "type": "string",
      "description": "Command or rule code.",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    }
  }
}
