UNPKG

@iotize/device-client.js

Version:

IoTize Device client for Javascript

717 lines (716 loc) 23.2 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 VariableService = /** @class */ (function (_super) { __extends(VariableService, _super); function VariableService(client, apiConfig) { var _this = _super.call(this, client, apiConfig) || this; _this.resources = { 'create': { path: "/variable/{variableId}/create", methodType: "POST", bodyEncoder: "integer_uint8" }, 'getAddress': { path: "/variable/{variableId}/address", methodType: "GET", returnTypeConverter: "integer_uint32" }, 'getBundleId': { path: "/variable/{variableId}/bundle/id", methodType: "GET", returnTypeConverter: "integer_uint16" }, 'getBundleValues': { path: "/variable/{variableId}/bundle/values", methodType: "GET", returnTypeConverter: "Bytes" }, 'getCurrentAccess': { path: "/variable/{variableId}/current-access", methodType: "GET", returnTypeConverter: "ReadWriteRights" }, 'getFormat': { path: "/variable/{variableId}/format", methodType: "GET", returnTypeConverter: "VariableFormat" }, 'getName': { path: "/variable/{variableId}/name", methodType: "GET", returnTypeConverter: "string" }, 'getNumberOfElements': { path: "/variable/{variableId}/number-of-elements", methodType: "GET", returnTypeConverter: "integer_uint8" }, 'getType': { path: "/variable/{variableId}/type", methodType: "GET", returnTypeConverter: "VariableType" }, 'getUnit': { path: "/variable/{variableId}/unit", methodType: "GET", returnTypeConverter: "string" }, 'getValue': { path: "/variable/{variableId}/value", methodType: "GET", returnTypeConverter: "Bytes" }, 'putAddress': { path: "/variable/{variableId}/address", methodType: "PUT", bodyEncoder: "integer_uint32" }, 'putBundleId': { path: "/variable/{variableId}/bundle/id", methodType: "PUT", bodyEncoder: "integer_uint16" }, 'putFormat': { path: "/variable/{variableId}/format", methodType: "PUT", bodyEncoder: "VariableFormat" }, 'putName': { path: "/variable/{variableId}/name", methodType: "PUT", bodyEncoder: "string" }, 'putNumberOfElements': { path: "/variable/{variableId}/number-of-elements", methodType: "PUT", bodyEncoder: "integer_uint8" }, 'putUnit': { path: "/variable/{variableId}/unit", methodType: "PUT", bodyEncoder: "string" }, 'putValue': { path: "/variable/{variableId}/value", methodType: "PUT", bodyEncoder: "Bytes" }, 'readProfile': { path: "/variable/read-profile", methodType: "GET", returnTypeConverter: "Bytes" }, 'setValue': { path: "/variable/{variableId}/set-value", methodType: "POST", bodyEncoder: "Bytes" }, }; return _this; } /** * Write variable bundle id * Create a variable * LWM2M path: /1029/{variableId}/65535 * Body converter id: "integer_uint8" * @tapVersion(">=1.0") * @param variableId input * @param extraSize input * @return void api call */ VariableService.prototype.create = function (variableId, extraSize) { var callOptions = this.createCall(variableId, extraSize); return this._call(callOptions); }; /** * Write variable bundle id * Create a variable * LWM2M path: /1029/{variableId}/65535 * Body converter id: "integer_uint8" * @tapVersion(">=1.0") * @param variableId input * @param extraSize input * @return call options */ VariableService.prototype.createCall = function (variableId, extraSize) { var callOptions = this.resources.create; callOptions.body = extraSize; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable address * * LWM2M path: /1029/{variableId}/0 * @tapVersion(">=1.0") * @param variableId input * @return number api call */ VariableService.prototype.getAddress = function (variableId) { var callOptions = this.getAddressCall(variableId); return this._call(callOptions); }; /** * Get variable address * * LWM2M path: /1029/{variableId}/0 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getAddressCall = function (variableId) { var callOptions = this.resources.getAddress; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable bundle id * ID du bundle qui contient la variable * LWM2M path: /1029/{variableId}/6 * @tapVersion(">=1.0") * @param variableId input * @return number api call */ VariableService.prototype.getBundleId = function (variableId) { var callOptions = this.getBundleIdCall(variableId); return this._call(callOptions); }; /** * Get variable bundle id * ID du bundle qui contient la variable * LWM2M path: /1029/{variableId}/6 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getBundleIdCall = function (variableId) { var callOptions = this.resources.getBundleId; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable bundle values (formated as a TLV) * * LWM2M path: /1029/{variableId}/7 * @tapVersion(">=1.0") * @param variableId input * @return Uint8Array api call */ VariableService.prototype.getBundleValues = function (variableId) { var callOptions = this.getBundleValuesCall(variableId); return this._call(callOptions); }; /** * Get variable bundle values (formated as a TLV) * * LWM2M path: /1029/{variableId}/7 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getBundleValuesCall = function (variableId) { var callOptions = this.resources.getBundleValues; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get access rights for the variable * Get access rights for the variable (read and write) * LWM2M path: /1029/{variableId}/3 * @tapVersion(">=1.0") * @param variableId input * @return ReadWriteRights api call */ VariableService.prototype.getCurrentAccess = function (variableId) { var callOptions = this.getCurrentAccessCall(variableId); return this._call(callOptions); }; /** * Get access rights for the variable * Get access rights for the variable (read and write) * LWM2M path: /1029/{variableId}/3 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getCurrentAccessCall = function (variableId) { var callOptions = this.resources.getCurrentAccess; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get data format for variable * * LWM2M path: /1029/{variableId}/1 * @tapVersion(">=1.0") * @param variableId input * @return VariableFormat api call */ VariableService.prototype.getFormat = function (variableId) { var callOptions = this.getFormatCall(variableId); return this._call(callOptions); }; /** * Get data format for variable * * LWM2M path: /1029/{variableId}/1 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getFormatCall = function (variableId) { var callOptions = this.resources.getFormat; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable name * * LWM2M path: /1029/{variableId}/8 * @deprecated * @tapVersion(">=1.60") * @param variableId input * @return string api call */ VariableService.prototype.getName = function (variableId) { var callOptions = this.getNameCall(variableId); return this._call(callOptions); }; /** * Get variable name * * LWM2M path: /1029/{variableId}/8 * @deprecated * @tapVersion(">=1.60") * @param variableId input * @return call options */ VariableService.prototype.getNameCall = function (variableId) { var callOptions = this.resources.getName; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable array size * Get the number of element of the variable * LWM2M path: /1029/{variableId}/2 * @tapVersion(">=1.0") * @param variableId input * @return number api call */ VariableService.prototype.getNumberOfElements = function (variableId) { var callOptions = this.getNumberOfElementsCall(variableId); return this._call(callOptions); }; /** * Get variable array size * Get the number of element of the variable * LWM2M path: /1029/{variableId}/2 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getNumberOfElementsCall = function (variableId) { var callOptions = this.resources.getNumberOfElements; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get data type for variable * * LWM2M path: /1029/{variableId}/1 * @tapVersion(">=1.0") * @param variableId input * @return VariableType api call */ VariableService.prototype.getType = function (variableId) { var callOptions = this.getTypeCall(variableId); return this._call(callOptions); }; /** * Get data type for variable * * LWM2M path: /1029/{variableId}/1 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getTypeCall = function (variableId) { var callOptions = this.resources.getType; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable unit * * LWM2M path: /1029/{variableId}/9 * @deprecated * @tapVersion(">=1.60") * @param variableId input * @return string api call */ VariableService.prototype.getUnit = function (variableId) { var callOptions = this.getUnitCall(variableId); return this._call(callOptions); }; /** * Get variable unit * * LWM2M path: /1029/{variableId}/9 * @deprecated * @tapVersion(">=1.60") * @param variableId input * @return call options */ VariableService.prototype.getUnitCall = function (variableId) { var callOptions = this.resources.getUnit; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get variable value * Value of array of values. The size depends of variable format * LWM2M path: /1029/{variableId}/4 * @tapVersion(">=1.0") * @param variableId input * @return Uint8Array api call */ VariableService.prototype.getValue = function (variableId) { var callOptions = this.getValueCall(variableId); return this._call(callOptions); }; /** * Get variable value * Value of array of values. The size depends of variable format * LWM2M path: /1029/{variableId}/4 * @tapVersion(">=1.0") * @param variableId input * @return call options */ VariableService.prototype.getValueCall = function (variableId) { var callOptions = this.resources.getValue; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Write variable address * * LWM2M path: /1029/{variableId}/0 * Body converter id: "integer_uint32" * @tapVersion(">=1.0") * @param variableId input * @param address input * @return void api call */ VariableService.prototype.putAddress = function (variableId, address) { var callOptions = this.putAddressCall(variableId, address); return this._call(callOptions); }; /** * Write variable address * * LWM2M path: /1029/{variableId}/0 * Body converter id: "integer_uint32" * @tapVersion(">=1.0") * @param variableId input * @param address input * @return call options */ VariableService.prototype.putAddressCall = function (variableId, address) { var callOptions = this.resources.putAddress; callOptions.body = address; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Write variable bundle id * * LWM2M path: /1029/{variableId}/6 * Body converter id: "integer_uint16" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return void api call */ VariableService.prototype.putBundleId = function (variableId, value) { var callOptions = this.putBundleIdCall(variableId, value); return this._call(callOptions); }; /** * Write variable bundle id * * LWM2M path: /1029/{variableId}/6 * Body converter id: "integer_uint16" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return call options */ VariableService.prototype.putBundleIdCall = function (variableId, value) { var callOptions = this.resources.putBundleId; callOptions.body = value; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Set data format of the variable * * LWM2M path: /1029/{variableId}/1 * Body converter id: "VariableFormat" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return void api call */ VariableService.prototype.putFormat = function (variableId, value) { var callOptions = this.putFormatCall(variableId, value); return this._call(callOptions); }; /** * Set data format of the variable * * LWM2M path: /1029/{variableId}/1 * Body converter id: "VariableFormat" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return call options */ VariableService.prototype.putFormatCall = function (variableId, value) { var callOptions = this.resources.putFormat; callOptions.body = value; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Write variable name * * LWM2M path: /1029/{variableId}/8 * Body converter id: "string" * @deprecated * @tapVersion(">=1.60") * @param variableId input * @param address input * @return void api call */ VariableService.prototype.putName = function (variableId, address) { var callOptions = this.putNameCall(variableId, address); return this._call(callOptions); }; /** * Write variable name * * LWM2M path: /1029/{variableId}/8 * Body converter id: "string" * @deprecated * @tapVersion(">=1.60") * @param variableId input * @param address input * @return call options */ VariableService.prototype.putNameCall = function (variableId, address) { var callOptions = this.resources.putName; callOptions.body = address; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Write variable array size * Set the number of element of the variable * LWM2M path: /1029/{variableId}/2 * Body converter id: "integer_uint8" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return void api call */ VariableService.prototype.putNumberOfElements = function (variableId, value) { var callOptions = this.putNumberOfElementsCall(variableId, value); return this._call(callOptions); }; /** * Write variable array size * Set the number of element of the variable * LWM2M path: /1029/{variableId}/2 * Body converter id: "integer_uint8" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return call options */ VariableService.prototype.putNumberOfElementsCall = function (variableId, value) { var callOptions = this.resources.putNumberOfElements; callOptions.body = value; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Write variable unit * * LWM2M path: /1029/{variableId}/9 * Body converter id: "string" * @deprecated * @tapVersion(">=1.60") * @param variableId input * @param address input * @return void api call */ VariableService.prototype.putUnit = function (variableId, address) { var callOptions = this.putUnitCall(variableId, address); return this._call(callOptions); }; /** * Write variable unit * * LWM2M path: /1029/{variableId}/9 * Body converter id: "string" * @deprecated * @tapVersion(">=1.60") * @param variableId input * @param address input * @return call options */ VariableService.prototype.putUnitCall = function (variableId, address) { var callOptions = this.resources.putUnit; callOptions.body = address; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Set variable value * * LWM2M path: /1029/{variableId}/4 * Body converter id: "Bytes" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return void api call */ VariableService.prototype.putValue = function (variableId, value) { var callOptions = this.putValueCall(variableId, value); return this._call(callOptions); }; /** * Set variable value * * LWM2M path: /1029/{variableId}/4 * Body converter id: "Bytes" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return call options */ VariableService.prototype.putValueCall = function (variableId, value) { var callOptions = this.resources.putValue; callOptions.body = value; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; /** * Get all variable values for the current profile * * LWM2M path: /1029//4 * @tapVersion(">=1.0") * @return Uint8Array api call */ VariableService.prototype.readProfile = function () { var callOptions = this.readProfileCall(); return this._call(callOptions); }; /** * Get all variable values for the current profile * * LWM2M path: /1029//4 * @tapVersion(">=1.0") * @return call options */ VariableService.prototype.readProfileCall = function () { var callOptions = this.resources.readProfile; return callOptions; }; /** * Set variable value * Difference with put ? * LWM2M path: /1029/{variableId}/5 * Body converter id: "Bytes" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return void api call */ VariableService.prototype.setValue = function (variableId, value) { var callOptions = this.setValueCall(variableId, value); return this._call(callOptions); }; /** * Set variable value * Difference with put ? * LWM2M path: /1029/{variableId}/5 * Body converter id: "Bytes" * @tapVersion(">=1.0") * @param variableId input * @param value input * @return call options */ VariableService.prototype.setValueCall = function (variableId, value) { var callOptions = this.resources.setValue; callOptions.body = value; callOptions.pathParameters = { "variableId": variableId, }; return callOptions; }; return VariableService; }(abstract_service_1.AbstractService)); exports.VariableService = VariableService;