#pragma once #include "report_manager.hpp" #include "types/report_types.hpp" #include #include class ReportParams final { public: ReportParams& reportId(std::string val) { reportIdProperty = std::move(val); return *this; } const std::string& reportId() const { return reportIdProperty; } ReportParams& reportName(std::string val) { reportNameProperty = std::move(val); return *this; } const std::string& reportName() const { return reportNameProperty; } ReportParams& reportingType(const ReportingType val) { reportingTypeProperty = val; return *this; } ReportingType reportingType() const { return reportingTypeProperty; } ReportParams& reportActions(std::vector val) { reportActionsProperty = std::move(val); return *this; } std::vector reportActions() const { return reportActionsProperty; } ReportParams& interval(Milliseconds val) { intervalProperty = val; return *this; } Milliseconds interval() const { return intervalProperty; } ReportParams& enabled(bool val) { enabledProperty = val; return *this; } bool enabled() const { return enabledProperty; } ReportParams& appendLimit(uint64_t val) { appendLimitProperty = val; return *this; } uint64_t appendLimit() const { return appendLimitProperty; } ReportParams& reportUpdates(ReportUpdates val) { reportUpdatesProperty = val; return *this; } ReportUpdates reportUpdates() const { return reportUpdatesProperty; } ReportParams& metricParameters(std::vector val) { metricParametersProperty = std::move(val); return *this; } const std::vector& metricParameters() const { return metricParametersProperty; } private: std::string reportIdProperty = "TestId"; std::string reportNameProperty = "TestReport"; ReportingType reportingTypeProperty = ReportingType::onRequest; std::vector reportActionsProperty; Milliseconds intervalProperty = ReportManager::minInterval; uint64_t appendLimitProperty = 123; ReportUpdates reportUpdatesProperty = ReportUpdates::overwrite; std::vector metricParametersProperty{ {LabeledMetricParameters{ {LabeledSensorInfo{"Service", "/xyz/openbmc_project/sensors/power/p1", "metadata1"}}, OperationType::single, "MetricId1", CollectionTimeScope::point, CollectionDuration(Milliseconds(0u))}, LabeledMetricParameters{ {LabeledSensorInfo{"Service", "/xyz/openbmc_project/sensors/power/p2", "metadata2"}}, OperationType::single, "MetricId2", CollectionTimeScope::point, CollectionDuration(Milliseconds(0u))}}}; bool enabledProperty = true; };