import { AbstractService, extendServiceContainer } from '@iotize/tap';
import { TapRequestFrame } from '@iotize/tap/client/api';
import { SerialSettings } from '@iotize/tap/service/impl/target';
import { TapStreamReader, TapStreamWriter, enumKeyOrValueToNumber } from '@iotize/tap/client/impl';
import { converters } from '@iotize/tap/service/core';
import { KaitaiStreamWriter } from '@iotize/common/byte-stream';

var AdpControlIn;
(function (AdpControlIn) {
    /* tslint:disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    var Command;
    (function (Command) {
        Command[Command["NONE"] = 0] = "NONE";
        Command[Command["ZIP"] = 32769] = "ZIP";
        Command[Command["UNZIP"] = 32770] = "UNZIP";
        Command[Command["SET_TRANSMISSION_BUFFER_SIZE"] = 32771] = "SET_TRANSMISSION_BUFFER_SIZE";
        Command[Command["TOTAL_BUFFER_SIZE"] = 32772] = "TOTAL_BUFFER_SIZE";
        Command[Command["GET_TRANSMISSION_BUFFER_SIZE"] = 32773] = "GET_TRANSMISSION_BUFFER_SIZE";
        Command[Command["SET_RESPONSE_DELIMITER_LOW"] = 32774] = "SET_RESPONSE_DELIMITER_LOW";
        Command[Command["SET_RESPONSE_DELIMITER_HIGH"] = 32775] = "SET_RESPONSE_DELIMITER_HIGH";
        Command[Command["SET_COMMAND_DELIMITER_LOW"] = 32776] = "SET_COMMAND_DELIMITER_LOW";
        Command[Command["EXEC_COMMANDS"] = 32777] = "EXEC_COMMANDS";
    })(Command = AdpControlIn.Command || (AdpControlIn.Command = {}));
})(AdpControlIn || (AdpControlIn = {}));
var AdpControlOut;
(function (AdpControlOut) {
    /* tslint:disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    var ResultCode;
    (function (ResultCode) {
        ResultCode[ResultCode["NONE"] = 0] = "NONE";
        ResultCode[ResultCode["OK"] = 32768] = "OK";
        ResultCode[ResultCode["ZIP_TIMEOUT"] = 32769] = "ZIP_TIMEOUT";
        ResultCode[ResultCode["UNZIP_TIMEOUT"] = 32770] = "UNZIP_TIMEOUT";
        ResultCode[ResultCode["ZIP_ERROR"] = 32771] = "ZIP_ERROR";
        ResultCode[ResultCode["UNZIP_ERROR"] = 32772] = "UNZIP_ERROR";
        ResultCode[ResultCode["UNKNOWN_COMMAND"] = 32773] = "UNKNOWN_COMMAND";
        ResultCode[ResultCode["INVALID_PARAM"] = 32774] = "INVALID_PARAM";
    })(ResultCode = AdpControlOut.ResultCode || (AdpControlOut.ResultCode = {}));
})(AdpControlOut || (AdpControlOut = {}));

/**
 *   Generated file. Do not edit
 */
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
TapStreamReader.prototype.readTapnpassProtocolConfiguration = function () {
    var model = {};
    model.modbus = this.readTapnpassProtocolConfigurationModbus();
    model.serial = this.readTapnpassProtocolConfigurationSerial();
    model.usb = this.readTapnpassProtocolConfigurationUsb();
    return model;
};
TapStreamReader.prototype.readTapnpassProtocolConfigurationModbus = function () {
    var model = {};
    model.slave = this.readUnsigned(1);
    this.forwardBits(3);
    model.offsetFirstRegister = this.readBoolean(1);
    return model;
};
TapStreamReader.prototype.readTapnpassProtocolConfigurationSerial = function () {
    var model = {};
    model.baudRate = this.readBits(20);
    model.identification = this.readBoolean(1);
    this.forwardBits(1);
    model.ledStatus = this.readBoolean(1);
    this.forwardBits(1);
    model.physicalPort = this.readBits(4);
    model.stopBits = this.readBits(2);
    model.bitParity = this.readBits(4);
    model.dataBits = this.readBits(2);
    model.handshakeDelimiter = this.readBits(4);
    model.hardwareFlowControl = this.readBits(4);
    model.timeout = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readTapnpassProtocolConfigurationUsb = function () {
    var model = {};
    model.aliases = [];
    while (!this.isEof()) {
        model.aliases.push(this.readTapnpassProtocolConfigurationUsbAlias());
    }
    return model;
};
TapStreamReader.prototype.readTapnpassProtocolConfigurationUsbAlias = function () {
    var model = {};
    model.pid = this.readUnsigned(2);
    model.vid = this.readUnsigned(2);
    model.equ = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readAdpStats = function () {
    var model = {};
    model.header = this.readAdpStatsHeader();
    model.state = this.readAdpStatsState();
    model.uart = this.readAdpStatsUart();
    model.usb = this.readAdpStatsUsb();
    model.current = this.readBytes(4);
    model.com = this.readAdpStatsCom();
    model.battery = this.readBytes(4);
    model.intern = this.readAdpStatsIntern();
    return model;
};
TapStreamReader.prototype.readAdpStatsHeader = function () {
    var model = {};
    this.forwardBits(16);
    model.version = this.readAdpStatsVersion();
    model.errorCode = this.readUnsigned(1);
    this.forwardBits(16);
    return model;
};
TapStreamReader.prototype.readAdpStatsVersion = function () {
    var model = {};
    model.major = this.readUnsigned(1);
    model.minor = this.readUnsigned(1);
    model.patch = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readAdpStatsIntern = function () {
    var model = {};
    model.time = this.readBytes(4);
    model.nbBoots = this.readBytes(4);
    model.nbShutdown = this.readBytes(2);
    model.nbAdpFault = this.readBytes(2);
    model.nbAdpMemFault = this.readBytes(2);
    model.nbAdpBusFault = this.readBytes(2);
    model.nbAdpUsageFault = this.readBytes(2);
    this.forwardBits(16);
    model.temperature = this.readBytes(4);
    return model;
};
TapStreamReader.prototype.readAdpStatsState = function () {
    var model = {};
    this.forwardBits(7);
    model.usbDisconnected = this.readBoolean(1);
    this.forwardBits(24);
    return model;
};
TapStreamReader.prototype.readAdpStatsUart = function () {
    var model = {};
    model.nbPartityError = this.readUnsigned(1);
    model.nbNoiseError = this.readUnsigned(1);
    model.nbFrameError = this.readUnsigned(1);
    model.nbDmaError = this.readUnsigned(1);
    model.nbTxError = this.readUnsigned(1);
    model.nbRxError = this.readUnsigned(1);
    model.nbOverRun = this.readUnsigned(1);
    this.forwardBits(8);
    return model;
};
TapStreamReader.prototype.readAdpStatsUsb = function () {
    var model = {};
    model.nbFail = this.readUnsigned(1);
    model.nbTimeout = this.readUnsigned(1);
    model.nbError = this.readUnsigned(1);
    model.nbUnknownClass = this.readUnsigned(1);
    model.nbDisconnect = this.readUnsigned(1);
    model.nbOff = this.readUnsigned(1);
    this.forwardBits(16);
    return model;
};
TapStreamReader.prototype.readAdpStatsCom = function () {
    var model = {};
    model.txBufferOverRun = this.readUnsigned(1);
    model.rxBufferOverRun = this.readUnsigned(1);
    model.nbErrorSettings = this.readUnsigned(1);
    this.forwardBits(8);
    model.nbComAdp = this.readBytes(4);
    return model;
};
TapStreamReader.prototype.readAdpControlIn = function () {
    var model = {};
    model.command = this.readUnsigned(2);
    model.param = this.readUnsigned(2);
    return model;
};
TapStreamReader.prototype.readAdpControlOut = function () {
    var model = {};
    model.resultCode = this.readUnsigned(2);
    model.param = this.readUnsigned(2);
    return model;
};
// TapStreamWriter.prototype.write(model: TapnpassProtocolConfiguration) : TapStreamWriter{
//     return this.writeTapnpassProtocolConfiguration(model)
// }
TapStreamWriter.prototype.writeTapnpassProtocolConfiguration = function (model) {
    this.writeTapnpassProtocolConfigurationModbus(model.modbus);
    this.writeTapnpassProtocolConfigurationSerial(model.serial);
    this.writeTapnpassProtocolConfigurationUsb(model.usb);
    return this;
};
TapStreamWriter.prototype.writeTapnpassProtocolConfigurationModbus = function (model) {
    this.writeUnsigned(model.slave, 1);
    this.forwardBits(3);
    this.writeBoolean(model.offsetFirstRegister, 1);
    return this;
};
TapStreamWriter.prototype.writeTapnpassProtocolConfigurationSerial = function (model) {
    this.writeBits(model.baudRate, 20);
    this.writeBoolean(model.identification, 1);
    this.forwardBits(1);
    this.writeBoolean(model.ledStatus, 1);
    this.forwardBits(1);
    this.writeBitsInt(enumKeyOrValueToNumber(model.physicalPort, SerialSettings.PhysicalPort), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.stopBits, SerialSettings.StopBits), 2);
    this.writeBitsInt(enumKeyOrValueToNumber(model.bitParity, SerialSettings.BitParity), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.dataBits, SerialSettings.DataBits), 2);
    this.writeBitsInt(enumKeyOrValueToNumber(model.handshakeDelimiter, SerialSettings.HandshakeDelimiter), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.hardwareFlowControl, SerialSettings.HardwareFlowControl), 4);
    this.writeUnsigned(model.timeout, 1);
    return this;
};
TapStreamWriter.prototype.writeTapnpassProtocolConfigurationUsb = function (model) {
    var e_1, _a;
    try {
        for (var _b = __values(model.aliases), _c = _b.next(); !_c.done; _c = _b.next()) {
            var item = _c.value;
            this.writeTapnpassProtocolConfigurationUsbAlias(item);
        }
    }
    catch (e_1_1) { e_1 = { error: e_1_1 }; }
    finally {
        try {
            if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
        }
        finally { if (e_1) throw e_1.error; }
    }
    return this;
};
TapStreamWriter.prototype.writeTapnpassProtocolConfigurationUsbAlias = function (model) {
    this.writeUnsigned(model.pid, 2);
    this.writeUnsigned(model.vid, 2);
    this.writeUnsigned(model.equ, 1);
    return this;
};
// TapStreamWriter.prototype.write(model: AdpStats) : TapStreamWriter{
//     return this.writeAdpStats(model)
// }
TapStreamWriter.prototype.writeAdpStats = function (model) {
    this.writeAdpStatsHeader(model.header);
    this.writeAdpStatsState(model.state);
    this.writeAdpStatsUart(model.uart);
    this.writeAdpStatsUsb(model.usb);
    this.writeBytes(model.current, 4);
    this.writeAdpStatsCom(model.com);
    this.writeBytes(model.battery, 4);
    this.writeAdpStatsIntern(model.intern);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsHeader = function (model) {
    this.forwardBits(16);
    this.writeAdpStatsVersion(model.version);
    this.writeUnsigned(model.errorCode, 1);
    this.forwardBits(16);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsVersion = function (model) {
    this.writeUnsigned(model.major, 1);
    this.writeUnsigned(model.minor, 1);
    this.writeUnsigned(model.patch, 1);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsIntern = function (model) {
    this.writeBytes(model.time, 4);
    this.writeBytes(model.nbBoots, 4);
    this.writeBytes(model.nbShutdown, 2);
    this.writeBytes(model.nbAdpFault, 2);
    this.writeBytes(model.nbAdpMemFault, 2);
    this.writeBytes(model.nbAdpBusFault, 2);
    this.writeBytes(model.nbAdpUsageFault, 2);
    this.forwardBits(16);
    this.writeBytes(model.temperature, 4);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsState = function (model) {
    this.forwardBits(7);
    this.writeBoolean(model.usbDisconnected, 1);
    this.forwardBits(24);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsUart = function (model) {
    this.writeUnsigned(model.nbPartityError, 1);
    this.writeUnsigned(model.nbNoiseError, 1);
    this.writeUnsigned(model.nbFrameError, 1);
    this.writeUnsigned(model.nbDmaError, 1);
    this.writeUnsigned(model.nbTxError, 1);
    this.writeUnsigned(model.nbRxError, 1);
    this.writeUnsigned(model.nbOverRun, 1);
    this.forwardBits(8);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsUsb = function (model) {
    this.writeUnsigned(model.nbFail, 1);
    this.writeUnsigned(model.nbTimeout, 1);
    this.writeUnsigned(model.nbError, 1);
    this.writeUnsigned(model.nbUnknownClass, 1);
    this.writeUnsigned(model.nbDisconnect, 1);
    this.writeUnsigned(model.nbOff, 1);
    this.forwardBits(16);
    return this;
};
TapStreamWriter.prototype.writeAdpStatsCom = function (model) {
    this.writeUnsigned(model.txBufferOverRun, 1);
    this.writeUnsigned(model.rxBufferOverRun, 1);
    this.writeUnsigned(model.nbErrorSettings, 1);
    this.forwardBits(8);
    this.writeBytes(model.nbComAdp, 4);
    return this;
};
// TapStreamWriter.prototype.write(model: AdpControlIn) : TapStreamWriter{
//     return this.writeAdpControlIn(model)
// }
TapStreamWriter.prototype.writeAdpControlIn = function (model) {
    this.writeBitsInt(enumKeyOrValueToNumber(model.command, AdpControlIn.Command), 16);
    this.writeUnsigned(model.param, 2);
    return this;
};
// TapStreamWriter.prototype.write(model: AdpControlOut) : TapStreamWriter{
//     return this.writeAdpControlOut(model)
// }
TapStreamWriter.prototype.writeAdpControlOut = function (model) {
    this.writeBitsInt(enumKeyOrValueToNumber(model.resultCode, AdpControlOut.ResultCode), 16);
    this.writeUnsigned(model.param, 2);
    return this;
};

/**
 *   Generated file. Do not edit
 */
var TapnpassProtocolConfigurationConverter = /** @class */ (function () {
    function TapnpassProtocolConfigurationConverter() {
    }
    TapnpassProtocolConfigurationConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeTapnpassProtocolConfiguration(model);
        return stream.toBytes;
    };
    TapnpassProtocolConfigurationConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readTapnpassProtocolConfiguration();
    };
    return TapnpassProtocolConfigurationConverter;
}());
var AdpStatsConverter = /** @class */ (function () {
    function AdpStatsConverter() {
    }
    AdpStatsConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeAdpStats(model);
        return stream.toBytes;
    };
    AdpStatsConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readAdpStats();
    };
    return AdpStatsConverter;
}());
var AdpControlInConverter = /** @class */ (function () {
    function AdpControlInConverter() {
    }
    AdpControlInConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeAdpControlIn(model);
        return stream.toBytes;
    };
    AdpControlInConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readAdpControlIn();
    };
    return AdpControlInConverter;
}());
var AdpControlOutConverter = /** @class */ (function () {
    function AdpControlOutConverter() {
    }
    AdpControlOutConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeAdpControlOut(model);
        return stream.toBytes;
    };
    AdpControlOutConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readAdpControlOut();
    };
    return AdpControlOutConverter;
}());

