import { VariableFormat, AbstractService, extendServiceContainer } from '@iotize/tap';
import { TapRequestFrame } from '@iotize/tap/client/api';
import { createEnumConverter, createEnumArrayConverter, converters } from '@iotize/tap/service/core';
import { TapStreamReader, TapStreamWriter, enumKeyOrValueToNumber } from '@iotize/tap/client/impl';
import { KaitaiStreamWriter } from '@iotize/common/byte-stream';

/* 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 TargetCoreType;
(function (TargetCoreType) {
    TargetCoreType[TargetCoreType["M0_CORTEX"] = 0] = "M0_CORTEX";
    TargetCoreType[TargetCoreType["M1_CORTEX"] = 1] = "M1_CORTEX";
})(TargetCoreType || (TargetCoreType = {}));
var TargetS3PProtocolConfiguration;
(function (TargetS3PProtocolConfiguration) {
    /* 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 Mode;
    (function (Mode) {
        Mode[Mode["EMULATION"] = 0] = "EMULATION";
        Mode[Mode["INDEXED"] = 1] = "INDEXED";
    })(Mode = TargetS3PProtocolConfiguration.Mode || (TargetS3PProtocolConfiguration.Mode = {}));
})(TargetS3PProtocolConfiguration || (TargetS3PProtocolConfiguration = {}));
var ModbusOptions;
(function (ModbusOptions) {
    /* 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 ObjectType;
    (function (ObjectType) {
        ObjectType[ObjectType["DEFAULT"] = 0] = "DEFAULT";
        ObjectType[ObjectType["COIL"] = 1] = "COIL";
        ObjectType[ObjectType["DISCRET_INPUT"] = 2] = "DISCRET_INPUT";
        ObjectType[ObjectType["HOLDING_REGISTER"] = 3] = "HOLDING_REGISTER";
        ObjectType[ObjectType["INPUT_REGISTER"] = 4] = "INPUT_REGISTER";
    })(ObjectType = ModbusOptions.ObjectType || (ModbusOptions.ObjectType = {}));
})(ModbusOptions || (ModbusOptions = {}));
var SerialSettings;
(function (SerialSettings) {
    /* 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 BitParity;
    (function (BitParity) {
        BitParity[BitParity["NONE"] = 0] = "NONE";
        BitParity[BitParity["ODD"] = 1] = "ODD";
        BitParity[BitParity["EVEN"] = 2] = "EVEN";
    })(BitParity = SerialSettings.BitParity || (SerialSettings.BitParity = {}));
    /* 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 HardwareFlowControl;
    (function (HardwareFlowControl) {
        HardwareFlowControl[HardwareFlowControl["NONE"] = 0] = "NONE";
        HardwareFlowControl[HardwareFlowControl["RTS"] = 1] = "RTS";
        HardwareFlowControl[HardwareFlowControl["CTS"] = 2] = "CTS";
        HardwareFlowControl[HardwareFlowControl["RTS_CTS"] = 3] = "RTS_CTS";
    })(HardwareFlowControl = SerialSettings.HardwareFlowControl || (SerialSettings.HardwareFlowControl = {}));
    /* 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 StopBits;
    (function (StopBits) {
        StopBits[StopBits["ONE"] = 0] = "ONE";
        StopBits[StopBits["ONE_AND_HALF"] = 1] = "ONE_AND_HALF";
        StopBits[StopBits["TWO"] = 2] = "TWO";
    })(StopBits = SerialSettings.StopBits || (SerialSettings.StopBits = {}));
    /* 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 PhysicalPort;
    (function (PhysicalPort) {
        PhysicalPort[PhysicalPort["NONE"] = 0] = "NONE";
        PhysicalPort[PhysicalPort["RS232"] = 1] = "RS232";
        PhysicalPort[PhysicalPort["USB"] = 3] = "USB";
        PhysicalPort[PhysicalPort["AUTO"] = 6] = "AUTO";
        PhysicalPort[PhysicalPort["RS485"] = 10] = "RS485";
    })(PhysicalPort = SerialSettings.PhysicalPort || (SerialSettings.PhysicalPort = {}));
    /* 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 HandshakeDelimiter;
    (function (HandshakeDelimiter) {
        HandshakeDelimiter[HandshakeDelimiter["NONE"] = 0] = "NONE";
        HandshakeDelimiter[HandshakeDelimiter["CR"] = 1] = "CR";
        HandshakeDelimiter[HandshakeDelimiter["LF"] = 2] = "LF";
        HandshakeDelimiter[HandshakeDelimiter["CR_LF"] = 3] = "CR_LF";
    })(HandshakeDelimiter = SerialSettings.HandshakeDelimiter || (SerialSettings.HandshakeDelimiter = {}));
    /* 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 DataBits;
    (function (DataBits) {
        DataBits[DataBits["_7"] = 0] = "_7";
        DataBits[DataBits["_8"] = 1] = "_8";
        DataBits[DataBits["_9"] = 2] = "_9";
    })(DataBits = SerialSettings.DataBits || (SerialSettings.DataBits = {}));
})(SerialSettings || (SerialSettings = {}));

/**
 *   Generated file. Do not edit
 */
