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 GPIOMode;
(function (GPIOMode) {
    GPIOMode[GPIOMode["INPUT_FLOATING"] = 0] = "INPUT_FLOATING";
    GPIOMode[GPIOMode["OUTPUT_OPEN_DRAIN"] = 1] = "OUTPUT_OPEN_DRAIN";
    GPIOMode[GPIOMode["OUTPUT_PUSH_PULL"] = 3] = "OUTPUT_PUSH_PULL";
    GPIOMode[GPIOMode["INPUT_PULL_UP"] = 4] = "INPUT_PULL_UP";
    GPIOMode[GPIOMode["OUTPUT_OPEN_DRAIN_PULL_UP"] = 5] = "OUTPUT_OPEN_DRAIN_PULL_UP";
    GPIOMode[GPIOMode["INPUT_PULL_DOWN"] = 8] = "INPUT_PULL_DOWN";
})(GPIOMode || (GPIOMode = {}));

/**
 *   Generated file. Do not edit
 */
const gPIOMode = createEnumConverter(GPIOMode, 1);
const gPIOModeArray = createEnumArrayConverter(GPIOMode, 1);

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

/**
 *   Generated file. Do not edit
 */
const allConverters = Object.assign(Object.assign({}, converters), serviceConverters);
const SERVICE_CALLS = {
    getGpioMode: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: '/variable/{variableId}/gpio-mode',
        path: '/1029/{variableId}/4',
        responseBodyDecoder: allConverters.gPIOMode,
    },
};

class GpioService extends AbstractService {
    constructor() {
        super(...arguments);
        this.resources = SERVICE_CALLS;
    }
    /**
     * Get GPIO variable mode
     *
     * LWM2M path: /1029/{variableId}/4
     *
     * @tapVersion(">=")
     * @param variableId input
     * @return
     */
    getGpioMode(
    /*
     * ID of the variable
     */
    variableId) {
        return this.serviceCallRunner.execute(this.getGpioModeCall(variableId));
    }
    /**
     *
     *
     * LWM2M path: /1029/{variableId}/4
     *
     * @tapVersion(">=")
     * @param variableId input
     * @return call options
     */
    getGpioModeCall(
    /*
     * ID of the variable
     */
    variableId) {
        const callOptions = Object.assign({}, this.resources.getGpioMode);
        callOptions.pathParameters = {
            variableId: variableId,
        };
        return callOptions;
    }
}

const _TAP_SERVICE_EXTENSION_GPIO_ = extendServiceContainer('gpio', GpioService);

/**
 *   Generated file. Do not edit
 */

/**
 *   Generated file. Do not edit
 */

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

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

export { GPIOMode, SERVICE_CALLS as GPIO_SERVICE_CALLS, GpioService, _TAP_SERVICE_EXTENSION_GPIO_, serviceConverters as gpioConverters };
//# sourceMappingURL=iotize-tap-service-impl-gpio.js.map
