unifi-client
Version:
NodeJs client for Unifi products (https://www.ui.com/)
165 lines (164 loc) • 7.29 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LANDevice = void 0;
var BaseDevice_1 = require("./BaseDevice");
var Validate_1 = require("../commons/Validate");
var LANDevice = /** @class */ (function (_super) {
__extends(LANDevice, _super);
function LANDevice() {
return _super !== null && _super.apply(this, arguments) || this;
}
LANDevice.prototype.import = function (props) {
_super.prototype.import.call(this, props);
if (!Validate_1.Validate.isUndefined(props.jumboframe_enabled)) {
this.jumboFrameEnabled = props.jumboframe_enabled;
}
if (!Validate_1.Validate.isUndefined(props.flowctrl_enabled)) {
this.flowctrlEnabled = props.flowctrl_enabled;
}
if (!Validate_1.Validate.isUndefined(props.stp_version)) {
this.stpVersion = props.stp_version;
}
if (!Validate_1.Validate.isUndefined(props.stp_priority)) {
this.stpPriority = props.stp_priority;
}
if (!Validate_1.Validate.isUndefined(props.power_source_ctrl_enabled)) {
this.powerSourceCtrlEnabled = props.power_source_ctrl_enabled;
}
if (!Validate_1.Validate.isUndefined(props.config_network_lan)) {
this.configNetworkLAN = props.config_network_lan;
}
if (!Validate_1.Validate.isUndefined(props.ethernet_overrides)) {
this.ethernetOverrides = props.ethernet_overrides;
}
if (!Validate_1.Validate.isUndefined(props.usg_caps)) {
this.usgCaps = props.usg_caps;
}
if (!Validate_1.Validate.isUndefined(props.temperatures)) {
this.temperatures = props.temperatures;
}
if (!Validate_1.Validate.isUndefined(props.storage)) {
this.storage = props.storage;
}
if (!Validate_1.Validate.isUndefined(props.ruleset_interfaces)) {
this.rulesetInterfaces = props.ruleset_interfaces;
}
if (!Validate_1.Validate.isUndefined(props.setup_provision_completed)) {
this.setupProvisionCompleted = props.setup_provision_completed;
}
if (!Validate_1.Validate.isUndefined(props.setup_provision_tracking)) {
this.setupProvisionTracking = props.setup_provision_tracking;
}
if (!Validate_1.Validate.isUndefined(props.unifi_care)) {
this.unifiCare = props.unifi_care;
}
if (!Validate_1.Validate.isUndefined(props.port_overrides)) {
this.portOverrides = props.port_overrides;
}
if (!Validate_1.Validate.isUndefined(props.mgmt_network_id)) {
this.mgmtNetworkId = props.mgmt_network_id;
}
if (!Validate_1.Validate.isUndefined(props.hostname)) {
this.hostname = props.hostname;
}
if (!Validate_1.Validate.isUndefined(props.snmp_contact)) {
this.snmpContact = props.snmp_contact;
}
if (!Validate_1.Validate.isUndefined(props.snmp_location)) {
this.snmpLocation = props.snmp_location;
}
if (!Validate_1.Validate.isUndefined(props.lcm_night_mode_begins)) {
this.lcmNightModeBegins = props.lcm_night_mode_begins;
}
if (!Validate_1.Validate.isUndefined(props.lcm_night_mode_ends)) {
this.lcmNightModeEnds = props.lcm_night_mode_ends;
}
if (!Validate_1.Validate.isUndefined(props.lcm_night_mode_enabled)) {
this.lcmNightModeEnabled = props.lcm_night_mode_enabled;
}
if (!Validate_1.Validate.isUndefined(props.uptime_stats)) {
this.uptimeStats = props.uptime_stats;
}
if (!Validate_1.Validate.isUndefined(props.overheating)) {
this.overheating = props.overheating;
}
if (!Validate_1.Validate.isUndefined(props.geo_info)) {
this.geoInfo = props.geo_info;
}
if (!Validate_1.Validate.isUndefined(props.led_state)) {
this.LEDState = props.led_state;
}
if (!Validate_1.Validate.isUndefined(props['speedtest-status'])) {
this.speedTest = props['speedtest-status'];
}
if (!Validate_1.Validate.isUndefined(props['speedtest-status-saved'])) {
this.speedTestSaved = props['speedtest-status-saved'];
}
if (!Validate_1.Validate.isUndefined(props.wan2)) {
this.wan2 = props.wan2;
}
if (!Validate_1.Validate.isUndefined(props.wan1)) {
this.wan1 = props.wan1;
}
if (!Validate_1.Validate.isUndefined(props.network_table)) {
this.networkTable = props.network_table;
}
if (!Validate_1.Validate.isUndefined(props.x_inform_authkey)) {
this.xInformAuthkey = props.x_inform_authkey;
}
if (!Validate_1.Validate.isUndefined(props['wlan-num_sta'])) {
this.wlanNumSta = props['wlan-num_sta'];
}
if (!Validate_1.Validate.isUndefined(props['lan-num_sta'])) {
this.lanNumSta = props['lan-num_sta'];
}
if (!Validate_1.Validate.isUndefined(props['guest-lan-num_sta'])) {
this.guestLanNumSta = props['guest-lan-num_sta'];
}
if (!Validate_1.Validate.isUndefined(props['user-lan-num_sta'])) {
this.userLanNumSta = props['user-lan-num_sta'];
}
if (!Validate_1.Validate.isUndefined(props.anomalies)) {
this.anomalies = props.anomalies;
}
if (!Validate_1.Validate.isUndefined(props.num_desktop)) {
this.numDesktop = props.num_desktop;
}
if (!Validate_1.Validate.isUndefined(props.num_mobile)) {
this.numMobile = props.num_mobile;
}
if (!Validate_1.Validate.isUndefined(props.num_handheld)) {
this.numHandheld = props.num_handheld;
}
if (!Validate_1.Validate.isUndefined(props.total_max_power)) {
this.totalMaxPower = props.total_max_power;
}
if (!Validate_1.Validate.isUndefined(props.dhcp_server_table)) {
this.DHCPServerTable = props.dhcp_server_table;
}
if (!Validate_1.Validate.isUndefined(props.uplink_depth)) {
this.uplinkDepth = props.uplink_depth;
}
return this;
};
LANDevice.prototype.updateDevice = function (payload) {
return this._updateDevice(payload);
};
return LANDevice;
}(BaseDevice_1.BaseDevice));
exports.LANDevice = LANDevice;