import { AbstractService, extendServiceContainer } from '@iotize/tap';
import { TapRequestFrame } from '@iotize/tap/client/api';
import { createEnumConverter, createEnumArrayConverter, converters } from '@iotize/tap/service/core';

/* 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 CloudPlatform;
(function (CloudPlatform) {
    CloudPlatform[CloudPlatform["NO_PLATFORM"] = 0] = "NO_PLATFORM";
    CloudPlatform[CloudPlatform["IOTIZE"] = 1] = "IOTIZE";
    CloudPlatform[CloudPlatform["IBM_BLUEMIX"] = 2] = "IBM_BLUEMIX";
    CloudPlatform[CloudPlatform["AMAZON_AWS"] = 3] = "AMAZON_AWS";
    CloudPlatform[CloudPlatform["CUSTOM"] = 4] = "CUSTOM";
})(CloudPlatform || (CloudPlatform = {}));

/**
 *   Generated file. Do not edit
 */
var cloudPlatform = createEnumConverter(CloudPlatform, 1);
var cloudPlatformArray = createEnumArrayConverter(CloudPlatform, 1);

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

/**
 *   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({}, converters), serviceConverters);
var SERVICE_CALLS = {
    getPlatform: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/platform",
        path: "/1024//26",
        responseBodyDecoder: allConverters.cloudPlatform
    },
    putPlatform: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/platform",
        path: "/1024//26",
        bodyEncoder: allConverters.cloudPlatform
    },
    getDataLogUploadPeriod: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/data-log/upload-period",
        path: "/1024//33",
        responseBodyDecoder: allConverters.uint32
    },
    putDataLogUploadPeriod: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/data-log/upload-period",
        path: "/1024//33",
        bodyEncoder: allConverters.uint32
    },
    getMqttBrokerPort: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/mqtt/broker-port",
        path: "/1024//61",
        responseBodyDecoder: allConverters.ascii
    },
    putMqttBrokerPort: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/mqtt/broker-port",
        path: "/1024//61",
        bodyEncoder: allConverters.ascii
    },
    getMqttClientId: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/mqtt/client-id",
        path: "/1024//27",
        responseBodyDecoder: allConverters.ascii
    },
    putMqttClientId: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/mqtt/client-id",
        path: "/1024//27",
        bodyEncoder: allConverters.ascii
    },
    getMqttUsername: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/mqtt/username",
        path: "/1024//28",
        responseBodyDecoder: allConverters.ascii
    },
    putMqttUsername: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/mqtt/username",
        path: "/1024//28",
        bodyEncoder: allConverters.ascii
    },
    getMqttPassword: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/mqtt/password",
        path: "/1024//29",
        responseBodyDecoder: allConverters.ascii
    },
    putMqttPassword: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/mqtt/password",
        path: "/1024//29",
        bodyEncoder: allConverters.ascii
    },
    getDataLogPublishTopic: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/data-log/publish-topic",
        path: "/1024//68",
        responseBodyDecoder: allConverters.ascii
    },
    putDataLogPublishTopic: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/data-log/publish-topic",
        path: "/1024//68",
        bodyEncoder: allConverters.ascii
    },
    getDataLogSubscribeTopic: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/cloud/data-log/subscribe-topic",
        path: "/1024//69",
        responseBodyDecoder: allConverters.ascii
    },
    putDataLogSubscribeTopic: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/cloud/data-log/subscribe-topic",
        path: "/1024//69",
        bodyEncoder: allConverters.ascii
    }
};

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 CloudService = /** @class */ (function (_super) {
    __extends(CloudService, _super);
    function CloudService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get cloud connection mode
     *
     * LWM2M path: /1024//26
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getPlatform = function () {
        return this.serviceCallRunner.execute(this.getPlatformCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//26
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getPlatformCall = function () {
        var callOptions = __assign$1({}, this.resources.getPlatform);
        return callOptions;
    };
    /**
     * Write cloud connection mode
     *
     * LWM2M path: /1024//26
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putPlatform = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putPlatformCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//26
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putPlatformCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putPlatform);
        callOptions.body = key;
        return callOptions;
    };
    /**
     * Uploading period for the cloud
     *
     * LWM2M path: /1024//33
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getDataLogUploadPeriod = function () {
        return this.serviceCallRunner.execute(this.getDataLogUploadPeriodCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//33
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getDataLogUploadPeriodCall = function () {
        var callOptions = __assign$1({}, this.resources.getDataLogUploadPeriod);
        return callOptions;
    };
    /**
     * Write cloud mqtt period
     *
     * LWM2M path: /1024//33
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putDataLogUploadPeriod = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putDataLogUploadPeriodCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//33
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putDataLogUploadPeriodCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putDataLogUploadPeriod);
        callOptions.body = key;
        return callOptions;
    };
    /**
     * Get the cloud MQTT broker port
     *
     * LWM2M path: /1024//61
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getMqttBrokerPort = function () {
        return this.serviceCallRunner.execute(this.getMqttBrokerPortCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//61
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getMqttBrokerPortCall = function () {
        var callOptions = __assign$1({}, this.resources.getMqttBrokerPort);
        return callOptions;
    };
    /**
     * Write cloud MQTT broker port
     *
     * LWM2M path: /1024//61
     *
     * @tapVersion(">=")
     * @param name input
     * @return
     */
    CloudService.prototype.putMqttBrokerPort = function (
    /*
     *
     */
    name) {
        return this.serviceCallRunner.execute(this.putMqttBrokerPortCall(name));
    };
    /**
     *
     *
     * LWM2M path: /1024//61
     *
     * @tapVersion(">=")
     * @param name input
     * @return call options
     */
    CloudService.prototype.putMqttBrokerPortCall = function (
    /*
     *
     */
    name) {
        var callOptions = __assign$1({}, this.resources.putMqttBrokerPort);
        callOptions.body = name;
        return callOptions;
    };
    /**
     * Get cloud MQTT client id
     *
     * LWM2M path: /1024//27
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getMqttClientId = function () {
        return this.serviceCallRunner.execute(this.getMqttClientIdCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//27
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getMqttClientIdCall = function () {
        var callOptions = __assign$1({}, this.resources.getMqttClientId);
        return callOptions;
    };
    /**
     * Write cloud MQTT client id
     *
     * LWM2M path: /1024//27
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    CloudService.prototype.putMqttClientId = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putMqttClientIdCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1024//27
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    CloudService.prototype.putMqttClientIdCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putMqttClientId);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get cloud MQTT login id
     *
     * LWM2M path: /1024//28
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getMqttUsername = function () {
        return this.serviceCallRunner.execute(this.getMqttUsernameCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//28
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getMqttUsernameCall = function () {
        var callOptions = __assign$1({}, this.resources.getMqttUsername);
        return callOptions;
    };
    /**
     * Write cloud MQTT login id
     *
     * LWM2M path: /1024//28
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putMqttUsername = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putMqttUsernameCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//28
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putMqttUsernameCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putMqttUsername);
        callOptions.body = key;
        return callOptions;
    };
    /**
     * Get cloud MQTT user password
     *
     * LWM2M path: /1024//29
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getMqttPassword = function () {
        return this.serviceCallRunner.execute(this.getMqttPasswordCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//29
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getMqttPasswordCall = function () {
        var callOptions = __assign$1({}, this.resources.getMqttPassword);
        return callOptions;
    };
    /**
     * Write cloud MQTT user password
     *
     * LWM2M path: /1024//29
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putMqttPassword = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putMqttPasswordCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//29
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putMqttPasswordCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putMqttPassword);
        callOptions.body = key;
        return callOptions;
    };
    /**
     * Get cloud data log public topic
     *
     * LWM2M path: /1024//68
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getDataLogPublishTopic = function () {
        return this.serviceCallRunner.execute(this.getDataLogPublishTopicCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//68
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getDataLogPublishTopicCall = function () {
        var callOptions = __assign$1({}, this.resources.getDataLogPublishTopic);
        return callOptions;
    };
    /**
     * Write cloud data log publish topic
     *
     * LWM2M path: /1024//68
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putDataLogPublishTopic = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putDataLogPublishTopicCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//68
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putDataLogPublishTopicCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putDataLogPublishTopic);
        callOptions.body = key;
        return callOptions;
    };
    /**
     * Get cloud data log subscribe topic
     *
     * LWM2M path: /1024//69
     *
     * @tapVersion(">=")
     * @return
     */
    CloudService.prototype.getDataLogSubscribeTopic = function () {
        return this.serviceCallRunner.execute(this.getDataLogSubscribeTopicCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//69
     *
     * @tapVersion(">=")
     * @return call options
     */
    CloudService.prototype.getDataLogSubscribeTopicCall = function () {
        var callOptions = __assign$1({}, this.resources.getDataLogSubscribeTopic);
        return callOptions;
    };
    /**
     * Write cloud data log subscribe topic
     *
     * LWM2M path: /1024//69
     *
     * @tapVersion(">=")
     * @param key input
     * @return
     */
    CloudService.prototype.putDataLogSubscribeTopic = function (
    /*
     *
     */
    key) {
        return this.serviceCallRunner.execute(this.putDataLogSubscribeTopicCall(key));
    };
    /**
     *
     *
     * LWM2M path: /1024//69
     *
     * @tapVersion(">=")
     * @param key input
     * @return call options
     */
    CloudService.prototype.putDataLogSubscribeTopicCall = function (
    /*
     *
     */
    key) {
        var callOptions = __assign$1({}, this.resources.putDataLogSubscribeTopic);
        callOptions.body = key;
        return callOptions;
    };
    return CloudService;
}(AbstractService));

var _TAP_SERVICE_EXTENSION_CLOUD_ = extendServiceContainer("cloud", CloudService);

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

export { SERVICE_CALLS as CLOUD_SERVICE_CALLS, CloudPlatform, CloudService, _TAP_SERVICE_EXTENSION_CLOUD_, serviceConverters as cloudConverters };
//# sourceMappingURL=iotize-tap-service-impl-cloud.js.map
