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 = (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);
};
import { SERVICE_CALLS } from "./service-calls";
import { AbstractService } from "@iotize/tap";
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({}, 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({}, 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({}, 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({}, this.resources.putProfileId);
        callOptions.body = key;
        return callOptions;
    };
    return JvmService;
}(AbstractService));
export { JvmService };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0Bpb3RpemUvdGFwL3NlcnZpY2UvaW1wbC9qdm0vIiwic291cmNlcyI6WyJsaWIvZ2VuZXJhdGVkL3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBSUEsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRWhELE9BQU8sRUFBRSxlQUFlLEVBQW1CLE1BQU0sYUFBYSxDQUFDO0FBRS9EO0lBQWdDLDhCQUFlO0lBQS9DO1FBQU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