(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@iotize/tap'), require('@iotize/tap/client/api'), require('@iotize/tap/client/impl'), require('@iotize/tap/service/core')) :
    typeof define === 'function' && define.amd ? define('@iotize/tap/service/impl/lora', ['exports', '@iotize/tap', '@iotize/tap/client/api', '@iotize/tap/client/impl', '@iotize/tap/service/core'], factory) :
    (global = global || self, factory((global.iotize = global.iotize || {}, global.iotize.tap = global.iotize.tap || {}, global.iotize.tap.service = global.iotize.tap.service || {}, global.iotize.tap.service.impl = global.iotize.tap.service.impl || {}, global.iotize.tap.service.impl.lora = {}), global.iotize.tap, global.iotize.tap.client.api, global.iotize.tap.client.impl, global.iotize.tap.service.core));
}(this, (function (exports, tap, api, impl, core) { 'use strict';

    /**
     *   Generated file. Do not edit
     */
    impl.TapStreamReader.prototype.readLoraConfig = function () {
        var model = {};
        model.classA = this.readBoolean(1);
        model.classB = this.readBoolean(1);
        model.classC = this.readBoolean(1);
        model.dataLoggingEnabled = this.readBoolean(1);
        model.singlePacketEnabled = this.readBoolean(1);
        return model;
    };
    // TapStreamWriter.prototype.write(model: LoraConfig) : TapStreamWriter{
    //     return this.writeLoraConfig(model)
    // }
    impl.TapStreamWriter.prototype.writeLoraConfig = function (model) {
        this.writeBoolean(model.classA, 1);
        this.writeBoolean(model.classB, 1);
        this.writeBoolean(model.classC, 1);
        this.writeBoolean(model.dataLoggingEnabled, 1);
        this.writeBoolean(model.singlePacketEnabled, 1);
        return this;
    };

    /**
     *   Generated file. Do not edit
     */
    var LoraConfigConverter = /** @class */ (function () {
        function LoraConfigConverter() {
        }
        LoraConfigConverter.prototype.encode = function (model, stream) {
            if (stream === void 0) { stream = new impl.TapStreamWriter(); }
            stream.writeLoraConfig(model);
            return stream.toBytes;
        };
        LoraConfigConverter.prototype.decode = function (data) {
            var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
            return stream.readLoraConfig();
        };
        return LoraConfigConverter;
    }());

    /**
     *   Generated file. Do not edit
     */
    var loraConfig = new LoraConfigConverter();

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

    /**
     *   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({}, core.converters), serviceConverters);
    var SERVICE_CALLS = {
        getIds: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/lora/ids",
            path: "/1024//90"
        },
        putIds: {
            method: api.TapRequestFrame.MethodType.PUT,
            pathAlias: "/lora/ids",
            path: "/1024//90"
        },
        getConfig: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/lora/config",
            path: "/1024//91",
            responseBodyDecoder: allConverters.loraConfig
        },
        putConfig: {
            method: api.TapRequestFrame.MethodType.PUT,
            pathAlias: "/lora/config",
            path: "/1024//91",
            bodyEncoder: allConverters.loraConfig
        }
    };

    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 LoraService = /** @class */ (function (_super) {
        __extends(LoraService, _super);
        function LoraService() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.resources = SERVICE_CALLS;
            return _this;
        }
        /**
         * Get LoRa IDs
         *
         * LWM2M path: /1024//90
         *
         * @tapVersion(">=")
         * @return
         */
        LoraService.prototype.getIds = function () {
            return this.serviceCallRunner.execute(this.getIdsCall());
        };
        /**
         *
         *
         * LWM2M path: /1024//90
         *
         * @tapVersion(">=")
         * @return call options
         */
        LoraService.prototype.getIdsCall = function () {
            var callOptions = __assign$1({}, this.resources.getIds);
            return callOptions;
        };
        /**
         * Write LoRa IDs
         *
         * LWM2M path: /1024//90
         *
         * @tapVersion(">=")
         * @param value input
         * @return
         */
        LoraService.prototype.putIds = function (
        /*
         *
         */
        value) {
            return this.serviceCallRunner.execute(this.putIdsCall(value));
        };
        /**
         *
         *
         * LWM2M path: /1024//90
         *
         * @tapVersion(">=")
         * @param value input
         * @return call options
         */
        LoraService.prototype.putIdsCall = function (
        /*
         *
         */
        value) {
            var callOptions = __assign$1({}, this.resources.putIds);
            callOptions.body = value;
            return callOptions;
        };
        /**
         * Get LoRa configuration
         *
         * LWM2M path: /1024//91
         *
         * @tapVersion(">=")
         * @return
         */
        LoraService.prototype.getConfig = function () {
            return this.serviceCallRunner.execute(this.getConfigCall());
        };
        /**
         *
         *
         * LWM2M path: /1024//91
         *
         * @tapVersion(">=")
         * @return call options
         */
        LoraService.prototype.getConfigCall = function () {
            var callOptions = __assign$1({}, this.resources.getConfig);
            return callOptions;
        };
        /**
         * Write LoRa configuration
         *
         * LWM2M path: /1024//91
         *
         * @tapVersion(">=")
         * @param value input
         * @return
         */
        LoraService.prototype.putConfig = function (
        /*
         *
         */
        value) {
            return this.serviceCallRunner.execute(this.putConfigCall(value));
        };
        /**
         *
         *
         * LWM2M path: /1024//91
         *
         * @tapVersion(">=")
         * @param value input
         * @return call options
         */
        LoraService.prototype.putConfigCall = function (
        /*
         *
         */
        value) {
            var callOptions = __assign$1({}, this.resources.putConfig);
            callOptions.body = value;
            return callOptions;
        };
        return LoraService;
    }(tap.AbstractService));

    var _TAP_SERVICE_EXTENSION_LORA_ = tap.extendServiceContainer("lora", LoraService);

    exports.LORA_SERVICE_CALLS = SERVICE_CALLS;
    exports.LoraConfigConverter = LoraConfigConverter;
    exports.LoraService = LoraService;
    exports._TAP_SERVICE_EXTENSION_LORA_ = _TAP_SERVICE_EXTENSION_LORA_;
    exports.loraConverters = serviceConverters;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=iotize-tap-service-impl-lora.umd.js.map
