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 = (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);
};
import { SERVICE_CALLS } from "./service-calls";
import { AbstractService } from "@iotize/tap";
var SinglePacketService = /** @class */ (function (_super) {
    __extends(SinglePacketService, _super);
    function SinglePacketService() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.resources = SERVICE_CALLS;
        return _this;
    }
    /**
     * Get information concerning Single Packet Store Status
     *
     * LWM2M path: /1024//81
     *
     * @tapVersion(">=1.13")
     * @return
     */
    SinglePacketService.prototype.getInfo = function () {
        return this.serviceCallRunner.execute(this.getInfoCall());
    };
    /**
     *
     *
     * LWM2M path: /1024//81
     *
     * @tapVersion(">=1.13")
     * @return call options
     */
    SinglePacketService.prototype.getInfoCall = function () {
        var callOptions = __assign({}, this.resources.getInfo);
        return callOptions;
    };
    /**
     * Send a complete Small Single Packet to the TAP as bytes. Size of the packet < 120 bytes
     *
     * LWM2M path: /1024//80
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return
     */
    SinglePacketService.prototype.writeAndExecuteBytes = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.writeAndExecuteBytesCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1024//80
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return call options
     */
    SinglePacketService.prototype.writeAndExecuteBytesCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign({}, this.resources.writeAndExecuteBytes);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Send and execute the given Single Packet in one request
     *
     * LWM2M path: /1024//80
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return
     */
    SinglePacketService.prototype.writeAndExecute = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.writeAndExecuteCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1024//80
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return call options
     */
    SinglePacketService.prototype.writeAndExecuteCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign({}, this.resources.writeAndExecute);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Write single packet chunk
     *
     * LWM2M path: /1024//82
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return
     */
    SinglePacketService.prototype.writeChunk = function (
    /*
     *
     */
    data) {
        return this.serviceCallRunner.execute(this.writeChunkCall(data));
    };
    /**
     *
     *
     * LWM2M path: /1024//82
     *
     * @tapVersion(">=1.13")
     * @param data input
     * @return call options
     */
    SinglePacketService.prototype.writeChunkCall = function (
    /*
     *
     */
    data) {
        var callOptions = __assign({}, this.resources.writeChunk);
        callOptions.body = data;
        return callOptions;
    };
    /**
     * Execute single packet stored in Tap storage
     *
     * LWM2M path: /1024//83
     *
     * @tapVersion(">=1.13")
     * @param crc input
     * @return
     */
    SinglePacketService.prototype.executeSinglePacketInStore = function (
    /*
     * CRC of the single packet stored in Tap storage.
     */
    crc) {
        return this.serviceCallRunner.execute(this.executeSinglePacketInStoreCall(crc));
    };
    /**
     *
     *
     * LWM2M path: /1024//83
     *
     * @tapVersion(">=1.13")
     * @param crc input
     * @return call options
     */
    SinglePacketService.prototype.executeSinglePacketInStoreCall = function (
    /*
     * CRC of the single packet stored in Tap storage.
     */
    crc) {
        var callOptions = __assign({}, this.resources.executeSinglePacketInStore);
        callOptions.body = crc;
        return callOptions;
    };
    return SinglePacketService;
}(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