"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateTrackableObjectState = void 0;
const robotics_types_1 = require("../../../controllers/robotics-types");
const integration_base_1 = require("@things-factory/integration-base");
exports.updateTrackableObjectState = {
    async updateTrackableObjectState(_, { name, state }, context) {
        const { domain } = context.state;
        var connection = integration_base_1.ConnectionManager.getConnectionInstance(domain, name);
        if (!connection || connection.discriminator !== robotics_types_1.ROBOTICS_OBJECT_TYPES.OBJECT) {
            throw Error(`TrackableObject '${name}' Not Found`);
        }
        connection.state = state;
        return Object.assign({}, connection);
    }
};
//# sourceMappingURL=update-trackable-object-state.js.map