#%RAML 0.8
title: STSmokeDetector
version: v1.1.2-20170523
schemas:
- Exception: http://www.samsung.com/schemas/x.com.st.stocfexception.json
- SmokeDetector: |
    {
     "id": "http://www.samsung.com/schemas/x.com.st.smokedetector.json#",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
      "title": "SmartThing Smoke Detector",
      "definitions": {
        "x.com.st.smokedetector": {
          "type": "object",
          "properties": {
            "smoke": {
              "type": "string",
              "enum": ["clear", "detected", "tested", "preAlert"],
              "description": "The state of smoke detection device"
            },
            "carbonMonoxide": {
              "type": "string",
              "enum": ["clear", "detected", "tested"],
              "description": "The state of carbon monoxide device"
            }
          }
        }
      },
      "type": "object",
      "allOf": [
        {"$ref": "oic.core.json#/definitions/oic.core"},
        {"$ref": "oic.baseResource.json#/definitions/oic.r.baseresource"},
        {"$ref": "#/definitions/x.com.st.smokedetector"}
      ],
      "required": ["smoke"]
    }
traits:
 - interface :
     queryParameters:
       if:
         enum: ["oic.if.baseline"]

/smokeDetector:
  displayName: smoke Detector
  description: |
    This resource describes the status of smoke detector device and carbon monoxide device
  is : ['interface']

  get:
    description: |
      Retrieves the status of the smoke detector and carbon monoxide detector devices.

    responses :
      200:
        body:
          application/json:
            schema: SmokeDetector
            example: |
              {
                "id": "unique_example_id",
                "smoke": "clear",
              }
      400:
        body:
          application/json:
            schema: Exception
            example: |
              {
                "code": "OCF_01",
                "message": "Failed to process OCF request!"
              }