TapStreamReader.prototype.readTargetComStats = function () {
    var model = {};
    model.nbFailCom = this.readUnsigned(4);
    model.nbSuccessfulCom = this.readUnsigned(4);
    return model;
};
TapStreamReader.prototype.readTargetSerialModbusProtocolConfiguration = function () {
    var model = {};
    model.modbus = this.readTargetSerialModbusProtocolConfigurationModbus();
    model.serial = this.readTargetSerialModbusProtocolConfigurationSerial();
    return model;
};
TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationModbus = function () {
    var model = {};
    model.slave = this.readUnsigned(1);
    this.forwardBits(3);
    model.offsetFirstRegister = this.readBoolean(1);
    return model;
};
TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationSerial = function () {
    var model = {};
    model.baudRate = this.readBits(20);
    this.forwardBits(1);
    this.forwardBits(1);
    this.forwardBits(1);
    this.forwardBits(1);
    model.physicalPort = this.readBits(4);
    model.stopBits = this.readBits(2);
    model.bitParity = this.readBits(4);
    model.dataBits = this.readBits(2);
    model.handshakeDelimiter = this.readBits(4);
    model.hardwareFlowControl = this.readBits(4);
    model.timeout = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readTargetS3PProtocolConfiguration = function () {
    var model = {};
    model.delay = this.readUnsigned(1);
    model.mode = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readModbusWriteOptions = function () {
    var model = {};
    model.options = this.readModbusOptions();
    model.data = this.readBytes();
    return model;
};
TapStreamReader.prototype.readModbusOptions = function () {
    var model = {};
    this.forwardBits(5);
    model.objectType = this.readBits(3);
    model.slave = this.readUnsigned(1);
    model.address = this.readUnsigned(2);
    model.length = this.readUnsigned(4);
    model.format = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readMemoryInfo = function () {
    var model = {};
    model.address = this.readUnsigned(4);
    model.length = this.readUnsigned(4);
    model.format = this.readUnsigned(1);
    return model;
};
TapStreamReader.prototype.readMemoryWriteInfo = function () {
    var model = {};
    model.info = this.readMemoryInfo();
    model.data = this.readBytes();
    return model;
};
TapStreamReader.prototype.readSerialSettings = function () {
    var model = {};
    return model;
};
// TapStreamWriter.prototype.write(model: TargetComStats) : TapStreamWriter{
//     return this.writeTargetComStats(model)
// }
TapStreamWriter.prototype.writeTargetComStats = function (model) {
    this.writeUnsigned(model.nbFailCom, 4);
    this.writeUnsigned(model.nbSuccessfulCom, 4);
    return this;
};
// TapStreamWriter.prototype.write(model: TargetSerialModbusProtocolConfiguration) : TapStreamWriter{
//     return this.writeTargetSerialModbusProtocolConfiguration(model)
// }
TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfiguration = function (model) {
    this.writeTargetSerialModbusProtocolConfigurationModbus(model.modbus);
    this.writeTargetSerialModbusProtocolConfigurationSerial(model.serial);
    return this;
};
TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationModbus = function (model) {
    this.writeUnsigned(model.slave, 1);
    this.forwardBits(3);
    this.writeBoolean(model.offsetFirstRegister, 1);
    return this;
};
TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationSerial = function (model) {
    this.writeBits(model.baudRate, 20);
    this.forwardBits(1);
    this.forwardBits(1);
    this.forwardBits(1);
    this.forwardBits(1);
    this.writeBitsInt(enumKeyOrValueToNumber(model.physicalPort, SerialSettings.PhysicalPort), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.stopBits, SerialSettings.StopBits), 2);
    this.writeBitsInt(enumKeyOrValueToNumber(model.bitParity, SerialSettings.BitParity), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.dataBits, SerialSettings.DataBits), 2);
    this.writeBitsInt(enumKeyOrValueToNumber(model.handshakeDelimiter, SerialSettings.HandshakeDelimiter), 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.hardwareFlowControl, SerialSettings.HardwareFlowControl), 4);
    this.writeUnsigned(model.timeout, 1);
    return this;
};
// TapStreamWriter.prototype.write(model: TargetS3PProtocolConfiguration) : TapStreamWriter{
//     return this.writeTargetS3PProtocolConfiguration(model)
// }
TapStreamWriter.prototype.writeTargetS3PProtocolConfiguration = function (model) {
    this.writeUnsigned(model.delay, 1);
    this.writeBitsInt(enumKeyOrValueToNumber(model.mode, TargetS3PProtocolConfiguration.Mode), 8);
    return this;
};
// TapStreamWriter.prototype.write(model: ModbusWriteOptions) : TapStreamWriter{
//     return this.writeModbusWriteOptions(model)
// }
TapStreamWriter.prototype.writeModbusWriteOptions = function (model) {
    this.writeModbusOptions(model.options);
    this.writeBytes(model.data);
    return this;
};
// TapStreamWriter.prototype.write(model: ModbusOptions) : TapStreamWriter{
//     return this.writeModbusOptions(model)
// }
TapStreamWriter.prototype.writeModbusOptions = function (model) {
    this.forwardBits(5);
    this.writeBitsInt(enumKeyOrValueToNumber(model.objectType, ModbusOptions.ObjectType), 3);
    this.writeUnsigned(model.slave, 1);
    this.writeUnsigned(model.address, 2);
    this.writeUnsigned(model.length, 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.format, VariableFormat), 8);
    return this;
};
// TapStreamWriter.prototype.write(model: MemoryInfo) : TapStreamWriter{
//     return this.writeMemoryInfo(model)
// }
TapStreamWriter.prototype.writeMemoryInfo = function (model) {
    this.writeUnsigned(model.address, 4);
    this.writeUnsigned(model.length, 4);
    this.writeBitsInt(enumKeyOrValueToNumber(model.format, VariableFormat), 8);
    return this;
};
// TapStreamWriter.prototype.write(model: MemoryWriteInfo) : TapStreamWriter{
//     return this.writeMemoryWriteInfo(model)
// }
TapStreamWriter.prototype.writeMemoryWriteInfo = function (model) {
    this.writeMemoryInfo(model.info);
    this.writeBytes(model.data);
    return this;
};
// TapStreamWriter.prototype.write(model: SerialSettings) : TapStreamWriter{
//     return this.writeSerialSettings(model)
// }
TapStreamWriter.prototype.writeSerialSettings = function (model) {
    return this;
};

