openapi: 3.0.1
info:
  title: A weather API.
  version: 0.0.1
servers:
- url: /
paths:
  /:
    get:
      operationId: getRootService
      responses:
        200:
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: '#/components/schemas/service'
                properties:
                  rulebase:
                    $ref: '#/components/schemas/service'
                  weather:
                    $ref: '#/components/schemas/service'
                required:
                - rulebase
                - weather
                type: object
          description: '200 OK Response: The list of services.'
      summary: A list of services provided by this API.
      tags:
      - root
      x-swagger-router-controller: Root
  /rulebase:
    get:
      operationId: getRulebaseService
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200'
          description: '200 OK Response: The list of rulebase services.'
      summary: The blackbox rulebase service.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
  /rulebase/rules:
    get:
      operationId: getRules
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                items:
                  anyOf:
                  - $ref: '#/components/schemas/rule'
                  - $ref: '#/components/schemas/verbose-object'
                type: array
          description: '200 OK Response: The list of rules.'
      summary: Provides a list of black box rules.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    post:
      operationId: createRule
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/rule'
        description: A blackbox rule.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: Successful creation. The rule name will be
            returned. Supports a verbose response.'
      summary: Creates a rule.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    x-blackbox-types:
    - uri: http://ellipsistechnology.com/schemas/blackbox/
      name: rule
  /rulebase/rules/{name}:
    delete:
      operationId: deleteRule
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/named-reference'
          description: '200 OK Response: The rule name will be returned.'
      summary: Delete the rule identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    get:
      operationId: getRule
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/rule'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The requested rule.'
      summary: Request a rule identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    patch:
      operationId: updateRule
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/rule'
        description: A Blackbox rule.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The rule name will be returned. Supports
            a verbose response.'
      summary: Change some of the fields of the rule identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    put:
      operationId: replaceRule
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/rule'
        description: A Blackbox rule.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The rule name will be returned. Supports
            a verbose response.'
      summary: Replace the rule identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
  /rulebase/conditions:
    get:
      operationId: getConditions
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                items:
                  anyOf:
                  - $ref: '#/components/schemas/condition'
                  - $ref: '#/components/schemas/verbose-object'
                type: array
          description: '200 OK Response: The list of conditions.'
      summary: Provides a list of black box conditions.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    post:
      operationId: createCondition
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/condition'
        description: A blackbox condition.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: Successful creation. The condition name will
            be returned. Supports a verbose response.'
      summary: Creates a condition.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    x-blackbox-types:
    - uri: http://ellipsistechnology.com/schemas/blackbox/
      name: condition
  /rulebase/conditions/{name}:
    delete:
      operationId: deleteCondition
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/named-reference'
          description: '200 OK Response: The condition name will be returned.'
      summary: Delete the condition identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    get:
      operationId: getCondition
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/condition'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The requested condition.'
      summary: Request a condition identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    patch:
      operationId: updateCondition
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/condition'
        description: A Blackbox condition.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The condition name will be returned. Supports
            a verbose response.'
      summary: Change some of the fields of the condition identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    put:
      operationId: replaceCondition
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/condition'
        description: A Blackbox condition.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The condition name will be returned. Supports
            a verbose response.'
      summary: Replace the condition identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
  /rulebase/values:
    get:
      operationId: getValues
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                items:
                  anyOf:
                  - $ref: '#/components/schemas/value'
                  - $ref: '#/components/schemas/verbose-object'
                type: array
          description: '200 OK Response: The list of values.'
      summary: Provides a list of black box values.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    post:
      operationId: createValue
      parameters:
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/value'
        description: A blackbox value.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: Successful creation. The value name will
            be returned. Supports a verbose response.'
      summary: Creates a value.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    x-blackbox-types:
    - uri: http://ellipsistechnology.com/schemas/blackbox/
      name: value
  /rulebase/values/{name}:
    delete:
      operationId: deleteValue
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/named-reference'
          description: '200 OK Response: The value name will be returned.'
      summary: Delete the value identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    get:
      operationId: getValue
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/value'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The requested value.'
      summary: Request a value identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    patch:
      operationId: updateValue
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/value'
        description: A Blackbox value.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The value name will be returned. Supports
            a verbose response.'
      summary: Change some of the fields of the value identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
    put:
      operationId: replaceValue
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/value'
        description: A Blackbox value.
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/named-reference'
                - $ref: '#/components/schemas/verbose-object'
          description: '200 OK Response: The value name will be returned. Supports
            a verbose response.'
      summary: Replace the value identified by its name.
      tags:
      - rulebase
      x-swagger-router-controller: Rulebase
  /weather:
    get:
      operationId: getWeather
      parameters:
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_1'
          description: 200 OK Response.
      summary: 'Weather service: Provides temperature and humidity information.'
      tags:
      - weather
      x-swagger-router-controller: Weather
  /weather/temperature:
    get:
      operationId: getTemperatures
      parameters:
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                items:
                  allOf:
                  - $ref: '#/components/schemas/temperature'
                  - $ref: '#/components/schemas/verbose-object'
                type: array
          description: 200 OK Response.
      summary: Returns a temperature object.
      tags:
      - weather
      x-swagger-router-controller: Weather
    x-blackbox-types:
    - uri: https://bitbucket.org/ellipsistechnology/blackbox-datatypes/raw/691588c69282a4e5d8c5a6cd6a042acb18f8abb2/types.json?raw
      name: temperature
  /weather/temperature/{name}:
    get:
      operationId: getTemperature
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/temperature'
                - $ref: '#/components/schemas/verbose-object'
          description: 200 OK Response.
      summary: Gets a temperature by name.
      tags:
      - weather
      - weather
      x-swagger-router-controller: Weather
  /weather/humidity:
    get:
      operationId: getHumidities
      parameters:
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                items:
                  type: number
                type: array
          description: 200 OK Response.
      summary: Retrieve a list of humidity objects.
      tags:
      - weather
      x-swagger-router-controller: Weather
  /weather/humidity/{name}:
    get:
      operationId: getHumidity
      parameters:
      - description: The object's name.
        explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      - description: Indicates that the response must have verbose output.
        explode: true
        in: query
        name: verbose
        required: false
        schema:
          type: string
        style: form
      - description: Indicates the depth of the returned object's hierarchy.
        explode: true
        in: query
        name: depth
        required: false
        schema:
          type: number
        style: form
      responses:
        200:
          content:
            application/json:
              schema:
                type: number
          description: 200 OK Response.
      summary: Gets a humidity by name.
      tags:
      - weather
      - weather
      x-swagger-router-controller: Weather
