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

/**
 *   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({}, converters), serviceConverters);
var SERVICE_CALLS = {
    getName: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/group/{groupId}/name",
        path: "/1025/{groupId}/0",
        responseBodyDecoder: allConverters.ascii
    },
    putName: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/group/{groupId}/name",
        path: "/1025/{groupId}/0",
        bodyEncoder: allConverters.ascii
    },
    changePassword: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/group/{groupId}/password",
        path: "/1025/{groupId}/2",
        bodyEncoder: allConverters.ascii
    },
    changePasswordKey: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/group/{groupId}/password-key",
        path: "/1025/{groupId}/2"
    },
    getSessionLifetime: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/group/{groupId}/session-lifetime",
        path: "/1025/{groupId}/4",
        responseBodyDecoder: allConverters.uint16
    },
    putSessionLifetime: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/group/{groupId}/session-lifetime",
        path: "/1025/{groupId}/4",
        bodyEncoder: allConverters.uint16
    },
    getAlias: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/group/{groupId}/alias",
        path: "/1025/{groupId}/5",
        responseBodyDecoder: allConverters.uint16
    },
    putAlias: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/group/{groupId}/alias",
        path: "/1025/{groupId}/5",
        bodyEncoder: allConverters.uint16
    },
    create: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/group/{groupId}/create",
        path: "/1025/{groupId}/65535"
    }
};

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 GroupService = /** @class */ (function (_super) {
    __extends(GroupService, _super);
    function GroupService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get the name of the group from its id
     *
     * LWM2M path: /1025/{groupId}/0
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return
     */
    GroupService.prototype.getName = function (
    /*
     * Group id
     */
    groupId) {
        return this.serviceCallRunner.execute(this.getNameCall(groupId));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/0
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return call options
     */
    GroupService.prototype.getNameCall = function (
    /*
     * Group id
     */
    groupId) {
        var callOptions = __assign$1({}, this.resources.getName);
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Write group name
     *
     * LWM2M path: /1025/{groupId}/0
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param name input
     * @return
     */
    GroupService.prototype.putName = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    name) {
        return this.serviceCallRunner.execute(this.putNameCall(groupId, name));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/0
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param name input
     * @return call options
     */
    GroupService.prototype.putNameCall = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    name) {
        var callOptions = __assign$1({}, this.resources.putName);
        callOptions.body = name;
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Update password
     *
     * LWM2M path: /1025/{groupId}/2
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param password input
     * @return
     */
    GroupService.prototype.changePassword = function (
    /*
     * Group id
     */
    groupId, 
    /*
     *
     */
    password) {
        return this.serviceCallRunner.execute(this.changePasswordCall(groupId, password));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/2
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param password input
     * @return call options
     */
    GroupService.prototype.changePasswordCall = function (
    /*
     * Group id
     */
    groupId, 
    /*
     *
     */
    password) {
        var callOptions = __assign$1({}, this.resources.changePassword);
        callOptions.body = password;
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Change password using bytes data
     *
     * LWM2M path: /1025/{groupId}/2
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param password input
     * @return
     */
    GroupService.prototype.changePasswordKey = function (
    /*
     * Group id
     */
    groupId, 
    /*
     *
     */
    password) {
        return this.serviceCallRunner.execute(this.changePasswordKeyCall(groupId, password));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/2
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param password input
     * @return call options
     */
    GroupService.prototype.changePasswordKeyCall = function (
    /*
     * Group id
     */
    groupId, 
    /*
     *
     */
    password) {
        var callOptions = __assign$1({}, this.resources.changePasswordKey);
        callOptions.body = password;
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Get the maximum session lifetime
     *
     * LWM2M path: /1025/{groupId}/4
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return
     */
    GroupService.prototype.getSessionLifetime = function (
    /*
     * Group id
     */
    groupId) {
        return this.serviceCallRunner.execute(this.getSessionLifetimeCall(groupId));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/4
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return call options
     */
    GroupService.prototype.getSessionLifetimeCall = function (
    /*
     * Group id
     */
    groupId) {
        var callOptions = __assign$1({}, this.resources.getSessionLifetime);
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Write session lifetime
     *
     * LWM2M path: /1025/{groupId}/4
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param value input
     * @return
     */
    GroupService.prototype.putSessionLifetime = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putSessionLifetimeCall(groupId, value));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/4
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param value input
     * @return call options
     */
    GroupService.prototype.putSessionLifetimeCall = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putSessionLifetime);
        callOptions.body = value;
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Get group alias
     *
     * LWM2M path: /1025/{groupId}/5
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return
     */
    GroupService.prototype.getAlias = function (
    /*
     * Group id
     */
    groupId) {
        return this.serviceCallRunner.execute(this.getAliasCall(groupId));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/5
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return call options
     */
    GroupService.prototype.getAliasCall = function (
    /*
     * Group id
     */
    groupId) {
        var callOptions = __assign$1({}, this.resources.getAlias);
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Write group alias
     *
     * LWM2M path: /1025/{groupId}/5
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param value input
     * @return
     */
    GroupService.prototype.putAlias = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putAliasCall(groupId, value));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/5
     *
     * @tapVersion(">=")
     * @param groupId input
     * @param value input
     * @return call options
     */
    GroupService.prototype.putAliasCall = function (
    /*
     * Group id to return
     */
    groupId, 
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putAlias);
        callOptions.body = value;
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    /**
     * Create group with id groupId
     *
     * LWM2M path: /1025/{groupId}/65535
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return
     */
    GroupService.prototype.create = function (
    /*
     * Group id
     */
    groupId) {
        return this.serviceCallRunner.execute(this.createCall(groupId));
    };
    /**
     *
     *
     * LWM2M path: /1025/{groupId}/65535
     *
     * @tapVersion(">=")
     * @param groupId input
     * @return call options
     */
    GroupService.prototype.createCall = function (
    /*
     * Group id
     */
    groupId) {
        var callOptions = __assign$1({}, this.resources.create);
        callOptions.pathParameters = {
            groupId: groupId
        };
        return callOptions;
    };
    return GroupService;
}(AbstractService));

var _TAP_SERVICE_EXTENSION_GROUP_ = extendServiceContainer("group", GroupService);

// import './lib/custom/extension';

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

export { SERVICE_CALLS as GROUP_SERVICE_CALLS, GroupService, _TAP_SERVICE_EXTENSION_GROUP_, serviceConverters as groupConverters };
//# sourceMappingURL=iotize-tap-service-impl-group.js.map