/**
 *   Generated file. Do not edit
 */
var TargetComStatsConverter = /** @class */ (function () {
    function TargetComStatsConverter() {
    }
    TargetComStatsConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeTargetComStats(model);
        return stream.toBytes;
    };
    TargetComStatsConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readTargetComStats();
    };
    return TargetComStatsConverter;
}());
var TargetSerialModbusProtocolConfigurationConverter = /** @class */ (function () {
    function TargetSerialModbusProtocolConfigurationConverter() {
    }
    TargetSerialModbusProtocolConfigurationConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeTargetSerialModbusProtocolConfiguration(model);
        return stream.toBytes;
    };
    TargetSerialModbusProtocolConfigurationConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readTargetSerialModbusProtocolConfiguration();
    };
    return TargetSerialModbusProtocolConfigurationConverter;
}());
var TargetS3PProtocolConfigurationConverter = /** @class */ (function () {
    function TargetS3PProtocolConfigurationConverter() {
    }
    TargetS3PProtocolConfigurationConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeTargetS3PProtocolConfiguration(model);
        return stream.toBytes;
    };
    TargetS3PProtocolConfigurationConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readTargetS3PProtocolConfiguration();
    };
    return TargetS3PProtocolConfigurationConverter;
}());
var ModbusWriteOptionsConverter = /** @class */ (function () {
    function ModbusWriteOptionsConverter() {
    }
    ModbusWriteOptionsConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeModbusWriteOptions(model);
        return stream.toBytes;
    };
    ModbusWriteOptionsConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readModbusWriteOptions();
    };
    return ModbusWriteOptionsConverter;
}());
var ModbusOptionsConverter = /** @class */ (function () {
    function ModbusOptionsConverter() {
    }
    ModbusOptionsConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeModbusOptions(model);
        return stream.toBytes;
    };
    ModbusOptionsConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readModbusOptions();
    };
    return ModbusOptionsConverter;
}());
var MemoryInfoConverter = /** @class */ (function () {
    function MemoryInfoConverter() {
    }
    MemoryInfoConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeMemoryInfo(model);
        return stream.toBytes;
    };
    MemoryInfoConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readMemoryInfo();
    };
    return MemoryInfoConverter;
}());
var MemoryWriteInfoConverter = /** @class */ (function () {
    function MemoryWriteInfoConverter() {
    }
    MemoryWriteInfoConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeMemoryWriteInfo(model);
        return stream.toBytes;
    };
    MemoryWriteInfoConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readMemoryWriteInfo();
    };
    return MemoryWriteInfoConverter;
}());
var SerialSettingsConverter = /** @class */ (function () {
    function SerialSettingsConverter() {
    }
    SerialSettingsConverter.prototype.encode = function (model, stream) {
        if (stream === void 0) { stream = new TapStreamWriter(); }
        stream.writeSerialSettings(model);
        return stream.toBytes;
    };
    SerialSettingsConverter.prototype.decode = function (data) {
        var stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
        return stream.readSerialSettings();
    };
    return SerialSettingsConverter;
}());

