#%RAML 0.8
title: WWST Air Quality Sensor Level
version: v1.0.0-20170911
schemas:
- Operation: |
    {
      "id": "http://openinterconnect.org/iotdatamodels/schemas/x.com.st.sensorlevel.json#",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.",
      "title": "Air Quality Sensor Level",
      "definitions": {
        "x.com.st.sensorlevel": {
          "type": "object",
          "properties": {
            "machineStates": {
              "type": "array",
              "readOnly": true,
              "description": "array of the possible operational states.",
              "items": {
                "type": "string"
              }
            },
            "currentMachineState": {
              "type": "string",
              "description": "Current state of operation of the device."
            }
          }
        }
      },
      "type": "object",
      "allOf": [
        {
          "$ref": "oic.baseResource.json#/definitions/oic.r.baseresource"
        },
        {
          "$ref": "#/definitions/x.com.st.sensorlevel"
        }
      ],
      "required": [
        "machineStates",
        "currentMachineState"
      ]
    }

traits:
  - interface:
      queryParameters:
        if:
          enum: ["oic.if.s","oic.if.baseline"]

/WWSTAirQualitySensorResURI:
  description: |
        Air quality level
  displayName: WWST Air Quality Sensor Level
  is: [ interface ]

  get:
    description: |
      Retrieves the current air quality level
    responses:
      200:
        body:
          application/json:
            schema: Operation
            example: |
              {
                "rt":             ["x.com.st.sensorlevel"],
                "id":             "unique_example_id",
                "currentMachineState" : "good",
                "machineStates" : ["poor", "bad", "normal", "very good", "execellent" ]
              }
