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
 */
const allConverters = Object.assign(Object.assign({}, converters), serviceConverters);
const SERVICE_CALLS = {
    getIp: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: '/ethernet/ip',
        path: '/1024//85',
        responseBodyDecoder: allConverters.stringIpv4,
    },
    putIp: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: '/ethernet/ip',
        path: '/1024//85',
        bodyEncoder: allConverters.stringIpv4,
    },
    getGatewayIp: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: '/ethernet/gateway-ip',
        path: '/1024//86',
        responseBodyDecoder: allConverters.stringIpv4,
    },
    putGatewayIp: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: '/ethernet/gateway-ip',
        path: '/1024//86',
        bodyEncoder: allConverters.stringIpv4,
    },
    getIpMask: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: '/ethernet/ip-mask',
        path: '/1024//87',
        responseBodyDecoder: allConverters.stringIpv4mask,
    },
    putIpMask: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: '/ethernet/ip-mask',
        path: '/1024//87',
        bodyEncoder: allConverters.stringIpv4mask,
    },
    getHostname: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: '/ethernet/hostname',
        path: '/1024//93',
        responseBodyDecoder: allConverters.ascii,
    },
    putHostname: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: '/ethernet/hostname',
        path: '/1024//93',
        bodyEncoder: allConverters.ascii,
    },
};

class EthernetService extends AbstractService {
    constructor() {
        super(...arguments);
        this.resources = SERVICE_CALLS;
    }
    /**
     * Address IP
     *
     * LWM2M path: /1024//85
     *
     * @tapVersion(">=2.7")
     * @return
     */
    getIp() {
        return this.serviceCallRunner.execute(this.getIpCall());
    }
    /**
     *
     *
     * LWM2M path: /1024//85
     *
     * @tapVersion(">=2.7")
     * @return call options
     */
    getIpCall() {
        const callOptions = Object.assign({}, this.resources.getIp);
        return callOptions;
    }
    /**
     * Write ethernet IP address to the configuration. Write 0.0.0.0 to use DHCP instead of a static IP address
     *
     * LWM2M path: /1024//85
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return
     */
    putIp(
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.putIpCall(data));
    }
    /**
     *
     *
     * LWM2M path: /1024//85
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return call options
     */
    putIpCall(
    /*
     *
     */
    data) {
        const callOptions = Object.assign({}, this.resources.putIp);
        callOptions.body = data;
        return callOptions;
    }
    /**
     * Get gateway IP address
     *
     * LWM2M path: /1024//86
     *
     * @tapVersion(">=2.7")
     * @return
     */
    getGatewayIp() {
        return this.serviceCallRunner.execute(this.getGatewayIpCall());
    }
    /**
     *
     *
     * LWM2M path: /1024//86
     *
     * @tapVersion(">=2.7")
     * @return call options
     */
    getGatewayIpCall() {
        const callOptions = Object.assign({}, this.resources.getGatewayIp);
        return callOptions;
    }
    /**
     * Write gateway IP address
     *
     * LWM2M path: /1024//86
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return
     */
    putGatewayIp(
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.putGatewayIpCall(data));
    }
    /**
     *
     *
     * LWM2M path: /1024//86
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return call options
     */
    putGatewayIpCall(
    /*
     *
     */
    data) {
        const callOptions = Object.assign({}, this.resources.putGatewayIp);
        callOptions.body = data;
        return callOptions;
    }
    /**
     * Get ethernet gateway IP mask
     *
     * LWM2M path: /1024//87
     *
     * @tapVersion(">=2.7")
     * @return
     */
    getIpMask() {
        return this.serviceCallRunner.execute(this.getIpMaskCall());
    }
    /**
     *
     *
     * LWM2M path: /1024//87
     *
     * @tapVersion(">=2.7")
     * @return call options
     */
    getIpMaskCall() {
        const callOptions = Object.assign({}, this.resources.getIpMask);
        return callOptions;
    }
    /**
     * Write ethernet gateway IP mask
     *
     * LWM2M path: /1024//87
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return
     */
    putIpMask(
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.putIpMaskCall(data));
    }
    /**
     *
     *
     * LWM2M path: /1024//87
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return call options
     */
    putIpMaskCall(
    /*
     *
     */
    data) {
        const callOptions = Object.assign({}, this.resources.putIpMask);
        callOptions.body = data;
        return callOptions;
    }
    /**
     * Get ethernet hostname
     *
     * LWM2M path: /1024//93
     *
     * @tapVersion(">=2.7")
     * @return
     */
    getHostname() {
        return this.serviceCallRunner.execute(this.getHostnameCall());
    }
    /**
     *
     *
     * LWM2M path: /1024//93
     *
     * @tapVersion(">=2.7")
     * @return call options
     */
    getHostnameCall() {
        const callOptions = Object.assign({}, this.resources.getHostname);
        return callOptions;
    }
    /**
     * Write ethernet hostname
     *
     * LWM2M path: /1024//93
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return
     */
    putHostname(
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.putHostnameCall(data));
    }
    /**
     *
     *
     * LWM2M path: /1024//93
     *
     * @tapVersion(">=2.7")
     * @param data input
     * @return call options
     */
    putHostnameCall(
    /*
     *
     */
    data) {
        const callOptions = Object.assign({}, this.resources.putHostname);
        callOptions.body = data;
        return callOptions;
    }
}

const _TAP_SERVICE_EXTENSION_ETHERNET_ = extendServiceContainer('ethernet', EthernetService);

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

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

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

export { SERVICE_CALLS as ETHERNET_SERVICE_CALLS, EthernetService, _TAP_SERVICE_EXTENSION_ETHERNET_, serviceConverters as ethernetConverters };
//# sourceMappingURL=iotize-tap-service-impl-ethernet.js.map
