{
  "swagger": "2.0",
  "info": {
    "description": "Microservice which expose the service device",
    "version": "0.0.1",
    "title": "MS Devices",
    "contact": {}
  },
  "host": "dev-motion.cwbyminsait.com",
  "basePath": "/devices",
  "tags": [
    {
      "name": "device-controller",
      "description": "Device Controller"
    }
  ],
  "paths": {
    "/v1/devices": {
      "get": {
        "tags": [
          "device-controller"
        ],
        "summary": "Get devices",
        "description": "Return the devices",
        "operationId": "getDevicesUsingGET",
        "produces": [
          "*/*"
        ],
        "parameters": [
          {
            "name": "geometry.coordinates",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "object"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "geometry.type",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "devicePairedList",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "deviceId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "fromCreationDate",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "toCreationDate",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Request Successful, review the resulting object. ",
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          "400": {
            "description": "Bad request, review the request param"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Unexpected exception (Internal Server Error)"
          }
        }
      },
      "post": {
        "tags": [
          "device-controller"
        ],
        "summary": "Device creation",
        "description": "Create a new device",
        "operationId": "createDeviceUsingPOST",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "*/*"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "device",
            "description": "device",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request Successful, review the resulting object. If infoError is not null, then a functional error has occurred in the back-end ",
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad request, review the request param"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Unexpected exception (Internal Server Error)"
          }
        }
      }
    },
    "/v1/devices/{deviceId}": {
      "get": {
        "tags": [
          "device-controller"
        ],
        "summary": "Get device by deviceId",
        "description": "Get device by deviceId",
        "operationId": "getByIdUsingGET",
        "produces": [
          "*/*"
        ],
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "description": "deviceId",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Updated Successful, review the resulting object.",
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          "400": {
            "description": "Bad request, review the request param"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Device not found."
          },
          "500": {
            "description": "Unexpecte#/device-controller/getDevicesUsingGETd exception (Internal Server Error)"
          }
        }
      },
      "put": {
        "tags": [
          "device-controller"
        ],
        "summary": "Update an device",
        "description": "Update the device",
        "operationId": "putDeviceUsingPUT",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "*/*"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "device",
            "description": "device",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "description": "deviceId",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "201": {
            "description": "Created"
          },
          "204": {
            "description": "Updated Successful, review the resulting object.",
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          "400": {
            "description": "Bad request, review the request param"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Unexpected exception (Internal Server Error)"
          }
        }
      },
      "delete": {
        "tags": [
          "device-controller"
        ],
        "summary": "Delete device",
        "description": "Deleting the device",
        "operationId": "deleteByIdUsingDELETE",
        "produces": [
          "*/*"
        ],
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "description": "deviceId",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "Deleted Successful, review the resulting object.",
            "schema": {
              "$ref": "#/definitions/Device model"
            }
          },
          "400": {
            "description": "Bad request, review the request param"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Unexpected exception (Internal Server Error)"
          }
        }
      }
    }
  },
  "definitions": {
    "DataWrapperDTO«Device model»": {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/definitions/Device model"
        }
      },
      "title": "DataWrapperDTO«Device model»"
    },
    "Device model": {
      "type": "object",
      "properties": {
        "creationDate": {
          "type": "string",
          "description": "Device creation date",
          "allowEmptyValue": false
        },
        "deviceId": {
          "type": "string",
          "description": "Devide Id",
          "allowEmptyValue": false
        },
        "devicePairedList": {
          "type": "array",
          "description": "Devices that are paired",
          "allowEmptyValue": false,
          "items": {
            "type": "string"
          }
        },
        "extrainfo": {
          "description": "Device extra info (no default fields)",
          "allowEmptyValue": false,
          "$ref": "#/definitions/JsonNode"
        },
        "geometry": {
          "description": "Device geometry data",
          "allowEmptyValue": false,
          "$ref": "#/definitions/GeometryDTO"
        },
        "role": {
          "type": "string",
          "description": "Device role",
          "allowEmptyValue": false
        },
        "status": {
          "type": "string",
          "description": "Device status",
          "allowEmptyValue": false
        },
        "type": {
          "type": "string",
          "description": "Device type",
          "allowEmptyValue": false
        }
      },
      "title": "Device model"
    },
    "GeometryDTO": {
      "type": "object",
      "properties": {
        "coordinates": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "type": {
          "type": "string"
        }
      },
      "title": "GeometryDTO"
    },
    "JsonNode": {
      "type": "object",
      "properties": {
        "array": {
          "type": "boolean"
        },
        "bigDecimal": {
          "type": "boolean"
        },
        "bigInteger": {
          "type": "boolean"
        },
        "binary": {
          "type": "boolean"
        },
        "boolean": {
          "type": "boolean"
        },
        "containerNode": {
          "type": "boolean"
        },
        "double": {
          "type": "boolean"
        },
        "float": {
          "type": "boolean"
        },
        "floatingPointNumber": {
          "type": "boolean"
        },
        "int": {
          "type": "boolean"
        },
        "integralNumber": {
          "type": "boolean"
        },
        "long": {
          "type": "boolean"
        },
        "missingNode": {
          "type": "boolean"
        },
        "nodeType": {
          "type": "string",
          "enum": [
            "ARRAY",
            "BINARY",
            "BOOLEAN",
            "MISSING",
            "NULL",
            "NUMBER",
            "OBJECT",
            "POJO",
            "STRING"
          ]
        },
        "null": {
          "type": "boolean"
        },
        "number": {
          "type": "boolean"
        },
        "object": {
          "type": "boolean"
        },
        "pojo": {
          "type": "boolean"
        },
        "short": {
          "type": "boolean"
        },
        "textual": {
          "type": "boolean"
        },
        "valueNode": {
          "type": "boolean"
        }
      },
      "title": "JsonNode"
    },
    "LinksDTO": {
      "type": "object",
      "properties": {
        "first": {
          "type": "string"
        },
        "last": {
          "type": "string"
        },
        "next": {
          "type": "string"
        },
        "previous": {
          "type": "string"
        },
        "self": {
          "type": "string"
        }
      },
      "title": "LinksDTO"
    },
    "PaginationDTO": {
      "type": "object",
      "properties": {
        "links": {
          "$ref": "#/definitions/LinksDTO"
        }
      },
      "title": "PaginationDTO"
    },
    "PaginationDataWrapperDTO«Device model»": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Device model"
          }
        },
        "pagination": {
          "$ref": "#/definitions/PaginationDTO"
        }
      },
      "title": "PaginationDataWrapperDTO«Device model»"
    }
  }
}