/**
 *   Generated file. Do not edit
 */
var tapnpassProtocolConfiguration = new TapnpassProtocolConfigurationConverter();
var adpStats = new AdpStatsConverter();
var adpControlIn = new AdpControlInConverter();
var adpControlOut = new AdpControlOutConverter();

var serviceConverters = /*#__PURE__*/Object.freeze({
    __proto__: null,
    tapnpassProtocolConfiguration: tapnpassProtocolConfiguration,
    adpStats: adpStats,
    adpControlIn: adpControlIn,
    adpControlOut: adpControlOut
});

var PROTOCOL_CONF_CTR_LENGHT = 8;
var ReversedTapnpassProtocolConfigurationConverter = /** @class */ (function () {
    function ReversedTapnpassProtocolConfigurationConverter() {
        this.converter = new TapnpassProtocolConfigurationConverter();
    }
    ReversedTapnpassProtocolConfigurationConverter.prototype.decode = function (data) {
        return this.converter.decode(this._reorderBytes(data));
    };
    ReversedTapnpassProtocolConfigurationConverter.prototype.encode = function (settings) {
        return this._reorderBytes(this.converter.encode(settings));
    };
    ReversedTapnpassProtocolConfigurationConverter.prototype._reorderBytes = function (data) {
        return KaitaiStreamWriter.mergeArrays(data.slice(0, PROTOCOL_CONF_CTR_LENGHT).reverse(), data.slice(PROTOCOL_CONF_CTR_LENGHT));
    };
    return ReversedTapnpassProtocolConfigurationConverter;
}());

