UNPKG

@iotize/device-client.js

Version:

IoTize Device client for Javascript

402 lines (401 loc) 11.9 kB
"use strict"; /** * This file has been generated * DO NOT EDIT, IT MAY BE OVERWRITTEN */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var abstract_service_1 = require("../abstract-service"); var DeviceService = /** @class */ (function (_super) { __extends(DeviceService, _super); function DeviceService(client, apiConfig) { var _this = _super.call(this, client, apiConfig) || this; _this.resources = { 'factoryReset': { path: "/device/factory-reset", methodType: "POST" }, 'getAvailablePowerSource': { path: "/device/available-power-source", methodType: "GET", returnTypeConverter: "AvailablePowerSource" }, 'getCurrentTime': { path: "/device/current-time", methodType: "GET", returnTypeConverter: "string" }, 'getFirmwareVersion': { path: "/device/firmware-version", methodType: "GET", returnTypeConverter: "string" }, 'getLastErrorCode': { path: "/device/last-error-code", methodType: "GET", returnTypeConverter: "integer_uint32" }, 'getManufacturer': { path: "/device/manufacturer", methodType: "GET", returnTypeConverter: "string" }, 'getMemoryFree': { path: "/device/memory-free", methodType: "GET", returnTypeConverter: "integer_uint32" }, 'getModelName': { path: "/device/model-name", methodType: "GET", returnTypeConverter: "string" }, 'getPowerSourceVoltage': { path: "/device/power-source-voltage", methodType: "GET", returnTypeConverter: "integer_uint32" }, 'getSerialNumber': { path: "/device/serial-number", methodType: "GET", returnTypeConverter: "string" }, 'postLastErrorCode': { path: "/device/last-error-code", methodType: "POST" }, 'putCurrentTime': { path: "/device/current-time", methodType: "PUT" }, 'reboot': { path: "/device/reboot", methodType: "POST" }, 'resetLastErrorCode': { path: "/device/reset-last-error-code", methodType: "POST" }, }; return _this; } /** * Factory reset * * LWM2M path: /3//5 * @tapVersion(">=1.0") * @return void api call */ DeviceService.prototype.factoryReset = function () { var callOptions = this.factoryResetCall(); return this._call(callOptions); }; /** * Factory reset * * LWM2M path: /3//5 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.factoryResetCall = function () { var callOptions = this.resources.factoryReset; return callOptions; }; /** * Get available power sources * * LWM2M path: /3//6 * @tapVersion(">=1.0") * @return AvailablePowerSource api call */ DeviceService.prototype.getAvailablePowerSource = function () { var callOptions = this.getAvailablePowerSourceCall(); return this._call(callOptions); }; /** * Get available power sources * * LWM2M path: /3//6 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getAvailablePowerSourceCall = function () { var callOptions = this.resources.getAvailablePowerSource; return callOptions; }; /** * Get device current time * * LWM2M path: /3//13 * @tapVersion(">=1.0") * @return string api call */ DeviceService.prototype.getCurrentTime = function () { var callOptions = this.getCurrentTimeCall(); return this._call(callOptions); }; /** * Get device current time * * LWM2M path: /3//13 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getCurrentTimeCall = function () { var callOptions = this.resources.getCurrentTime; return callOptions; }; /** * Get device firmware version * * LWM2M path: /3//3 * @tapVersion(">=1.0") * @return string api call */ DeviceService.prototype.getFirmwareVersion = function () { var callOptions = this.getFirmwareVersionCall(); return this._call(callOptions); }; /** * Get device firmware version * * LWM2M path: /3//3 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getFirmwareVersionCall = function () { var callOptions = this.resources.getFirmwareVersion; return callOptions; }; /** * Get device last error code * * LWM2M path: /3//11 * @tapVersion(">=1.0") * @return number api call */ DeviceService.prototype.getLastErrorCode = function () { var callOptions = this.getLastErrorCodeCall(); return this._call(callOptions); }; /** * Get device last error code * * LWM2M path: /3//11 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getLastErrorCodeCall = function () { var callOptions = this.resources.getLastErrorCode; return callOptions; }; /** * Get manufacturer name * * LWM2M path: /3//0 * @tapVersion(">=1.0") * @return string api call */ DeviceService.prototype.getManufacturer = function () { var callOptions = this.getManufacturerCall(); return this._call(callOptions); }; /** * Get manufacturer name * * LWM2M path: /3//0 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getManufacturerCall = function () { var callOptions = this.resources.getManufacturer; return callOptions; }; /** * Get device memory free * In bytes * LWM2M path: /3//10 * @tapVersion(">=1.0") * @return number api call */ DeviceService.prototype.getMemoryFree = function () { var callOptions = this.getMemoryFreeCall(); return this._call(callOptions); }; /** * Get device memory free * In bytes * LWM2M path: /3//10 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getMemoryFreeCall = function () { var callOptions = this.resources.getMemoryFree; return callOptions; }; /** * Get device model name * * LWM2M path: /3//1 * @tapVersion(">=1.0") * @return string api call */ DeviceService.prototype.getModelName = function () { var callOptions = this.getModelNameCall(); return this._call(callOptions); }; /** * Get device model name * * LWM2M path: /3//1 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getModelNameCall = function () { var callOptions = this.resources.getModelName; return callOptions; }; /** * Get power source voltage * * LWM2M path: /3//7 * @tapVersion(">=1.0") * @return number api call */ DeviceService.prototype.getPowerSourceVoltage = function () { var callOptions = this.getPowerSourceVoltageCall(); return this._call(callOptions); }; /** * Get power source voltage * * LWM2M path: /3//7 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getPowerSourceVoltageCall = function () { var callOptions = this.resources.getPowerSourceVoltage; return callOptions; }; /** * Get device serial number * * LWM2M path: /3//2 * @tapVersion(">=1.0") * @return string api call */ DeviceService.prototype.getSerialNumber = function () { var callOptions = this.getSerialNumberCall(); return this._call(callOptions); }; /** * Get device serial number * * LWM2M path: /3//2 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.getSerialNumberCall = function () { var callOptions = this.resources.getSerialNumber; return callOptions; }; /** * ??? * * LWM2M path: /3//11 * @tapVersion(">=1.0") * @return void api call */ DeviceService.prototype.postLastErrorCode = function () { var callOptions = this.postLastErrorCodeCall(); return this._call(callOptions); }; /** * ??? * * LWM2M path: /3//11 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.postLastErrorCodeCall = function () { var callOptions = this.resources.postLastErrorCode; return callOptions; }; /** * Set device current time * * LWM2M path: /3//13 * @tapVersion(">=1.0") * @return void api call */ DeviceService.prototype.putCurrentTime = function () { var callOptions = this.putCurrentTimeCall(); return this._call(callOptions); }; /** * Set device current time * * LWM2M path: /3//13 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.putCurrentTimeCall = function () { var callOptions = this.resources.putCurrentTime; return callOptions; }; /** * Reboot device * * LWM2M path: /3//4 * @tapVersion(">=1.0") * @return void api call */ DeviceService.prototype.reboot = function () { var callOptions = this.rebootCall(); return this._call(callOptions); }; /** * Reboot device * * LWM2M path: /3//4 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.rebootCall = function () { var callOptions = this.resources.reboot; return callOptions; }; /** * Reset device last error code * * LWM2M path: /3//12 * @tapVersion(">=1.0") * @return void api call */ DeviceService.prototype.resetLastErrorCode = function () { var callOptions = this.resetLastErrorCodeCall(); return this._call(callOptions); }; /** * Reset device last error code * * LWM2M path: /3//12 * @tapVersion(">=1.0") * @return call options */ DeviceService.prototype.resetLastErrorCodeCall = function () { var callOptions = this.resources.resetLastErrorCode; return callOptions; }; return DeviceService; }(abstract_service_1.AbstractService)); exports.DeviceService = DeviceService;