#%RAML 0.8
title: OICDimming
version: v1.0-20150727
schemas:
  - Dimming: !include oic.r.light.dimming.json

traits:
  - interface:
      queryParameters:
        if:
          enum: ["oic.if.a"]

/DimmingResURI:
  description: |
    This resource describes a dimming function.
    The value is an integer showing the current dimming level.
    The step is the increment between dimmer values.
    The range is the maximum and minimum values for the dimming value.
    If the range is omitted [0,100] is assumed.
    A value of 0 means total dimming; a value of 100 means no dimming.
  displayName: Dimming
  is: [ interface ] # valid for all methods

  get:
    description: |
      Retrieves the current dimming level.
    responses:
      200:
        body:
          application/json:
            schema: Dimming
            example: |
              {
                "rt":             "oic.r.light.dimming",
                "id":             "unique_example_id",
                "dimmingSetting": 30,
                "step":           5,
                "range":          "0,100"
              }

  post:
    description: |
      Sets the desired dimming level.
    body:
      application/json:
        schema: Dimming
        example: |
          {
            "id":             "unique_example_id",
            "dimmingSetting": 40
          }

    responses:
      200:
        description: |
          Indicates that the dimming was changed.
          The new dimming level is provided in the response.
        body:
          application/json:
            schema: Dimming
            example: |
              {
                "id":             "unique_example_id",
                "dimmingSetting": 40
              }

      403:
        description: |
          This response is generated by the OIC Server when the client sends:
            An update with an out of range property value for dimmingSetting.
          The server responds with the current resource representation.
        body:
          application/json:
            schema: Dimming
            example: |
              {
                "id":             "unique_example_id",
                "dimmingSetting": 40
              }