summaryrefslogtreecommitdiff
path: root/src/components/policy/src/policy/policy_table/table_struct/types.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/src/policy/policy_table/table_struct/types.cc')
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/types.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/policy/src/policy/policy_table/table_struct/types.cc b/src/components/policy/src/policy/policy_table/table_struct/types.cc
index dcbd66dce..fb1daf2b3 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/types.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct/types.cc
@@ -489,6 +489,24 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
vehicle_model(impl::ValueMember(value__, "vehicle_model")),
vehicle_year(impl::ValueMember(value__, "vehicle_year")) {
}
+
+void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
+// device_certificates = from.device_certificates; // According to the requirements this is optional.
+ exchange_after_x_ignition_cycles = from.exchange_after_x_ignition_cycles;
+ exchange_after_x_kilometers = from.exchange_after_x_kilometers;
+ exchange_after_x_days = from.exchange_after_x_days;
+ timeout_after_x_seconds = from.timeout_after_x_seconds;
+ seconds_between_retries = from.seconds_between_retries;
+ endpoints = from.endpoints;
+ notifications_per_minute_by_priority = from.notifications_per_minute_by_priority;
+
+ vehicle_make.assign_if_valid(from.vehicle_make);
+ vehicle_model.assign_if_valid(from.vehicle_model);
+ vehicle_year.assign_if_valid(from.vehicle_year);
+ certificate .assign_if_valid(from.certificate);
+
+}
+
Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("device_certificates", device_certificates, &result__);