Fawkes API  Fawkes Development Version
GroundedFormula.h
1 
2 /****************************************************************************
3  * ClipsExecutive -- Schema GroundedFormula
4  * (auto-generated, do not modify directly)
5  *
6  * CLIPS Executive REST API.
7  * Enables access to goals, plans, and all items in the domain model.
8  *
9  * API Contact: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
10  * API Version: v1beta1
11  * API License: Apache 2.0
12  ****************************************************************************/
13 
14 #pragma once
15 
16 #define RAPIDJSON_HAS_STDSTRING 1
17 #include "GroundedFormula.h"
18 
19 #include <rapidjson/fwd.h>
20 
21 #include <cstdint>
22 #include <memory>
23 #include <optional>
24 #include <string>
25 #include <vector>
26 
27 /** GroundedFormula representation for JSON transfer. */
29 {
30 public:
31  /** Constructor. */
33  /** Constructor from JSON.
34  * @param json JSON string to initialize from
35  */
36  GroundedFormula(const std::string &json);
37  /** Constructor from JSON.
38  * @param v RapidJSON value object to initialize from.
39  */
40  GroundedFormula(const rapidjson::Value &v);
41 
42  /** Destructor. */
43  virtual ~GroundedFormula();
44 
45  /** Get version of implemented API.
46  * @return string representation of version
47  */
48  static std::string
50  {
51  return "v1beta1";
52  }
53 
54  /** Render object to JSON.
55  * @param pretty true to enable pretty printing (readable spacing)
56  * @return JSON string
57  */
58  virtual std::string to_json(bool pretty = false) const;
59  /** Render object to JSON.
60  * @param d RapidJSON document to retrieve allocator from
61  * @param v RapidJSON value to add data to
62  */
63  virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const;
64  /** Retrieve data from JSON string.
65  * @param json JSON representation suitable for this object.
66  * Will allow partial assignment and not validate automaticaly.
67  * @see validate()
68  */
69  virtual void from_json(const std::string &json);
70  /** Retrieve data from JSON string.
71  * @param v RapidJSON value suitable for this object.
72  * Will allow partial assignment and not validate automaticaly.
73  * @see validate()
74  */
75  virtual void from_json_value(const rapidjson::Value &v);
76 
77  /** Validate if all required fields have been set.
78  * @param subcall true if this is called from another class, e.g.,
79  * a sub-class or array holder. Will modify the kind of exception thrown.
80  * @exception std::vector<std::string> thrown if required information is
81  * missing and @p subcall is set to true. Contains a list of missing fields.
82  * @exception std::runtime_error informative message describing the missing
83  * fields
84  */
85  virtual void validate(bool subcall = false) const;
86 
87  // Schema: GroundedFormula
88 public:
89  /** Get kind value.
90  * @return kind value
91  */
92  std::optional<std::string>
93  kind() const
94  {
95  return kind_;
96  }
97 
98  /** Set kind value.
99  * @param kind new value
100  */
101  void
102  set_kind(const std::string &kind)
103  {
104  kind_ = kind;
105  }
106  /** Get apiVersion value.
107  * @return apiVersion value
108  */
109  std::optional<std::string>
110  apiVersion() const
111  {
112  return apiVersion_;
113  }
114 
115  /** Set apiVersion value.
116  * @param apiVersion new value
117  */
118  void
119  set_apiVersion(const std::string &apiVersion)
120  {
121  apiVersion_ = apiVersion;
122  }
123  /** Get name value.
124  * @return name value
125  */
126  std::optional<std::string>
127  name() const
128  {
129  return name_;
130  }
131 
132  /** Set name value.
133  * @param name new value
134  */
135  void
136  set_name(const std::string &name)
137  {
138  name_ = name;
139  }
140  /** Get type value.
141  * @return type value
142  */
143  std::optional<std::string>
144  type() const
145  {
146  return type_;
147  }
148 
149  /** Set type value.
150  * @param type new value
151  */
152  void
153  set_type(const std::string &type)
154  {
155  type_ = type;
156  }
157  /** Get is-satisfied value.
158  * @return is-satisfied value
159  */
160  std::optional<bool>
161  is_satisfied() const
162  {
163  return is_satisfied_;
164  }
165 
166  /** Set is-satisfied value.
167  * @param is_satisfied new value
168  */
169  void
171  {
172  is_satisfied_ = is_satisfied;
173  }
174  /** Get param-names value.
175  * @return param-names value
176  */
177  std::vector<std::string>
178  param_names() const
179  {
180  return param_names_;
181  }
182 
183  /** Set param-names value.
184  * @param param_names new value
185  */
186  void
187  set_param_names(const std::vector<std::string> &param_names)
188  {
189  param_names_ = param_names;
190  }
191  /** Add element to param-names array.
192  * @param param_names new value
193  */
194  void
195  addto_param_names(const std::string &&param_names)
196  {
197  param_names_.push_back(std::move(param_names));
198  }
199 
200  /** Add element to param-names array.
201  * The move-semantics version (std::move) should be preferred.
202  * @param param_names new value
203  */
204  void
205  addto_param_names(const std::string &param_names)
206  {
207  param_names_.push_back(param_names);
208  }
209  /** Get param-values value.
210  * @return param-values value
211  */
212  std::vector<std::string>
213  param_values() const
214  {
215  return param_values_;
216  }
217 
218  /** Set param-values value.
219  * @param param_values new value
220  */
221  void
222  set_param_values(const std::vector<std::string> &param_values)
223  {
224  param_values_ = param_values;
225  }
226  /** Add element to param-values array.
227  * @param param_values new value
228  */
229  void
230  addto_param_values(const std::string &&param_values)
231  {
232  param_values_.push_back(std::move(param_values));
233  }
234 
235  /** Add element to param-values array.
236  * The move-semantics version (std::move) should be preferred.
237  * @param param_values new value
238  */
239  void
240  addto_param_values(const std::string &param_values)
241  {
242  param_values_.push_back(param_values);
243  }
244  /** Get param-constants value.
245  * @return param-constants value
246  */
247  std::vector<std::string>
249  {
250  return param_constants_;
251  }
252 
253  /** Set param-constants value.
254  * @param param_constants new value
255  */
256  void
257  set_param_constants(const std::vector<std::string> &param_constants)
258  {
259  param_constants_ = param_constants;
260  }
261  /** Add element to param-constants array.
262  * @param param_constants new value
263  */
264  void
266  {
267  param_constants_.push_back(std::move(param_constants));
268  }
269 
270  /** Add element to param-constants array.
271  * The move-semantics version (std::move) should be preferred.
272  * @param param_constants new value
273  */
274  void
276  {
277  param_constants_.push_back(param_constants);
278  }
279  /** Get child value.
280  * @return child value
281  */
282  std::vector<std::shared_ptr<GroundedFormula>>
283  child() const
284  {
285  return child_;
286  }
287 
288  /** Set child value.
289  * @param child new value
290  */
291  void
292  set_child(const std::vector<std::shared_ptr<GroundedFormula>> &child)
293  {
294  child_ = child;
295  }
296  /** Add element to child array.
297  * @param child new value
298  */
299  void
300  addto_child(const std::shared_ptr<GroundedFormula> &&child)
301  {
302  child_.push_back(std::move(child));
303  }
304 
305  /** Add element to child array.
306  * The move-semantics version (std::move) should be preferred.
307  * @param child new value
308  */
309  void
310  addto_child(const std::shared_ptr<GroundedFormula> &child)
311  {
312  child_.push_back(child);
313  }
314  /** Add element to child array.
315  * @param child new value
316  */
317  void
319  {
320  child_.push_back(std::make_shared<GroundedFormula>(std::move(child)));
321  }
322 
323 private:
324  std::optional<std::string> kind_;
325  std::optional<std::string> apiVersion_;
326  std::optional<std::string> name_;
327  std::optional<std::string> type_;
328  std::optional<bool> is_satisfied_;
329  std::vector<std::string> param_names_;
330  std::vector<std::string> param_values_;
331  std::vector<std::string> param_constants_;
332  std::vector<std::shared_ptr<GroundedFormula>> child_;
333 };
GroundedFormula representation for JSON transfer.
static std::string api_version()
Get version of implemented API.
void set_child(const std::vector< std::shared_ptr< GroundedFormula >> &child)
Set child value.
void addto_param_values(const std::string &&param_values)
Add element to param-values array.
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
void addto_param_constants(const std::string &param_constants)
Add element to param-constants array.
void addto_param_constants(const std::string &&param_constants)
Add element to param-constants array.
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.
void addto_child(const GroundedFormula &&child)
Add element to child array.
void addto_param_values(const std::string &param_values)
Add element to param-values array.
void addto_child(const std::shared_ptr< GroundedFormula > &child)
Add element to child array.
void set_param_names(const std::vector< std::string > &param_names)
Set param-names value.
void addto_param_names(const std::string &&param_names)
Add element to param-names array.
std::vector< std::shared_ptr< GroundedFormula > > child() const
Get child value.
std::vector< std::string > param_constants() const
Get param-constants value.
void addto_child(const std::shared_ptr< GroundedFormula > &&child)
Add element to child array.
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
void set_type(const std::string &type)
Set type value.
std::optional< std::string > apiVersion() const
Get apiVersion value.
void set_kind(const std::string &kind)
Set kind value.
std::vector< std::string > param_names() const
Get param-names value.
void set_param_values(const std::vector< std::string > &param_values)
Set param-values value.
GroundedFormula()
Constructor.
void set_param_constants(const std::vector< std::string > &param_constants)
Set param-constants value.
void set_is_satisfied(const bool &is_satisfied)
Set is-satisfied value.
void set_name(const std::string &name)
Set name value.
std::optional< std::string > kind() const
Get kind value.
virtual ~GroundedFormula()
Destructor.
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
std::vector< std::string > param_values() const
Get param-values value.
std::optional< bool > is_satisfied() const
Get is-satisfied value.
std::optional< std::string > name() const
Get name value.
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
void addto_param_names(const std::string &param_names)
Add element to param-names array.
std::optional< std::string > type() const
Get type value.