/**
 *   Generated file. Do not edit
 */
var targetCoreType = createEnumConverter(TargetCoreType, 1);
var targetCoreTypeArray = createEnumArrayConverter(TargetCoreType, 1);
var targetComStats = new TargetComStatsConverter();
var targetSerialModbusProtocolConfiguration = new TargetSerialModbusProtocolConfigurationConverter();
var targetS3PProtocolConfiguration = new TargetS3PProtocolConfigurationConverter();
var modbusWriteOptions = new ModbusWriteOptionsConverter();
var modbusOptions = new ModbusOptionsConverter();
var memoryInfo = new MemoryInfoConverter();
var memoryWriteInfo = new MemoryWriteInfoConverter();
var serialSettings = new SerialSettingsConverter();

var serviceConverters = /*#__PURE__*/Object.freeze({
    __proto__: null,
    targetCoreType: targetCoreType,
    targetCoreTypeArray: targetCoreTypeArray,
    targetComStats: targetComStats,
    targetSerialModbusProtocolConfiguration: targetSerialModbusProtocolConfiguration,
    targetS3PProtocolConfiguration: targetS3PProtocolConfiguration,
    modbusWriteOptions: modbusWriteOptions,
    modbusOptions: modbusOptions,
    memoryInfo: memoryInfo,
    memoryWriteInfo: memoryWriteInfo,
    serialSettings: serialSettings
});

var PROTOCOL_CONF_CTR_LENGHT = 8;
var ReversedTargetSerialModbusConfigurationConverter = /** @class */ (function () {
    function ReversedTargetSerialModbusConfigurationConverter() {
        this.converter = new TargetSerialModbusProtocolConfigurationConverter();
    }
    ReversedTargetSerialModbusConfigurationConverter.prototype.decode = function (data) {
        return this.converter.decode(this._reorderBytes(data));
    };
    ReversedTargetSerialModbusConfigurationConverter.prototype.encode = function (settings) {
        return this._reorderBytes(this.converter.encode(settings));
    };
    ReversedTargetSerialModbusConfigurationConverter.prototype._reorderBytes = function (data) {
        return KaitaiStreamWriter.mergeArrays(data.slice(0, PROTOCOL_CONF_CTR_LENGHT).reverse(), data.slice(PROTOCOL_CONF_CTR_LENGHT));
    };
    return ReversedTargetSerialModbusConfigurationConverter;
}());

var reversedTargetSerialModbusConfiguration = new ReversedTargetSerialModbusConfigurationConverter();

var customConverters = /*#__PURE__*/Object.freeze({
    __proto__: null,
    reversedTargetSerialModbusConfiguration: reversedTargetSerialModbusConfiguration
});

