pull in new policy updates
[profile/ivi/smartdevicelink.git] / src / components / policy / src / policy / policy_table / table_struct_ext / validation.cc
1 // This file is generated, do not edit
2 #include "./types.h"
3
4 namespace rpc {
5 namespace policy_table_interface_base {
6 bool ApplicationParams::Validate() const {
7   if (is_initialized()) {
8     if (preconsented_groups.is_initialized()) {
9       const Strings& all = groups;
10       const Strings& preconsented = *preconsented_groups;
11       if (preconsented.size() > all.size()) {
12         return false;
13       }
14     }
15   }
16   return true;
17 }
18 bool RpcParameters::Validate() const {
19   return true;
20 }
21 bool Rpcs::Validate() const {
22   return true;
23 }
24 bool ModuleConfig::Validate() const {
25   return true;
26 }
27 bool MessageString::Validate() const {
28   return true;
29 }
30 bool MessageLanguages::Validate() const {
31   return true;
32 }
33 bool ConsumerFriendlyMessages::Validate() const {
34   return true;
35 }
36 bool ModuleMeta::Validate() const {
37   return true;
38 }
39 bool AppLevel::Validate() const {
40   return true;
41 }
42 bool UsageAndErrorCounts::Validate() const {
43   return true;
44 }
45 bool ConsentRecords::Validate() const {
46   return true;
47 }
48 bool DeviceParams::Validate() const {
49   return true;
50 }
51 bool PolicyTable::Validate() const {
52   for (ApplicationPolicies::const_iterator it = app_policies.begin();
53        app_policies.end() != it; ++it) {
54     if (kDeviceApp == it->first) {
55       if (it->second.AppHMIType.is_initialized()
56           || it->second.memory_kb.is_initialized()
57           || it->second.heart_beat_timeout_ms.is_initialized()
58           || it->second.nicknames.is_initialized()) {
59         initialization_state__ = kUninitialized;
60         return false;
61       }
62       continue;
63     }
64     if (kDefaultApp == it->first || kPreDataConsentApp == it->first) {
65       if (!it->second.memory_kb.is_initialized()
66           || !it->second.heart_beat_timeout_ms.is_initialized()
67           || it->second.nicknames.is_initialized()) {
68         initialization_state__ = kUninitialized;
69         return false;
70       }
71       continue;
72     }
73     if (!it->second.is_null() && !it->second.is_string()
74         && (!it->second.nicknames.is_initialized()
75             || !it->second.AppHMIType.is_initialized()
76             || !it->second.memory_kb.is_initialized()
77             || !it->second.heart_beat_timeout_ms.is_initialized())) {
78       initialization_state__ = kUninitialized;
79       return false;
80     }
81   }
82   if (consumer_friendly_messages.is_initialized()) {
83     if (!(*consumer_friendly_messages).messages.is_initialized()) {
84       return false;
85     }
86   }
87   return true;
88 }
89 bool Table::Validate() const {
90   return true;
91 }
92 }  // namespace policy_table_interface_base
93 }  // namespace rpc
94