"use strict";
/**
 * This file has been generated
 * DO NOT EDIT, IT MAY BE OVERWRITTEN
 */
var __extends = (this && this.__extends) || (function () {
    var 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 function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var abstract_service_1 = require("../abstract-service");
var TargetService = /** @class */ (function (_super) {
    __extends(TargetService, _super);
    function TargetService(client, apiConfig) {
        var _this = _super.call(this, client, apiConfig) || this;
        _this.resources = {
            'clearComStats': {
                path: "/target/com-stats",
                methodType: "post"
            },
            'connect': {
                path: "/target/connect",
                methodType: "post"
            },
            'disconnect': {
                path: "/target/disconnect",
                methodType: "post"
            },
            'getAvailableProtocols': {
                path: "/target/available-protocols",
                methodType: "get",
                returnTypeConverter: "Array<TargetProtocol>"
            },
            'getComStats': {
                path: "/target/com-stats",
                methodType: "get",
                returnTypeConverter: "TargetComStats"
            },
            'getCoreType': {
                path: "/target/core-type",
                methodType: "get",
                returnTypeConverter: "TargetCoreType"
            },
            'getFirmwareVersion': {
                path: "/target/firmware-version",
                methodType: "get",
                returnTypeConverter: "TapVersion"
            },
            'getMaxVoltage': {
                path: "/target/max-voltage",
                methodType: "get",
                returnTypeConverter: "integer_uint16"
            },
            'getMinVoltage': {
                path: "/target/min-voltage",
                methodType: "get",
                returnTypeConverter: "integer_uint16"
            },
            'getPageSize': {
                path: "/target/page-size",
                methodType: "get",
                returnTypeConverter: "integer_uint32"
            },
            'getProtocol': {
                path: "/target/protocol",
                methodType: "get",
                returnTypeConverter: "TargetProtocol"
            },
            'getReceivedCount': {
                path: "/target/received-count",
                methodType: "get",
                returnTypeConverter: "integer_uint16"
            },
            'getRegisterAccess': {
                path: "/target/register-access",
                methodType: "get",
                returnTypeConverter: "Bytes"
            },
            'getSubProtocol': {
                path: "/target/sub-protocol",
                methodType: "get",
                returnTypeConverter: "TargetProtocol"
            },
            'getUARTSettings': {
                path: "/target/uart/settings",
                methodType: "get",
                returnTypeConverter: "UartSettings"
            },
            'getVcc': {
                path: "/target/vcc",
                methodType: "get",
                returnTypeConverter: "integer_uint16"
            },
            'modbusRead': {
                path: "/target/modbus/read",
                methodType: "get",
                returnTypeConverter: "Bytes",
                bodyEncoder: "ModbusOptions"
            },
            'modbusWrite': {
                path: "/target/modbus/write",
                methodType: "post",
                bodyEncoder: "ModbusWriteOptions"
            },
            'postRegisterAccess': {
                path: "/target/register-access",
                methodType: "post"
            },
            'postResetKeep': {
                path: "/target/reset-keep",
                methodType: "post"
            },
            'putCoreType': {
                path: "/target/core-type",
                methodType: "put",
                bodyEncoder: "TargetCoreType"
            },
            'putFirmwareVersion': {
                path: "/target/firmware-version",
                methodType: "put",
                bodyEncoder: "TapVersion"
            },
            'putMaxVoltage': {
                path: "/target/max-voltage",
                methodType: "put",
                bodyEncoder: "integer_uint16"
            },
            'putMinVoltage': {
                path: "/target/min-voltage",
                methodType: "put",
                bodyEncoder: "integer_uint16"
            },
            'putPageSize': {
                path: "/target/page-size",
                methodType: "put",
                bodyEncoder: "integer_uint32"
            },
            'putProtocol': {
                path: "/target/protocol",
                methodType: "put",
                bodyEncoder: "TargetProtocol"
            },
            'readAddress': {
                path: "/target/read-address",
                methodType: "get",
                returnTypeConverter: "Bytes",
                bodyEncoder: "MemoryInfo"
            },
            'readBytes': {
                path: "/target/transparent/read-bytes",
                methodType: "get",
                returnTypeConverter: "Bytes"
            },
            'readDebug': {
                path: "/target/debug-access",
                methodType: "get",
                returnTypeConverter: "Bytes",
                bodyEncoder: "integer_uint32"
            },
            'reset': {
                path: "/target/reset",
                methodType: "post"
            },
            'send': {
                path: "/target/transparent/send",
                methodType: "post",
                returnTypeConverter: "Bytes",
                bodyEncoder: "Bytes"
            },
            'sendReceive': {
                path: "/target/transparent/send-receive",
                methodType: "get",
                returnTypeConverter: "Bytes",
                bodyEncoder: "Bytes"
            },
            'setProtocol': {
                path: "/target/protocol",
                methodType: "post",
                bodyEncoder: "TargetProtocol"
            },
            'setSubProtocol': {
                path: "/target/sub-protocol",
                methodType: "post",
                bodyEncoder: "TargetProtocol"
            },
            'setUARTSettings': {
                path: "/target/uart/settings",
                methodType: "post",
                bodyEncoder: "UartSettings"
            },
            'writeAddress': {
                path: "/target/read-address",
                methodType: "post",
                bodyEncoder: "MemoryWriteInfo"
            },
            'writeDebug': {
                path: "/target/debug-access",
                methodType: "post"
            },
            'writeUARTSettings': {
                path: "/target/uart/settings",
                methodType: "put",
                bodyEncoder: "UartSettings"
            },
        };
        return _this;
    }
    /**
    * Clear communication stats
    *
    * LWM2M path: /1027//11
    * @return void api call
    */
    TargetService.prototype.clearComStats = function () {
        var callOptions = this.resources.clearComStats;
        return this._call(callOptions);
    };
    /**
    * Connect to target
    *
    * LWM2M path: /1027//3
    * @return void api call
    */
    TargetService.prototype.connect = function () {
        var callOptions = this.resources.connect;
        return this._call(callOptions);
    };
    /**
    * Disconnect from target
    *
    * LWM2M path: /1027//4
    * @return void api call
    */
    TargetService.prototype.disconnect = function () {
        var callOptions = this.resources.disconnect;
        return this._call(callOptions);
    };
    /**
    * List available target protocols
    *
    * LWM2M path: /1027//20
    * @return Array<TargetProtocol> api call
    */
    TargetService.prototype.getAvailableProtocols = function () {
        var callOptions = this.resources.getAvailableProtocols;
        return this._call(callOptions);
    };
    /**
    * Get communication stats
    * Get Nb of failed communications and number of successful communications with Target
    * LWM2M path: /1027//11
    * @return TargetComStats api call
    */
    TargetService.prototype.getComStats = function () {
        var callOptions = this.resources.getComStats;
        return this._call(callOptions);
    };
    /**
    * Get core type
    *
    * LWM2M path: /1027//2
    * @return TargetCoreType api call
    */
    TargetService.prototype.getCoreType = function () {
        var callOptions = this.resources.getCoreType;
        return this._call(callOptions);
    };
    /**
    * Get firmware version
    *
    * LWM2M path: /1027//6
    * @return TapVersion api call
    */
    TargetService.prototype.getFirmwareVersion = function () {
        var callOptions = this.resources.getFirmwareVersion;
        return this._call(callOptions);
    };
    /**
    * Get max voltage
    *
    * LWM2M path: /1027//9
    * @return number api call
    */
    TargetService.prototype.getMaxVoltage = function () {
        var callOptions = this.resources.getMaxVoltage;
        return this._call(callOptions);
    };
    /**
    * Get min voltage
    *
    * LWM2M path: /1027//8
    * @return number api call
    */
    TargetService.prototype.getMinVoltage = function () {
        var callOptions = this.resources.getMinVoltage;
        return this._call(callOptions);
    };
    /**
    * Get page size
    * Alignement page (TAR)
    * LWM2M path: /1027//10
    * @return number api call
    */
    TargetService.prototype.getPageSize = function () {
        var callOptions = this.resources.getPageSize;
        return this._call(callOptions);
    };
    /**
    * Get target protocol
    *
    * LWM2M path: /1027//1
    * @return TargetProtocol api call
    */
    TargetService.prototype.getProtocol = function () {
        var callOptions = this.resources.getProtocol;
        return this._call(callOptions);
    };
    /**
    * Get byte length received in buffer (when using serial communication)
    *
    * LWM2M path: /1027//43
    * @return number api call
    */
    TargetService.prototype.getReceivedCount = function () {
        var callOptions = this.resources.getReceivedCount;
        return this._call(callOptions);
    };
    /**
    * Register access
    * Access registres (Cortex&#x3D;&gt;R0...R15) de la cible.  Accès conditionné par les ACLs du Bundle Debug (-2)
    * LWM2M path: /1027//32
    * @return Uint8Array api call
    */
    TargetService.prototype.getRegisterAccess = function () {
        var callOptions = this.resources.getRegisterAccess;
        return this._call(callOptions);
    };
    /**
    * Get current sub protocol
    *
    * LWM2M path: /1027//40
    * @return TargetProtocol api call
    */
    TargetService.prototype.getSubProtocol = function () {
        var callOptions = this.resources.getSubProtocol;
        return this._call(callOptions);
    };
    /**
    * Données de config du protocole (baudrate MODBus, chainage JTAG, etc.) Taille variable, fixée au premier write après le reset factory.
    *
    * LWM2M path: /1027//21
    * @return UartSettings api call
    */
    TargetService.prototype.getUARTSettings = function () {
        var callOptions = this.resources.getUARTSettings;
        return this._call(callOptions);
    };
    /**
    * Get vcc
    * Lit la valeur de la tension de la cible
    * LWM2M path: /1027//7
    * @return number api call
    */
    TargetService.prototype.getVcc = function () {
        var callOptions = this.resources.getVcc;
        return this._call(callOptions);
    };
    /**
    * Generic modbus read
    *
    * LWM2M path: /1027//38
    * Body converter id: "ModbusOptions"

    * @tapVersion(">=1.0")
    *
    * @param data input
    * @return Uint8Array api call
    */
    TargetService.prototype.modbusRead = function (data) {
        var callOptions = this.resources.modbusRead;
        callOptions.body = data;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Generic modbus write
    *
    * LWM2M path: /1027//37
    * Body converter id: "ModbusWriteOptions"

    * @tapVersion(">=1.0")
    *
    * @param data input
    * @return void api call
    */
    TargetService.prototype.modbusWrite = function (data) {
        var callOptions = this.resources.modbusWrite;
        callOptions.body = data;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write register value
    *
    * LWM2M path: /1027//32
    * @return void api call
    */
    TargetService.prototype.postRegisterAccess = function () {
        var callOptions = this.resources.postRegisterAccess;
        return this._call(callOptions);
    };
    /**
    * Reset target
    * Reset de la cible (RST&#x3D;0) et maintient en Reset. Le relachement se fait par Reset (plus haut). Accès conditionné par les ACLs du Bundle réservé Debug (-2) si il existe, sinon Admin seulement
    * LWM2M path: /1027//30
    * @return void api call
    */
    TargetService.prototype.postResetKeep = function () {
        var callOptions = this.resources.postResetKeep;
        return this._call(callOptions);
    };
    /**
    * Write core type
    *
    * LWM2M path: /1027//2
    * Body converter id: "TargetCoreType"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.putCoreType = function (value) {
        var callOptions = this.resources.putCoreType;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write firmware version
    *
    * LWM2M path: /1027//6
    * Body converter id: "TapVersion"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.putFirmwareVersion = function (value) {
        var callOptions = this.resources.putFirmwareVersion;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write max voltage value
    *
    * LWM2M path: /1027//9
    * Body converter id: "integer_uint16"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.putMaxVoltage = function (value) {
        var callOptions = this.resources.putMaxVoltage;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write min voltage value
    *
    * LWM2M path: /1027//8
    * Body converter id: "integer_uint16"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.putMinVoltage = function (value) {
        var callOptions = this.resources.putMinVoltage;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write page size
    *
    * LWM2M path: /1027//10
    * Body converter id: "integer_uint32"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.putPageSize = function (value) {
        var callOptions = this.resources.putPageSize;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Configure target protocol
    *
    * LWM2M path: /1027//1
    * Body converter id: "TargetProtocol"

    * @tapVersion(">=1.0")
    *
    * @param targetProtocol input
    * @return void api call
    */
    TargetService.prototype.putProtocol = function (targetProtocol) {
        var callOptions = this.resources.putProtocol;
        callOptions.body = targetProtocol;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Read memory at given address on the target application
    *
    * LWM2M path: /1027//33
    * Body converter id: "MemoryInfo"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return Uint8Array api call
    */
    TargetService.prototype.readAddress = function (value) {
        var callOptions = this.resources.readAddress;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Read data transparent mode with limit
    * Lecture de données de la target en mode transparent ou semi-transparent   si il y en a, sans attente.
    * LWM2M path: /1027//35
    * @return Uint8Array api call
    */
    TargetService.prototype.readBytes = function () {
        var callOptions = this.resources.readBytes;
        return this._call(callOptions);
    };
    /**
    * Debug access
    * Access registres de contrôle (SWD&#x3D;&gt;APDP) de la cible.  Accès conditionné par les ACLs du Bundle Debug (-2)
    * LWM2M path: /1027//31
    * Body converter id: "integer_uint32"

    * @tapVersion(">=1.0")
    *
    * @param address input
    * @return Uint8Array api call
    */
    TargetService.prototype.readDebug = function (address) {
        var callOptions = this.resources.readDebug;
        callOptions.body = address;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Reset target
    * Reset de la cible. (Reset &#x3D;0, wait, Reset &#x3D; 1) utilisé pour relacher le reset après utilisation de ResetKeep.  Accès conditionné par les ACLs du Bundle Debug (-2)
    * LWM2M path: /1027//5
    * @return void api call
    */
    TargetService.prototype.reset = function () {
        var callOptions = this.resources.reset;
        return this._call(callOptions);
    };
    /**
    * Transparent send
    * Send data to the target application
    * LWM2M path: /1027//34
    * Body converter id: "Bytes"

    * @tapVersion(">=1.0")
    *
    * @param data input
    * @return Uint8Array api call
    */
    TargetService.prototype.send = function (data) {
        var callOptions = this.resources.send;
        callOptions.body = data;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Transparent send and receive
    * Send data to the target application and expect response length
    * LWM2M path: /1027//34
    * Body converter id: "Bytes"

    * @tapVersion(">=1.0")
    *
    * @param data input
    * @return Uint8Array api call
    */
    TargetService.prototype.sendReceive = function (data) {
        var callOptions = this.resources.sendReceive;
        callOptions.body = data;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write target protocol
    *
    * LWM2M path: /1027//1
    * Body converter id: "TargetProtocol"

    * @tapVersion(">=1.0")
    *
    * @param targetProtocol input
    * @return void api call
    */
    TargetService.prototype.setProtocol = function (targetProtocol) {
        var callOptions = this.resources.setProtocol;
        callOptions.body = targetProtocol;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Set current sub protocol
    *
    * LWM2M path: /1027//40
    * Body converter id: "TargetProtocol"

    * @tapVersion(">=1.0")
    *
    * @param data input
    * @return void api call
    */
    TargetService.prototype.setSubProtocol = function (data) {
        var callOptions = this.resources.setSubProtocol;
        callOptions.body = data;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Temporary update configuration
    * Execute permet de changer la valeur (mais pas la taille) courante de manière temporaire. Elle sera réinitialisée au reset d&#39;après la valeur configurée.
    * LWM2M path: /1027//21
    * Body converter id: "UartSettings"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.setUARTSettings = function (value) {
        var callOptions = this.resources.setUARTSettings;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write into memory on target
    *
    * LWM2M path: /1027//33
    * Body converter id: "MemoryWriteInfo"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.writeAddress = function (value) {
        var callOptions = this.resources.writeAddress;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    /**
    * Write address
    *
    * LWM2M path: /1027//31
    * @return void api call
    */
    TargetService.prototype.writeDebug = function () {
        var callOptions = this.resources.writeDebug;
        return this._call(callOptions);
    };
    /**
    * Update configuration
    * Put permet de changer la valeur (mais pas la taille) courante de manière permanente
    * LWM2M path: /1027//21
    * Body converter id: "UartSettings"

    * @tapVersion(">=1.0")
    *
    * @param value input
    * @return void api call
    */
    TargetService.prototype.writeUARTSettings = function (value) {
        var callOptions = this.resources.writeUARTSettings;
        callOptions.body = value;
        callOptions.pathParameters = {};
        return this._call(callOptions);
    };
    return TargetService;
}(abstract_service_1.AbstractService));
exports.TargetService = TargetService;