/**
 *   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(__assign({}, converters), serviceConverters), customConverters);
var SERVICE_CALLS = {
    getProtocol: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/protocol",
        path: "/1027//1",
        responseBodyDecoder: allConverters.targetProtocol
    },
    setProtocol: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/protocol",
        path: "/1027//1",
        bodyEncoder: allConverters.targetProtocol
    },
    putProtocol: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/protocol",
        path: "/1027//1",
        bodyEncoder: allConverters.targetProtocol
    },
    getCoreType: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/core-type",
        path: "/1027//2",
        responseBodyDecoder: allConverters.targetCoreType
    },
    putCoreType: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/core-type",
        path: "/1027//2",
        bodyEncoder: allConverters.targetCoreType
    },
    isConnected: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/connect",
        path: "/1027//3",
        responseBodyDecoder: allConverters.boolean
    },
    connect: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/connect",
        path: "/1027//3"
    },
    disconnect: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/disconnect",
        path: "/1027//4"
    },
    reset: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/reset",
        path: "/1027//5"
    },
    getFirmwareVersion: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/firmware-version",
        path: "/1027//6",
        responseBodyDecoder: allConverters.stringVersion
    },
    putFirmwareVersion: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/firmware-version",
        path: "/1027//6",
        bodyEncoder: allConverters.stringVersion
    },
    getVcc: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/vcc",
        path: "/1027//7",
        responseBodyDecoder: allConverters.uint16
    },
    getMinVoltage: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/min-voltage",
        path: "/1027//8",
        responseBodyDecoder: allConverters.uint16
    },
    putMinVoltage: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/min-voltage",
        path: "/1027//8",
        bodyEncoder: allConverters.uint16
    },
    getMaxVoltage: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/max-voltage",
        path: "/1027//9",
        responseBodyDecoder: allConverters.uint16
    },
    putMaxVoltage: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/max-voltage",
        path: "/1027//9",
        bodyEncoder: allConverters.uint16
    },
    getPageSize: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/page-size",
        path: "/1027//10",
        responseBodyDecoder: allConverters.uint32
    },
    putPageSize: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/page-size",
        path: "/1027//10",
        bodyEncoder: allConverters.uint32
    },
    getComStats: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/com-stats",
        path: "/1027//11",
        responseBodyDecoder: allConverters.targetComStats
    },
    clearComStats: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/com-stats",
        path: "/1027//11"
    },
    getAvailableProtocols: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/available-protocols",
        path: "/1027//20",
        responseBodyDecoder: allConverters.targetProtocolArray
    },
    getSerialModbusConfiguration: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/serial-modbus-configuration",
        path: "/1027//21",
        responseBodyDecoder: allConverters.reversedTargetSerialModbusConfiguration
    },
    setSerialModbusConfiguration: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/serial-modbus-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.reversedTargetSerialModbusConfiguration
    },
    putSerialModbusConfiguration: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/serial-modbus-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.reversedTargetSerialModbusConfiguration
    },
    getS3PConfiguration: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/s3p-configuration",
        path: "/1027//21",
        responseBodyDecoder: allConverters.targetS3PProtocolConfiguration
    },
    setS3PConfiguration: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/s3p-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.targetS3PProtocolConfiguration
    },
    putS3PConfiguration: {
        method: TapRequestFrame.MethodType.PUT,
        pathAlias: "/target/s3p-configuration",
        path: "/1027//21",
        bodyEncoder: allConverters.targetS3PProtocolConfiguration
    },
    postResetKeep: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/reset-keep",
        path: "/1027//30"
    },
    readDebug: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/debug-access",
        path: "/1027//31",
        bodyEncoder: allConverters.uint32
    },
    writeDebug: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/debug-access",
        path: "/1027//31"
    },
    getRegisterAccess: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/register-access",
        path: "/1027//32"
    },
    postRegisterAccess: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/register-access",
        path: "/1027//32"
    },
    sendReceive: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/transparent/send-receive",
        path: "/1027//34"
    },
    send: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/transparent/send",
        path: "/1027//34"
    },
    readBytes: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/transparent/read-bytes",
        path: "/1027//35"
    },
    modbusWrite: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/modbus/write",
        path: "/1027//37",
        bodyEncoder: allConverters.modbusWriteOptions
    },
    modbusRead: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/modbus/read",
        path: "/1027//38",
        bodyEncoder: allConverters.modbusOptions
    },
    getSubProtocol: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/sub-protocol",
        path: "/1027//40",
        responseBodyDecoder: allConverters.targetProtocol
    },
    getReceivedCount: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/received-count",
        path: "/1027//43",
        responseBodyDecoder: allConverters.uint16
    },
    readAddress: {
        method: TapRequestFrame.MethodType.GET,
        pathAlias: "/target/read-address",
        path: "/1027//33",
        bodyEncoder: allConverters.memoryInfo
    },
    writeAddress: {
        method: TapRequestFrame.MethodType.POST,
        pathAlias: "/target/read-address",
        path: "/1027//33",
        bodyEncoder: allConverters.memoryWriteInfo
    }
};

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 TargetService = /** @class */ (function (_super) {
    __extends(TargetService, _super);
    function TargetService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get target protocol
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getProtocol = function () {
        return this.serviceCallRunner.execute(this.getProtocolCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getProtocolCall = function () {
        var callOptions = __assign$1({}, this.resources.getProtocol);
        return callOptions;
    };
    /**
     * Write target protocol
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @param targetProtocol input
     * @return
     */
    TargetService.prototype.setProtocol = function (
    /*
     * TargetProtocol object to set
     */
    targetProtocol) {
        return this.serviceCallRunner.execute(this.setProtocolCall(targetProtocol));
    };
    /**
     *
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @param targetProtocol input
     * @return call options
     */
    TargetService.prototype.setProtocolCall = function (
    /*
     * TargetProtocol object to set
     */
    targetProtocol) {
        var callOptions = __assign$1({}, this.resources.setProtocol);
        callOptions.body = targetProtocol;
        return callOptions;
    };
    /**
     * Configure target protocol
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @param targetProtocol input
     * @return
     */
    TargetService.prototype.putProtocol = function (
    /*
     * TargetProtocol object to set
     */
    targetProtocol) {
        return this.serviceCallRunner.execute(this.putProtocolCall(targetProtocol));
    };
    /**
     *
     *
     * LWM2M path: /1027//1
     *
     * @tapVersion(">=")
     * @param targetProtocol input
     * @return call options
     */
    TargetService.prototype.putProtocolCall = function (
    /*
     * TargetProtocol object to set
     */
    targetProtocol) {
        var callOptions = __assign$1({}, this.resources.putProtocol);
        callOptions.body = targetProtocol;
        return callOptions;
    };
    /**
     * Get core type
     *
     * LWM2M path: /1027//2
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getCoreType = function () {
        return this.serviceCallRunner.execute(this.getCoreTypeCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//2
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getCoreTypeCall = function () {
        var callOptions = __assign$1({}, this.resources.getCoreType);
        return callOptions;
    };
    /**
     * Write core type
     *
     * LWM2M path: /1027//2
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putCoreType = function (
    /*
     * Write core type
     */
    value) {
        return this.serviceCallRunner.execute(this.putCoreTypeCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//2
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putCoreTypeCall = function (
    /*
     * Write core type
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putCoreType);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Check if target is connected
     *
     * LWM2M path: /1027//3
     *
     * @tapVersion(">=1.63")
     * @return
     */
    TargetService.prototype.isConnected = function () {
        return this.serviceCallRunner.execute(this.isConnectedCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//3
     *
     * @tapVersion(">=1.63")
     * @return call options
     */
    TargetService.prototype.isConnectedCall = function () {
        var callOptions = __assign$1({}, this.resources.isConnected);
        return callOptions;
    };
    /**
     * Connect to target
     *
     * LWM2M path: /1027//3
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.connect = function () {
        return this.serviceCallRunner.execute(this.connectCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//3
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.connectCall = function () {
        var callOptions = __assign$1({}, this.resources.connect);
        return callOptions;
    };
    /**
     * Disconnect from target
     *
     * LWM2M path: /1027//4
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.disconnect = function () {
        return this.serviceCallRunner.execute(this.disconnectCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//4
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.disconnectCall = function () {
        var callOptions = __assign$1({}, this.resources.disconnect);
        return callOptions;
    };
    /**
     * Reset target
     *
     * LWM2M path: /1027//5
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.reset = function () {
        return this.serviceCallRunner.execute(this.resetCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//5
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.resetCall = function () {
        var callOptions = __assign$1({}, this.resources.reset);
        return callOptions;
    };
    /**
     * Get target firmware version
     *
     * LWM2M path: /1027//6
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getFirmwareVersion = function () {
        return this.serviceCallRunner.execute(this.getFirmwareVersionCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//6
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getFirmwareVersionCall = function () {
        var callOptions = __assign$1({}, this.resources.getFirmwareVersion);
        return callOptions;
    };
    /**
     * Write target firmware version
     *
     * LWM2M path: /1027//6
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putFirmwareVersion = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putFirmwareVersionCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//6
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putFirmwareVersionCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putFirmwareVersion);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get vcc
     *
     * LWM2M path: /1027//7
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getVcc = function () {
        return this.serviceCallRunner.execute(this.getVccCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//7
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getVccCall = function () {
        var callOptions = __assign$1({}, this.resources.getVcc);
        return callOptions;
    };
    /**
     * Get min voltage
     *
     * LWM2M path: /1027//8
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getMinVoltage = function () {
        return this.serviceCallRunner.execute(this.getMinVoltageCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//8
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getMinVoltageCall = function () {
        var callOptions = __assign$1({}, this.resources.getMinVoltage);
        return callOptions;
    };
    /**
     * Write min voltage value
     *
     * LWM2M path: /1027//8
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putMinVoltage = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putMinVoltageCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//8
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putMinVoltageCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putMinVoltage);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get max voltage
     *
     * LWM2M path: /1027//9
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getMaxVoltage = function () {
        return this.serviceCallRunner.execute(this.getMaxVoltageCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//9
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getMaxVoltageCall = function () {
        var callOptions = __assign$1({}, this.resources.getMaxVoltage);
        return callOptions;
    };
    /**
     * Write max voltage value
     *
     * LWM2M path: /1027//9
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putMaxVoltage = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putMaxVoltageCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//9
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putMaxVoltageCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putMaxVoltage);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get page size
     *
     * LWM2M path: /1027//10
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getPageSize = function () {
        return this.serviceCallRunner.execute(this.getPageSizeCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//10
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getPageSizeCall = function () {
        var callOptions = __assign$1({}, this.resources.getPageSize);
        return callOptions;
    };
    /**
     * Write page size
     *
     * LWM2M path: /1027//10
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putPageSize = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putPageSizeCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//10
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putPageSizeCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putPageSize);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get communication stats
     *
     * LWM2M path: /1027//11
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getComStats = function () {
        return this.serviceCallRunner.execute(this.getComStatsCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//11
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getComStatsCall = function () {
        var callOptions = __assign$1({}, this.resources.getComStats);
        return callOptions;
    };
    /**
     * Clear communication stats
     *
     * LWM2M path: /1027//11
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.clearComStats = function () {
        return this.serviceCallRunner.execute(this.clearComStatsCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//11
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.clearComStatsCall = function () {
        var callOptions = __assign$1({}, this.resources.clearComStats);
        return callOptions;
    };
    /**
     * List available target protocols
     *
     * LWM2M path: /1027//20
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getAvailableProtocols = function () {
        return this.serviceCallRunner.execute(this.getAvailableProtocolsCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//20
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getAvailableProtocolsCall = function () {
        var callOptions = __assign$1({}, this.resources.getAvailableProtocols);
        return callOptions;
    };
    /**
     * Get protocol configuration options
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getSerialModbusConfiguration = function () {
        return this.serviceCallRunner.execute(this.getSerialModbusConfigurationCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getSerialModbusConfigurationCall = function () {
        var callOptions = __assign$1({}, this.resources.getSerialModbusConfiguration);
        return callOptions;
    };
    /**
     * Temporary update configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.setSerialModbusConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.setSerialModbusConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.setSerialModbusConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.setSerialModbusConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Update protocol configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putSerialModbusConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putSerialModbusConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putSerialModbusConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putSerialModbusConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Get S3P protocol configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getS3PConfiguration = function () {
        return this.serviceCallRunner.execute(this.getS3PConfigurationCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getS3PConfigurationCall = function () {
        var callOptions = __assign$1({}, this.resources.getS3PConfiguration);
        return callOptions;
    };
    /**
     * Temporary update S3P configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.setS3PConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.setS3PConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.setS3PConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.setS3PConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Update protocol configuration
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.putS3PConfiguration = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.putS3PConfigurationCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//21
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.putS3PConfigurationCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.putS3PConfiguration);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Reset target
     *
     * LWM2M path: /1027//30
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.postResetKeep = function () {
        return this.serviceCallRunner.execute(this.postResetKeepCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//30
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.postResetKeepCall = function () {
        var callOptions = __assign$1({}, this.resources.postResetKeep);
        return callOptions;
    };
    /**
     * Debug access
     *
     * LWM2M path: /1027//31
     *
     * @tapVersion(">=")
     * @param address input
     * @return
     */
    TargetService.prototype.readDebug = function (
    /*
     *
     */
    address) {
        return this.serviceCallRunner.execute(this.readDebugCall(address));
    };
    /**
     *
     *
     * LWM2M path: /1027//31
     *
     * @tapVersion(">=")
     * @param address input
     * @return call options
     */
    TargetService.prototype.readDebugCall = function (
    /*
     *
     */
    address) {
        var callOptions = __assign$1({}, this.resources.readDebug);
        callOptions.body = address;
        return callOptions;
    };
    /**
     * Write address
     *
     * LWM2M path: /1027//31
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.writeDebug = function () {
        return this.serviceCallRunner.execute(this.writeDebugCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//31
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.writeDebugCall = function () {
        var callOptions = __assign$1({}, this.resources.writeDebug);
        return callOptions;
    };
    /**
     * Register access
     *
     * LWM2M path: /1027//32
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getRegisterAccess = function () {
        return this.serviceCallRunner.execute(this.getRegisterAccessCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//32
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getRegisterAccessCall = function () {
        var callOptions = __assign$1({}, this.resources.getRegisterAccess);
        return callOptions;
    };
    /**
     * Write register value
     *
     * LWM2M path: /1027//32
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.postRegisterAccess = function () {
        return this.serviceCallRunner.execute(this.postRegisterAccessCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//32
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.postRegisterAccessCall = function () {
        var callOptions = __assign$1({}, this.resources.postRegisterAccess);
        return callOptions;
    };
    /**
     * Transparent send and receive
     *
     * LWM2M path: /1027//34
     *
     * @tapVersion(">=")
     * @param data input
     * @return
     */
    TargetService.prototype.sendReceive = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.sendReceiveCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//34
     *
     * @tapVersion(">=")
     * @param data input
     * @return call options
     */
    TargetService.prototype.sendReceiveCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.sendReceive);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Transparent send
     *
     * LWM2M path: /1027//34
     *
     * @tapVersion(">=")
     * @param data input
     * @return
     */
    TargetService.prototype.send = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.sendCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//34
     *
     * @tapVersion(">=")
     * @param data input
     * @return call options
     */
    TargetService.prototype.sendCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.send);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Read data transparent mode with limit
     *
     * LWM2M path: /1027//35
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.readBytes = function () {
        return this.serviceCallRunner.execute(this.readBytesCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//35
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.readBytesCall = function () {
        var callOptions = __assign$1({}, this.resources.readBytes);
        return callOptions;
    };
    /**
     * Generic modbus write
     *
     * LWM2M path: /1027//37
     *
     * @tapVersion(">=")
     * @param data input
     * @return
     */
    TargetService.prototype.modbusWrite = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.modbusWriteCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//37
     *
     * @tapVersion(">=")
     * @param data input
     * @return call options
     */
    TargetService.prototype.modbusWriteCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.modbusWrite);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Generic modbus read
     *
     * LWM2M path: /1027//38
     *
     * @tapVersion(">=")
     * @param data input
     * @return
     */
    TargetService.prototype.modbusRead = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.modbusReadCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1027//38
     *
     * @tapVersion(">=")
     * @param data input
     * @return call options
     */
    TargetService.prototype.modbusReadCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign$1({}, this.resources.modbusRead);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Get current sub protocol
     *
     * LWM2M path: /1027//40
     *
     * @tapVersion(">=")
     * @return
     */
    TargetService.prototype.getSubProtocol = function () {
        return this.serviceCallRunner.execute(this.getSubProtocolCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//40
     *
     * @tapVersion(">=")
     * @return call options
     */
    TargetService.prototype.getSubProtocolCall = function () {
        var callOptions = __assign$1({}, this.resources.getSubProtocol);
        return callOptions;
    };
    /**
     * Get byte length received in buffer (when using serial communication)
     *
     * LWM2M path: /1027//43
     *
     * @tapVersion(">=1.57")
     * @return
     */
    TargetService.prototype.getReceivedCount = function () {
        return this.serviceCallRunner.execute(this.getReceivedCountCall());
    };
    /**
     *
     *
     * LWM2M path: /1027//43
     *
     * @tapVersion(">=1.57")
     * @return call options
     */
    TargetService.prototype.getReceivedCountCall = function () {
        var callOptions = __assign$1({}, this.resources.getReceivedCount);
        return callOptions;
    };
    /**
     * Read memory at given address on the target application
     *
     * LWM2M path: /1027//33
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.readAddress = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.readAddressCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//33
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.readAddressCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.readAddress);
        callOptions.body = value;
        return callOptions;
    };
    /**
     * Write into memory on target
     *
     * LWM2M path: /1027//33
     *
     * @tapVersion(">=")
     * @param value input
     * @return
     */
    TargetService.prototype.writeAddress = function (
    /*
     *
     */
    value) {
        return this.serviceCallRunner.execute(this.writeAddressCall(value));
    };
    /**
     *
     *
     * LWM2M path: /1027//33
     *
     * @tapVersion(">=")
     * @param value input
     * @return call options
     */
    TargetService.prototype.writeAddressCall = function (
    /*
     *
     */
    value) {
        var callOptions = __assign$1({}, this.resources.writeAddress);
        callOptions.body = value;
        return callOptions;
    };
    return TargetService;
}(AbstractService));

var _TAP_SERVICE_EXTENSION_TARGET_ = extendServiceContainer("target", TargetService);

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

export { MemoryInfoConverter, MemoryWriteInfoConverter, ModbusOptions, ModbusOptionsConverter, ModbusWriteOptionsConverter, ReversedTargetSerialModbusConfigurationConverter, SerialSettings, SerialSettingsConverter, SERVICE_CALLS as TARGET_SERVICE_CALLS, TargetComStatsConverter, TargetCoreType, TargetS3PProtocolConfiguration, TargetS3PProtocolConfigurationConverter, TargetSerialModbusProtocolConfigurationConverter, TargetService, _TAP_SERVICE_EXTENSION_TARGET_, reversedTargetSerialModbusConfiguration, serviceConverters as targetConverters };
//# sourceMappingURL=iotize-tap-service-impl-target.js.map
