(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@iotize/tap'), require('@iotize/tap/client/api'), require('@iotize/tap/service/core')) :
    typeof define === 'function' && define.amd ? define('@iotize/tap/service/impl/jvm', ['exports', '@iotize/tap', '@iotize/tap/client/api', '@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.jvm = {}), global.iotize.tap, global.iotize.tap.client.api, global.iotize.tap.service.core));
}(this, (function (exports, tap, api, core) { 'use strict';

    // JvmService.prototype.clearCode = function (
    //     this: JvmService
    // ): Promise<TapResponse<void>> {
    //     return this.serviceCallRunner.execute(this.clearCodeCall());
    // };
    // JvmService.prototype.clearCodeCall = function (
    //     this: JvmService
    // ) {
    //     return {
    //         path: '/1024//74',
    //         pathAlias: '/jvm/code',
    //         method: TapRequestFrame.MethodType.PUT,
    //         body: Uint8Array.from([0])
    //     } as ServiceCallType<Uint8Array, void>;
    // };

    /**
     *   Generated file. Do not edit
     */

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

    /**
     *   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 = {
        clearCode: {
            method: api.TapRequestFrame.MethodType.POST,
            pathAlias: "/jvm/code",
            path: "/1024//74"
        },
        appendCode: {
            method: api.TapRequestFrame.MethodType.PUT,
            pathAlias: "/jvm/code",
            append: true,
            path: "/1024//74"
        },
        getProfileId: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/jvm/profile-id",
            path: "/1024//66",
            responseBodyDecoder: allConverters.uint16
        },
        putProfileId: {
            method: api.TapRequestFrame.MethodType.PUT,
            pathAlias: "/jvm/profile-id",
            path: "/1024//66",
            bodyEncoder: allConverters.uint16
        }
    };

    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 JvmService = /** @class */ (function (_super) {
        __extends(JvmService, _super);
        function JvmService() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.resources = SERVICE_CALLS;
            return _this;
        }
        /**
         * Clear code stored in Tap.
         *
         * LWM2M path: /1024//74
         *
         * @tapVersion(">=1.90")
         * @return
         */
        JvmService.prototype.clearCode = function () {
            return this.serviceCallRunner.execute(this.clearCodeCall());
        };
        /**
         *
         *
         * LWM2M path: /1024//74
         *
         * @tapVersion(">=1.90")
         * @return call options
         */
        JvmService.prototype.clearCodeCall = function () {
            var callOptions = __assign$1({}, this.resources.clearCode);
            return callOptions;
        };
        /**
         * Append JVM code. If body length is 0, it will clear code stored in Tap.
         *
         * LWM2M path: /1024//74
         *
         * @tapVersion(">=1.90")
         * @param value input
         * @return
         */
        JvmService.prototype.appendCode = function (
        /*
         *
         */
        value) {
            return this.serviceCallRunner.execute(this.appendCodeCall(value));
        };
        JvmService.prototype.appendCodeAppendCalls = function (
        /*
         *
         */
        value, chunkSize) {
            return this.serviceCallRunner.createAppendCalls(this.appendCodeCall(value), chunkSize);
        };
        /**
         *
         *
         * LWM2M path: /1024//74
         *
         * @tapVersion(">=1.90")
         * @param value input
         * @return call options
         */
        JvmService.prototype.appendCodeCall = function (
        /*
         *
         */
        value) {
            var callOptions = __assign$1({}, this.resources.appendCode);
            callOptions.body = value;
            return callOptions;
        };
        /**
         * Get user id that gives rights to the JVM code
         *
         * LWM2M path: /1024//66
         *
         * @tapVersion(">=")
         * @return
         */
        JvmService.prototype.getProfileId = function () {
            return this.serviceCallRunner.execute(this.getProfileIdCall());
        };
        /**
         *
         *
         * LWM2M path: /1024//66
         *
         * @tapVersion(">=")
         * @return call options
         */
        JvmService.prototype.getProfileIdCall = function () {
            var callOptions = __assign$1({}, this.resources.getProfileId);
            return callOptions;
        };
        /**
         * Write user id that gives right to the JVM code
         *
         * LWM2M path: /1024//66
         *
         * @tapVersion(">=")
         * @param key input
         * @return
         */
        JvmService.prototype.putProfileId = function (
        /*
         *
         */
        key) {
            return this.serviceCallRunner.execute(this.putProfileIdCall(key));
        };
        /**
         *
         *
         * LWM2M path: /1024//66
         *
         * @tapVersion(">=")
         * @param key input
         * @return call options
         */
        JvmService.prototype.putProfileIdCall = function (
        /*
         *
         */
        key) {
            var callOptions = __assign$1({}, this.resources.putProfileId);
            callOptions.body = key;
            return callOptions;
        };
        return JvmService;
    }(tap.AbstractService));

    var _TAP_SERVICE_EXTENSION_JVM_ = tap.extendServiceContainer("jvm", JvmService);

    exports.JVM_SERVICE_CALLS = SERVICE_CALLS;
    exports.JvmService = JvmService;
    exports._TAP_SERVICE_EXTENSION_JVM_ = _TAP_SERVICE_EXTENSION_JVM_;
    exports.jvmConverters = serviceConverters;

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

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