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 MqttService = /** @class */ (function (_super) {
    __extends(MqttService, _super);
    function MqttService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get mqtt relay client id.. For firmware version <= 1.86, use serial number (resource /3//2)
     *
     * LWM2M path: /1024//52
     *
     * @tapVersion(">=1.86")
     * @return
     */
    MqttService.prototype.getClientId = function () {
        return this.serviceCallRunner.execute(this.getClientIdCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//52
     *
     * @tapVersion(">=1.86")
     * @return call options
     */
    MqttService.prototype.getClientIdCall = function () {
        var callOptions = __assign({}, this.resources.getClientId);
        return callOptions;
    };
    /**
     * Write mqtt relay client id. For firmware version <= 1.86, use serial number (resource /3//2)
     *
     * LWM2M path: /1024//52
     *
     * @tapVersion(">=1.86")
     * @param url input
     * @return
     */
    MqttService.prototype.putClientId = function (
    /*
     *
     */
    url) {
        return this.serviceCallRunner.execute(this.putClientIdCall(url));
    };
    /**
     *
     *
     * LWM2M path: /1024//52
     *
     * @tapVersion(">=1.86")
     * @param url input
     * @return call options
     */
    MqttService.prototype.putClientIdCall = function (
    /*
     *
     */
    url) {
        var callOptions = __assign({}, this.resources.putClientId);
        callOptions.body = url;
        return callOptions;
    };
    /**
     * Get mqtt relay login. For firmware version <= 1.86, use serial number (resource /3//2)
     *
     * LWM2M path: /1024//53
     *
     * @deprecated
     * @tapVersion(">=1.86")
     * @return
     */
    MqttService.prototype.getUsername = function () {
        return this.serviceCallRunner.execute(this.getUsernameCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//53
     *
     * @deprecated
     * @tapVersion(">=1.86")
     * @return call options
     */
    MqttService.prototype.getUsernameCall = function () {
        var callOptions = __assign({}, this.resources.getUsername);
        return callOptions;
    };
    /**
     * Write mqtt relay password id. For firmware version <= 1.86, use serial number (resource /3//2)
     *
     * LWM2M path: /1024//53
     *
     * @tapVersion(">=1.86")
     * @param url input
     * @return
     */
    MqttService.prototype.putUsername = function (
    /*
     *
     */
    url) {
        return this.serviceCallRunner.execute(this.putUsernameCall(url));
    };
    /**
     *
     *
     * LWM2M path: /1024//53
     *
     * @tapVersion(">=1.86")
     * @param url input
     * @return call options
     */
    MqttService.prototype.putUsernameCall = function (
    /*
     *
     */
    url) {
        var callOptions = __assign({}, this.resources.putUsername);
        callOptions.body = url;
        return callOptions;
    };
    /**
     * Get mqtt broker hostname
     *
     * LWM2M path: /1024//50
     *
     * @tapVersion(">=")
     * @return
     */
    MqttService.prototype.getBrokerHostname = function () {
        return this.serviceCallRunner.execute(this.getBrokerHostnameCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//50
     *
     * @tapVersion(">=")
     * @return call options
     */
    MqttService.prototype.getBrokerHostnameCall = function () {
        var callOptions = __assign({}, this.resources.getBrokerHostname);
        return callOptions;
    };
    /**
     * Write mqtt relay host
     *
     * LWM2M path: /1024//50
     *
     * @tapVersion(">=")
     * @param url input
     * @return
     */
    MqttService.prototype.putBrokerHostname = function (
    /*
     *
     */
    url) {
        return this.serviceCallRunner.execute(this.putBrokerHostnameCall(url));
    };
    /**
     *
     *
     * LWM2M path: /1024//50
     *
     * @tapVersion(">=")
     * @param url input
     * @return call options
     */
    MqttService.prototype.putBrokerHostnameCall = function (
    /*
     *
     */
    url) {
        var callOptions = __assign({}, this.resources.putBrokerHostname);
        callOptions.body = url;
        return callOptions;
    };
    /**
     * Get port of the mqtt broker
     *
     * LWM2M path: /1024//51
     *
     * @tapVersion(">=")
     * @return
     */
    MqttService.prototype.getBrokerPort = function () {
        return this.serviceCallRunner.execute(this.getBrokerPortCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//51
     *
     * @tapVersion(">=")
     * @return call options
     */
    MqttService.prototype.getBrokerPortCall = function () {
        var callOptions = __assign({}, this.resources.getBrokerPort);
        return callOptions;
    };
    /**
     * Write service name of the mqtt broker
     *
     * LWM2M path: /1024//51
     *
     * @tapVersion(">=")
     * @param url input
     * @return
     */
    MqttService.prototype.putBrokerPort = function (
    /*
     *
     */
    url) {
        return this.serviceCallRunner.execute(this.putBrokerPortCall(url));
    };
    /**
     *
     *
     * LWM2M path: /1024//51
     *
     * @tapVersion(">=")
     * @param url input
     * @return call options
     */
    MqttService.prototype.putBrokerPortCall = function (
    /*
     *
     */
    url) {
        var callOptions = __assign({}, this.resources.putBrokerPort);
        callOptions.body = url;
        return callOptions;
    };
    /**
     * Get the mqtt broker password
     *
     * LWM2M path: /1024//54
     *
     * @tapVersion(">=")
     * @return
     */
    MqttService.prototype.getPassword = function () {
        return this.serviceCallRunner.execute(this.getPasswordCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//54
     *
     * @tapVersion(">=")
     * @return call options
     */
    MqttService.prototype.getPasswordCall = function () {
        var callOptions = __assign({}, this.resources.getPassword);
        return callOptions;
    };
    /**
     * Write mqtt broker password
     *
     * LWM2M path: /1024//54
     *
     * @tapVersion(">=")
     * @param url input
     * @return
     */
    MqttService.prototype.putPassword = function (
    /*
     *
     */
    url) {
        return this.serviceCallRunner.execute(this.putPasswordCall(url));
    };
    /**
     *
     *
     * LWM2M path: /1024//54
     *
     * @tapVersion(">=")
     * @param url input
     * @return call options
     */
    MqttService.prototype.putPasswordCall = function (
    /*
     *
     */
    url) {
        var callOptions = __assign({}, this.resources.putPassword);
        callOptions.body = url;
        return callOptions;
    };
    /**
     * Get the mqtt relay net key for the server
     *
     * LWM2M path: /1024//55
     *
     * @tapVersion(">=")
     * @return
     */
    MqttService.prototype.getRelayNetKey = function () {
        return this.serviceCallRunner.execute(this.getRelayNetKeyCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//55
     *
     * @tapVersion(">=")
     * @return call options
     */
    MqttService.prototype.getRelayNetKeyCall = function () {
        var callOptions = __assign({}, this.resources.getRelayNetKey);
        return callOptions;
    };
    /**
     * Write mqtt relay net key
     *
     * LWM2M path: /1024//55
     *
     * @tapVersion(">=")
     * @param netkey input
     * @return
     */
    MqttService.prototype.putRelayNetKey = function (
    /*
     *
     */
    netkey) {
        return this.serviceCallRunner.execute(this.putRelayNetKeyCall(netkey));
    };
    /**
     *
     *
     * LWM2M path: /1024//55
     *
     * @tapVersion(">=")
     * @param netkey input
     * @return call options
     */
    MqttService.prototype.putRelayNetKeyCall = function (
    /*
     *
     */
    netkey) {
        var callOptions = __assign({}, this.resources.putRelayNetKey);
        callOptions.body = netkey;
        return callOptions;
    };
    /**
     * MQTT broker certificate data in PEM format for SSL mutual authentication, default is NULL
     *
     * LWM2M path: /1024//57
     *
     * @tapVersion(">=1.86")
     * @param value input
     * @return
     */
    MqttService.prototype.putBrokerCertificate = function (
    /*
     * Up to 16kB
     */
    value) {
        return this.serviceCallRunner.execute(this.putBrokerCertificateCall(value));
    };
    MqttService.prototype.putBrokerCertificateAppendCalls = function (
    /*
     * Up to 16kB
     */
    value, chunkSize) {
        return this.serviceCallRunner.createAppendCalls(this.putBrokerCertificateCall(value), chunkSize);
    };
    /**
     *
     *
     * LWM2M path: /1024//57
     *
     * @tapVersion(">=1.86")
     * @param value input
     * @return call options
     */
    MqttService.prototype.putBrokerCertificateCall = function (
    /*
     * Up to 16kB
     */
    value) {
        var callOptions = __assign({}, this.resources.putBrokerCertificate);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get MQTT relay topic prefix
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @return
     */
    MqttService.prototype.getTopicPrefix = function () {
        return this.serviceCallRunner.execute(this.getTopicPrefixCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @return call options
     */
    MqttService.prototype.getTopicPrefixCall = function () {
        var callOptions = __assign({}, this.resources.getTopicPrefix);
        return callOptions;
    };
    /**
     * Put MQTT relay topic prefix
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @param topicPrefix input
     * @return
     */
    MqttService.prototype.putTopicPrefix = function (
    /*
     *
     */
    topicPrefix) {
        return this.serviceCallRunner.execute(this.putTopicPrefixCall(topicPrefix));
    };
    /**
     *
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @param topicPrefix input
     * @return call options
     */
    MqttService.prototype.putTopicPrefixCall = function (
    /*
     *
     */
    topicPrefix) {
        var callOptions = __assign({}, this.resources.putTopicPrefix);
        callOptions.body = topicPrefix;
        return callOptions;
    };
    /**
     * Get mqtt request topic
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @return
     */
    MqttService.prototype.getRequestTopic = function () {
        return this.serviceCallRunner.execute(this.getRequestTopicCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @return call options
     */
    MqttService.prototype.getRequestTopicCall = function () {
        var callOptions = __assign({}, this.resources.getRequestTopic);
        return callOptions;
    };
    /**
     * Put mqtt request topic
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @param topic input
     * @return
     */
    MqttService.prototype.putRequestTopic = function (
    /*
     *
     */
    topic) {
        return this.serviceCallRunner.execute(this.putRequestTopicCall(topic));
    };
    /**
     *
     *
     * LWM2M path: /1024//58
     *
     * @tapVersion(">=1.86")
     * @param topic input
     * @return call options
     */
    MqttService.prototype.putRequestTopicCall = function (
    /*
     *
     */
    topic) {
        var callOptions = __assign({}, this.resources.putRequestTopic);
        callOptions.body = topic;
        return callOptions;
    };
    /**
     * Get MQTT response topic
     *
     * LWM2M path: /1024//59
     *
     * @tapVersion(">=1.107")
     * @return
     */
    MqttService.prototype.getResponseTopic = function () {
        return this.serviceCallRunner.execute(this.getResponseTopicCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//59
     *
     * @tapVersion(">=1.107")
     * @return call options
     */
    MqttService.prototype.getResponseTopicCall = function () {
        var callOptions = __assign({}, this.resources.getResponseTopic);
        return callOptions;
    };
    /**
     * Put MQTT response topic
     *
     * LWM2M path: /1024//59
     *
     * @tapVersion(">=1.107")
     * @param topic input
     * @return
     */
    MqttService.prototype.putResponseTopic = function (
    /*
     *
     */
    topic) {
        return this.serviceCallRunner.execute(this.putResponseTopicCall(topic));
    };
    /**
     *
     *
     * LWM2M path: /1024//59
     *
     * @tapVersion(">=1.107")
     * @param topic input
     * @return call options
     */
    MqttService.prototype.putResponseTopicCall = function (
    /*
     *
     */
    topic) {
        var callOptions = __assign({}, this.resources.putResponseTopic);
        callOptions.body = topic;
        return callOptions;
    };
    return MqttService;
}(AbstractService));
export { MqttService };
//# sourceMappingURL=data:application/json;base64, 