Report: make dbus properties writable

ReadingParametersFutureVersion interface for Reports is enhanced from
read-only to read write and supports modification of readingParameteres,
which is done by updating metrics at the first place and re-registering
them for sensors updates. Similar ReportActions interface is enhanced to
read write. Additionally reportActions policy was modified that reports
always contain 'LogToMetricReportsCollection' action. The whole change
enables Redfish support for PATCH method added on webserver side.

Tested:
- New unit tests were created, ran all new and previous UTs, all passed
- Tested under QEMU, interface was checked for RW via dbus cli commands,
  checked if Reading Parameters of the Report can be read or written,
  if metrics are properly updated and registration/unregistration for
  updates works properly, checked if actions of Report can be read or
  written, if actions are properly updated and related action behavior
  follows the change accordingly
- Tested under QEMU, verified if 'LogToMetricReportsCollection' action
  is always added when Report is created or when actions of Report are
  updated by dbus interface
- Tested via webserver if it communicates properly with dbus interfaces
  of Telemetry and read/write operations via Redfish can be successfully
  executed

Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Change-Id: I7f2fe8eae1631c436cf61a516d5fd0b8358a76bd
diff --git a/src/report_factory.hpp b/src/report_factory.hpp
index 14f9f39..8431f40 100644
--- a/src/report_factory.hpp
+++ b/src/report_factory.hpp
@@ -4,6 +4,7 @@
 #include "interfaces/sensor.hpp"
 #include "sensor_cache.hpp"
 #include "types/sensor_types.hpp"
+#include "utils/dbus_mapper.hpp"
 
 #include <boost/asio/io_context.hpp>
 #include <sdbusplus/asio/object_server.hpp>
@@ -20,6 +21,14 @@
         boost::asio::yield_context& yield,
         const ReadingParameters& metricParams) const override;
 
+    std::vector<LabeledMetricParameters> convertMetricParams(
+        const ReadingParameters& metricParams) const override;
+
+    void
+        updateMetrics(std::vector<std::shared_ptr<interfaces::Metric>>& metrics,
+                      bool enabled,
+                      const ReadingParameters& metricParams) const override;
+
     std::unique_ptr<interfaces::Report>
         make(const std::string& reportId, const std::string& name,
              const ReportingType reportingType,
@@ -33,6 +42,9 @@
 
   private:
     Sensors getSensors(const std::vector<LabeledSensorInfo>& sensorPaths) const;
+    std::vector<LabeledMetricParameters> getMetricParamsFromSensorTree(
+        const ReadingParameters& metricParams,
+        const std::vector<utils::SensorTree>& tree) const;
 
     std::shared_ptr<sdbusplus::asio::connection> bus;
     std::shared_ptr<sdbusplus::asio::object_server> objServer;