components:
  parameters:
    path-name:
      description: The object's name.
      explode: false
      in: path
      name: name
      required: true
      schema:
        type: string
      style: simple
    query-verbose:
      description: Indicates that the response must have verbose output.
      explode: true
      in: query
      name: verbose
      required: false
      schema:
        type: string
      style: form
    query-depth:
      description: Indicates the depth of the returned object's hierarchy.
      explode: true
      in: query
      name: depth
      required: false
      schema:
        type: number
      style: form
  schemas:
    link:
      properties:
        href:
          type: string
        description:
          type: string
      required:
      - href
      type: object
    links:
      additionalProperties:
        $ref: '#/components/schemas/link'
      properties:
        self:
          $ref: '#/components/schemas/link'
      required:
      - self
      type: object
    verbose-object:
      properties:
        links:
          $ref: '#/components/schemas/links'
      type: object
    service:
      example:
        bbversion: bbversion
        description: description
        links:
          key: ""
      properties:
        description:
          type: string
        bbversion:
          type: string
        links:
          additionalProperties:
            allOf:
            - $ref: '#/components/schemas/link'
            - properties:
                types:
                  items:
                    properties:
                      uri:
                        type: string
                      format:
                        type: string
                      description:
                        type: string
                    required:
                    - uri
                    type: object
                  type: array
              required:
              - types
              type: object
          properties:
            self:
              $ref: '#/components/schemas/link'
          required:
          - self
          type: object
      required:
      - bbversion
      - description
      - links
      type: object
    rule:
      properties:
        name:
          type: string
        preCondition:
          oneOf:
          - $ref: '#/components/schemas/condition'
          - $ref: '#/components/schemas/link'
        postCondition:
          oneOf:
          - $ref: '#/components/schemas/condition'
          - $ref: '#/components/schemas/link'
        trigger:
          oneOf:
          - $ref: '#/components/schemas/condition'
          - $ref: '#/components/schemas/link'
        action:
          oneOf:
          - $ref: '#/components/schemas/condition'
          - $ref: '#/components/schemas/link'
      required:
      - action
      - name
      - trigger
      type: object
    condition:
      properties:
        name:
          type: string
        left:
          oneOf:
          - $ref: '#/components/schemas/value'
          - $ref: '#/components/schemas/link'
        right:
          oneOf:
          - $ref: '#/components/schemas/value'
          - $ref: '#/components/schemas/link'
        type:
          $ref: '#/components/schemas/condition-type'
      required:
      - left
      - name
      - right
      - type
      type: object
    condition-type:
      enum:
      - =
      - '>'
      - <
      - and
      - or
      type: string
    value:
      properties:
        type:
          type: string
        value:
          oneOf:
          - type: string
          - type: object
      required:
      - type
      - value
      type: object
    named-reference:
      example:
        name: name
      properties:
        name:
          type: string
      required:
      - name
      type: object
    temperature:
      properties:
        temp:
          type: number
        scale:
          type: string
      type: object
    inline_response_200:
      example:
        values:
          bbversion: bbversion
          description: description
          links:
            key: ""
        rules:
          bbversion: bbversion
          description: description
          links:
            key: ""
        conditions:
          bbversion: bbversion
          description: description
          links:
            key: ""
      properties:
        rules:
          $ref: '#/components/schemas/service'
        conditions:
          $ref: '#/components/schemas/service'
        values:
          $ref: '#/components/schemas/service'
      required:
      - conditions
      - rules
      - values
    inline_response_200_1:
      example:
        temperature:
          bbversion: bbversion
          description: description
          links:
            key: ""
        humidity:
          bbversion: bbversion
          description: description
          links:
            key: ""
      properties:
        temperature:
          $ref: '#/components/schemas/service'
        humidity:
          $ref: '#/components/schemas/service'
      required:
      - humidity
      - temperature
