(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/device', ['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.device = {}), global.iotize.tap, global.iotize.tap.client.api, global.iotize.tap.service.core));
}(this, (function (exports, tap, api, core) { 'use strict';

    /* 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.
     */

    (function (AvailablePowerSource) {
        AvailablePowerSource[AvailablePowerSource["DC_POWER"] = 1] = "DC_POWER";
        AvailablePowerSource[AvailablePowerSource["S3P"] = 16] = "S3P";
        AvailablePowerSource[AvailablePowerSource["AC_EXTERNAL_POWER"] = 32] = "AC_EXTERNAL_POWER";
    })(exports.AvailablePowerSource || (exports.AvailablePowerSource = {}));

    /**
     *   Generated file. Do not edit
     */
    var availablePowerSource = core.createEnumConverter(exports.AvailablePowerSource, 1);
    var availablePowerSourceArray = core.createEnumArrayConverter(exports.AvailablePowerSource, 1);

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

    /**
     *   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 = {
        getManufacturer: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/manufacturer",
            path: "/3//0",
            responseBodyDecoder: allConverters.ascii
        },
        getFirmwareFlavor: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/firmware-flavor",
            path: "/3//1",
            responseBodyDecoder: allConverters.ascii
        },
        getSerialNumber: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/serial-number",
            path: "/3//2",
            responseBodyDecoder: allConverters.ascii
        },
        getFirmwareVersion: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/firmware-version",
            path: "/3//3",
            responseBodyDecoder: allConverters.ascii
        },
        reboot: {
            method: api.TapRequestFrame.MethodType.POST,
            pathAlias: "/device/reboot",
            path: "/3//4"
        },
        factoryReset: {
            method: api.TapRequestFrame.MethodType.POST,
            pathAlias: "/device/factory-reset",
            path: "/3//5"
        },
        getAvailablePowerSource: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/available-power-source",
            path: "/3//6",
            responseBodyDecoder: allConverters.availablePowerSource
        },
        getPowerSourceVoltage: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/power-source-voltage",
            path: "/3//7",
            responseBodyDecoder: allConverters.uint32
        },
        getMemoryFree: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/memory-free",
            path: "/3//10",
            responseBodyDecoder: allConverters.uint32
        },
        getLastErrorCode: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/last-error-code",
            path: "/3//11",
            responseBodyDecoder: allConverters.uint32
        },
        postLastErrorCode: {
            method: api.TapRequestFrame.MethodType.POST,
            pathAlias: "/device/last-error-code",
            path: "/3//11"
        },
        resetLastErrorCode: {
            method: api.TapRequestFrame.MethodType.POST,
            pathAlias: "/device/reset-last-error-code",
            path: "/3//12"
        },
        getCurrentTime: {
            method: api.TapRequestFrame.MethodType.GET,
            pathAlias: "/device/current-time",
            path: "/3//13",
            responseBodyDecoder: allConverters.ascii
        },
        putCurrentTime: {
            method: api.TapRequestFrame.MethodType.PUT,
            pathAlias: "/device/current-time",
            path: "/3//13",
            bodyEncoder: allConverters.uint32
        }
    };

    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 DeviceService = /** @class */ (function (_super) {
        __extends(DeviceService, _super);
        function DeviceService() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.resources = SERVICE_CALLS;
            return _this;
        }
        /**
         * Get manufacturer name
         *
         * LWM2M path: /3//0
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getManufacturer = function () {
            return this.serviceCallRunner.execute(this.getManufacturerCall());
        };
        /**
         *
         *
         * LWM2M path: /3//0
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getManufacturerCall = function () {
            var callOptions = __assign$1({}, this.resources.getManufacturer);
            return callOptions;
        };
        /**
         * Get device firmware flavor name
         *
         * LWM2M path: /3//1
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getFirmwareFlavor = function () {
            return this.serviceCallRunner.execute(this.getFirmwareFlavorCall());
        };
        /**
         *
         *
         * LWM2M path: /3//1
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getFirmwareFlavorCall = function () {
            var callOptions = __assign$1({}, this.resources.getFirmwareFlavor);
            return callOptions;
        };
        /**
         * Get device serial number
         *
         * LWM2M path: /3//2
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getSerialNumber = function () {
            return this.serviceCallRunner.execute(this.getSerialNumberCall());
        };
        /**
         *
         *
         * LWM2M path: /3//2
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getSerialNumberCall = function () {
            var callOptions = __assign$1({}, this.resources.getSerialNumber);
            return callOptions;
        };
        /**
         * Get device firmware version
         *
         * LWM2M path: /3//3
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getFirmwareVersion = function () {
            return this.serviceCallRunner.execute(this.getFirmwareVersionCall());
        };
        /**
         *
         *
         * LWM2M path: /3//3
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getFirmwareVersionCall = function () {
            var callOptions = __assign$1({}, this.resources.getFirmwareVersion);
            return callOptions;
        };
        /**
         * Reboot device
         *
         * LWM2M path: /3//4
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.reboot = function () {
            return this.serviceCallRunner.execute(this.rebootCall());
        };
        /**
         *
         *
         * LWM2M path: /3//4
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.rebootCall = function () {
            var callOptions = __assign$1({}, this.resources.reboot);
            return callOptions;
        };
        /**
         * Factory reset
         *
         * LWM2M path: /3//5
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.factoryReset = function () {
            return this.serviceCallRunner.execute(this.factoryResetCall());
        };
        /**
         *
         *
         * LWM2M path: /3//5
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.factoryResetCall = function () {
            var callOptions = __assign$1({}, this.resources.factoryReset);
            return callOptions;
        };
        /**
         * Get available power sources
         *
         * LWM2M path: /3//6
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getAvailablePowerSource = function () {
            return this.serviceCallRunner.execute(this.getAvailablePowerSourceCall());
        };
        /**
         *
         *
         * LWM2M path: /3//6
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getAvailablePowerSourceCall = function () {
            var callOptions = __assign$1({}, this.resources.getAvailablePowerSource);
            return callOptions;
        };
        /**
         * Get power source voltage
         *
         * LWM2M path: /3//7
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getPowerSourceVoltage = function () {
            return this.serviceCallRunner.execute(this.getPowerSourceVoltageCall());
        };
        /**
         *
         *
         * LWM2M path: /3//7
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getPowerSourceVoltageCall = function () {
            var callOptions = __assign$1({}, this.resources.getPowerSourceVoltage);
            return callOptions;
        };
        /**
         * Get device memory free
         *
         * LWM2M path: /3//10
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getMemoryFree = function () {
            return this.serviceCallRunner.execute(this.getMemoryFreeCall());
        };
        /**
         *
         *
         * LWM2M path: /3//10
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getMemoryFreeCall = function () {
            var callOptions = __assign$1({}, this.resources.getMemoryFree);
            return callOptions;
        };
        /**
         * Get device last error code
         *
         * LWM2M path: /3//11
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getLastErrorCode = function () {
            return this.serviceCallRunner.execute(this.getLastErrorCodeCall());
        };
        /**
         *
         *
         * LWM2M path: /3//11
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getLastErrorCodeCall = function () {
            var callOptions = __assign$1({}, this.resources.getLastErrorCode);
            return callOptions;
        };
        /**
         * ???
         *
         * LWM2M path: /3//11
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.postLastErrorCode = function () {
            return this.serviceCallRunner.execute(this.postLastErrorCodeCall());
        };
        /**
         *
         *
         * LWM2M path: /3//11
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.postLastErrorCodeCall = function () {
            var callOptions = __assign$1({}, this.resources.postLastErrorCode);
            return callOptions;
        };
        /**
         * Reset device last error code
         *
         * LWM2M path: /3//12
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.resetLastErrorCode = function () {
            return this.serviceCallRunner.execute(this.resetLastErrorCodeCall());
        };
        /**
         *
         *
         * LWM2M path: /3//12
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.resetLastErrorCodeCall = function () {
            var callOptions = __assign$1({}, this.resources.resetLastErrorCode);
            return callOptions;
        };
        /**
         * Get device current time
         *
         * LWM2M path: /3//13
         *
         * @tapVersion(">=")
         * @return
         */
        DeviceService.prototype.getCurrentTime = function () {
            return this.serviceCallRunner.execute(this.getCurrentTimeCall());
        };
        /**
         *
         *
         * LWM2M path: /3//13
         *
         * @tapVersion(">=")
         * @return call options
         */
        DeviceService.prototype.getCurrentTimeCall = function () {
            var callOptions = __assign$1({}, this.resources.getCurrentTime);
            return callOptions;
        };
        /**
         * Set device current time
         *
         * LWM2M path: /3//13
         *
         * @tapVersion(">=")
         * @param time input
         * @return
         */
        DeviceService.prototype.putCurrentTime = function (
        /*
         *
         */
        time) {
            return this.serviceCallRunner.execute(this.putCurrentTimeCall(time));
        };
        /**
         *
         *
         * LWM2M path: /3//13
         *
         * @tapVersion(">=")
         * @param time input
         * @return call options
         */
        DeviceService.prototype.putCurrentTimeCall = function (
        /*
         *
         */
        time) {
            var callOptions = __assign$1({}, this.resources.putCurrentTime);
            callOptions.body = time;
            return callOptions;
        };
        return DeviceService;
    }(tap.AbstractService));

    var _TAP_SERVICE_EXTENSION_DEVICE_ = tap.extendServiceContainer("device", DeviceService);

    exports.DEVICE_SERVICE_CALLS = SERVICE_CALLS;
    exports.DeviceService = DeviceService;
    exports._TAP_SERVICE_EXTENSION_DEVICE_ = _TAP_SERVICE_EXTENSION_DEVICE_;
    exports.deviceConverters = serviceConverters;

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

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