var reversedTapnpassProtocolConfiguration = new ReversedTapnpassProtocolConfigurationConverter();

var customConverters = /*#__PURE__*/Object.freeze({
    __proto__: null,
    reversedTapnpassProtocolConfiguration: reversedTapnpassProtocolConfiguration
});

/**
 *   Generated file. Do not edit
 */
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var allConverters = __assign(__assign(__assign({}, converters), serviceConverters), customConverters);
var SERVICE_CALLS = {
    getProtocolConfiguration: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/tapnpass/protocol-configuration",
        path: "/1027//21",
        responseBodyDecoder: allConverters.reversedTapnpassProtocolConfiguration
    },
    setProtocolConfiguration: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/tapnpass/protocol-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.reversedTapnpassProtocolConfiguration
    },
    putProtocolConfiguration: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/tapnpass/protocol-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.reversedTapnpassProtocolConfiguration
    },
    getStatus: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/tapnpass/status",
        path: "/1027//36",
        responseBodyDecoder: allConverters.adpStats
    },
    postAction: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/tapnpass/action",
        path: "/1027//39"
    },
    getControlIn: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/tapnpass/control-in",
        path: "/1027//41",
        responseBodyDecoder: allConverters.adpControlIn
    },
    setControlIn: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/tapnpass/control-in",
        path: "/1027//41",
        bodyEncoder: allConverters.adpControlIn
    },
    getControlOut: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/tapnpass/control-out",
        path: "/1027//42",
        responseBodyDecoder: allConverters.adpControlOut
    },
    setAdpControlOut: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/tapnpass/control-out",
        path: "/1027//42",
        responseBodyDecoder: allConverters.adpControlOut,
        bodyEncoder: allConverters.adpControlOut
    }
};

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 (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign$1 = (this && this.__assign) || function () {
    __assign$1 = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign$1.apply(this, arguments);
};
var TapnpassService = /** @class */ (function (_super) {
    __extends(TapnpassService, _super);
    function TapnpassService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get protocol configuration options
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return
     */
    TapnpassService.prototype.getProtocolConfiguration = function () {
        return this.serviceCallRunner.execute(this.getProtocolConfigurationCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return call options
     */
    TapnpassService.prototype.getProtocolConfigurationCall = function () {
        var callOptions = __assign$1({}, this.resources.getProtocolConfiguration);
        return callOptions;
    };
    /**
     * Temporary update configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TapnpassService.prototype.setProtocolConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.setProtocolConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TapnpassService.prototype.setProtocolConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.setProtocolConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Update protocol configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TapnpassService.prototype.putProtocolConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putProtocolConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TapnpassService.prototype.putProtocolConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putProtocolConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Read target status
     *
     * LWM2M path: /1027//36
     *
     * @tapVersion(">=")
     * @return
     */
    TapnpassService.prototype.getStatus = function () {
        return this.serviceCallRunner.execute(this.getStatusCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//36
     *
     * @tapVersion(">=")
     * @return call options
     */
    TapnpassService.prototype.getStatusCall = function () {
        var callOptions = __assign$1({}, this.resources.getStatus);
        return callOptions;
    };
    /**
     * Perform actions to ADP target.
     *
     * LWM2M path: /1027//39
     *
     * @deprecated
     * @tapVersion(">=")
     * @param data input
     * @return
     */
    TapnpassService.prototype.postAction = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.postActionCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//39
     *
     * @deprecated
     * @tapVersion(">=")
     * @param data input
     * @return call options
     */
    TapnpassService.prototype.postActionCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.postAction);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Get TAPNPass ADPCtrl1 Reg"
     *
     * LWM2M path: /1027//41
     *
     * @tapVersion(">=1.51")
     * @return
     */
    TapnpassService.prototype.getControlIn = function () {
        return this.serviceCallRunner.execute(this.getControlInCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//41
     *
     * @tapVersion(">=1.51")
     * @return call options
     */
    TapnpassService.prototype.getControlInCall = function () {
        var callOptions = __assign$1({}, this.resources.getControlIn);
        return callOptions;
    };
    /**
     * Direct access to TAPNPass ADPCtrl1 Reg
     *
     * LWM2M path: /1027//41
     *
     * @tapVersion(">=1.51")
     * @param data input
     * @return
     */
    TapnpassService.prototype.setControlIn = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.setControlInCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//41
     *
     * @tapVersion(">=1.51")
     * @param data input
     * @return call options
     */
    TapnpassService.prototype.setControlInCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.setControlIn);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Direct access to TAPNPass ADPCtrl2 Reg
     *
     * LWM2M path: /1027//42
     *
     * @tapVersion(">=1.51")
     * @return
     */
    TapnpassService.prototype.getControlOut = function () {
        return this.serviceCallRunner.execute(this.getControlOutCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//42
     *
     * @tapVersion(">=1.51")
     * @return call options
     */
    TapnpassService.prototype.getControlOutCall = function () {
        var callOptions = __assign$1({}, this.resources.getControlOut);
        return callOptions;
    };
    /**
     * Direct access to TAPNPass ADPCtrl2 Reg
     *
     * LWM2M path: /1027//42
     *
     * @tapVersion(">=1.51")
     * @param data input
     * @return
     */
    TapnpassService.prototype.setAdpControlOut = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.setAdpControlOutCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//42
     *
     * @tapVersion(">=1.51")
     * @param data input
     * @return call options
     */
    TapnpassService.prototype.setAdpControlOutCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.setAdpControlOut);
        callOptions.body = data;
        return callOptions;
    };
    return TapnpassService;
}(AbstractService));

var _TAP_SERVICE_EXTENSION_TAPNPASS_ = extendServiceContainer("tapnpass", TapnpassService);

/**
 * Generated bundle index. Do not edit.
 */

export { AdpControlIn, AdpControlInConverter, AdpControlOut, AdpControlOutConverter, AdpStatsConverter, ReversedTapnpassProtocolConfigurationConverter, SERVICE_CALLS as TAPNPASS_SERVICE_CALLS, TapnpassProtocolConfigurationConverter, TapnpassService, _TAP_SERVICE_EXTENSION_TAPNPASS_, reversedTapnpassProtocolConfiguration, serviceConverters as tapnpassConverters };
//# sourceMappingURL=iotize-tap-service-impl-tapnpass.js.map
