Fawkes API Fawkes Development Version
Goal.h
1
2/****************************************************************************
3 * ClipsExecutive -- Schema Goal
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
18#include <rapidjson/fwd.h>
19
20#include <cstdint>
21#include <memory>
22#include <optional>
23#include <string>
24#include <vector>
25
26/** Goal representation for JSON transfer. */
27class Goal
28{
29public:
30 /** Constructor. */
31 Goal();
32 /** Constructor from JSON.
33 * @param json JSON string to initialize from
34 */
35 Goal(const std::string &json);
36 /** Constructor from JSON.
37 * @param v RapidJSON value object to initialize from.
38 */
39 Goal(const rapidjson::Value &v);
40
41 /** Destructor. */
42 virtual ~Goal();
43
44 /** Get version of implemented API.
45 * @return string representation of version
46 */
47 static std::string
49 {
50 return "v1beta1";
51 }
52
53 /** Render object to JSON.
54 * @param pretty true to enable pretty printing (readable spacing)
55 * @return JSON string
56 */
57 virtual std::string to_json(bool pretty = false) const;
58 /** Render object to JSON.
59 * @param d RapidJSON document to retrieve allocator from
60 * @param v RapidJSON value to add data to
61 */
62 virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const;
63 /** Retrieve data from JSON string.
64 * @param json JSON representation suitable for this object.
65 * Will allow partial assignment and not validate automaticaly.
66 * @see validate()
67 */
68 virtual void from_json(const std::string &json);
69 /** Retrieve data from JSON string.
70 * @param v RapidJSON value suitable for this object.
71 * Will allow partial assignment and not validate automaticaly.
72 * @see validate()
73 */
74 virtual void from_json_value(const rapidjson::Value &v);
75
76 /** Validate if all required fields have been set.
77 * @param subcall true if this is called from another class, e.g.,
78 * a sub-class or array holder. Will modify the kind of exception thrown.
79 * @exception std::vector<std::string> thrown if required information is
80 * missing and @p subcall is set to true. Contains a list of missing fields.
81 * @exception std::runtime_error informative message describing the missing
82 * fields
83 */
84 virtual void validate(bool subcall = false) const;
85
86 // Schema: Goal
87public:
88 /** Get kind value.
89 * @return kind value
90 */
91 std::optional<std::string>
92 kind() const
93 {
94 return kind_;
95 }
96
97 /** Set kind value.
98 * @param kind new value
99 */
100 void
101 set_kind(const std::string &kind)
102 {
103 kind_ = kind;
104 }
105 /** Get apiVersion value.
106 * @return apiVersion value
107 */
108 std::optional<std::string>
110 {
111 return apiVersion_;
112 }
113
114 /** Set apiVersion value.
115 * @param apiVersion new value
116 */
117 void
118 set_apiVersion(const std::string &apiVersion)
119 {
120 apiVersion_ = apiVersion;
121 }
122 /** Get id value.
123 * @return id value
124 */
125 std::optional<std::string>
126 id() const
127 {
128 return id_;
129 }
130
131 /** Set id value.
132 * @param id new value
133 */
134 void
135 set_id(const std::string &id)
136 {
137 id_ = id;
138 }
139 /** Get type value.
140 * @return type value
141 */
142 std::optional<std::string>
143 type() const
144 {
145 return type_;
146 }
147
148 /** Set type value.
149 * @param type new value
150 */
151 void
152 set_type(const std::string &type)
153 {
154 type_ = type;
155 }
156 /** Get sub-type value.
157 * @return sub-type value
158 */
159 std::optional<std::string>
160 sub_type() const
161 {
162 return sub_type_;
163 }
164
165 /** Set sub-type value.
166 * @param sub_type new value
167 */
168 void
169 set_sub_type(const std::string &sub_type)
170 {
171 sub_type_ = sub_type;
172 }
173 /** Get class value.
174 * @return class value
175 */
176 std::optional<std::string>
177 _class() const
178 {
179 return _class_;
180 }
181
182 /** Set class value.
183 * @param _class new value
184 */
185 void
186 set__class(const std::string &_class)
187 {
188 _class_ = _class;
189 }
190 /** Get mode value.
191 * @return mode value
192 */
193 std::optional<std::string>
194 mode() const
195 {
196 return mode_;
197 }
198
199 /** Set mode value.
200 * @param mode new value
201 */
202 void
203 set_mode(const std::string &mode)
204 {
205 mode_ = mode;
206 }
207 /** Get outcome value.
208 * @return outcome value
209 */
210 std::optional<std::string>
211 outcome() const
212 {
213 return outcome_;
214 }
215
216 /** Set outcome value.
217 * @param outcome new value
218 */
219 void
220 set_outcome(const std::string &outcome)
221 {
222 outcome_ = outcome;
223 }
224 /** Get error value.
225 * @return error value
226 */
227 std::vector<std::string>
228 error() const
229 {
230 return error_;
231 }
232
233 /** Set error value.
234 * @param error new value
235 */
236 void
237 set_error(const std::vector<std::string> &error)
238 {
239 error_ = error;
240 }
241 /** Add element to error array.
242 * @param error new value
243 */
244 void
245 addto_error(const std::string &&error)
246 {
247 error_.push_back(std::move(error));
248 }
249
250 /** Add element to error array.
251 * The move-semantics version (std::move) should be preferred.
252 * @param error new value
253 */
254 void
255 addto_error(const std::string &error)
256 {
257 error_.push_back(error);
258 }
259 /** Get message value.
260 * @return message value
261 */
262 std::optional<std::string>
263 message() const
264 {
265 return message_;
266 }
267
268 /** Set message value.
269 * @param message new value
270 */
271 void
272 set_message(const std::string &message)
273 {
274 message_ = message;
275 }
276 /** Get parent value.
277 * @return parent value
278 */
279 std::optional<std::string>
280 parent() const
281 {
282 return parent_;
283 }
284
285 /** Set parent value.
286 * @param parent new value
287 */
288 void
289 set_parent(const std::string &parent)
290 {
291 parent_ = parent;
292 }
293 /** Get priority value.
294 * @return priority value
295 */
296 std::optional<int64_t>
297 priority() const
298 {
299 return priority_;
300 }
301
302 /** Set priority value.
303 * @param priority new value
304 */
305 void
306 set_priority(const int64_t &priority)
307 {
308 priority_ = priority;
309 }
310 /** Get parameters value.
311 * @return parameters value
312 */
313 std::vector<std::string>
315 {
316 return parameters_;
317 }
318
319 /** Set parameters value.
320 * @param parameters new value
321 */
322 void
323 set_parameters(const std::vector<std::string> &parameters)
324 {
325 parameters_ = parameters;
326 }
327 /** Add element to parameters array.
328 * @param parameters new value
329 */
330 void
331 addto_parameters(const std::string &&parameters)
332 {
333 parameters_.push_back(std::move(parameters));
334 }
335
336 /** Add element to parameters array.
337 * The move-semantics version (std::move) should be preferred.
338 * @param parameters new value
339 */
340 void
341 addto_parameters(const std::string &parameters)
342 {
343 parameters_.push_back(parameters);
344 }
345 /** Get meta value.
346 * @return meta value
347 */
348 std::vector<std::string>
349 meta() const
350 {
351 return meta_;
352 }
353
354 /** Set meta value.
355 * @param meta new value
356 */
357 void
358 set_meta(const std::vector<std::string> &meta)
359 {
360 meta_ = meta;
361 }
362 /** Add element to meta array.
363 * @param meta new value
364 */
365 void
366 addto_meta(const std::string &&meta)
367 {
368 meta_.push_back(std::move(meta));
369 }
370
371 /** Add element to meta array.
372 * The move-semantics version (std::move) should be preferred.
373 * @param meta new value
374 */
375 void
376 addto_meta(const std::string &meta)
377 {
378 meta_.push_back(meta);
379 }
380 /** Get plans value.
381 * @return plans value
382 */
383 std::vector<std::string>
384 plans() const
385 {
386 return plans_;
387 }
388
389 /** Set plans value.
390 * @param plans new value
391 */
392 void
393 set_plans(const std::vector<std::string> &plans)
394 {
395 plans_ = plans;
396 }
397 /** Add element to plans array.
398 * @param plans new value
399 */
400 void
401 addto_plans(const std::string &&plans)
402 {
403 plans_.push_back(std::move(plans));
404 }
405
406 /** Add element to plans array.
407 * The move-semantics version (std::move) should be preferred.
408 * @param plans new value
409 */
410 void
411 addto_plans(const std::string &plans)
412 {
413 plans_.push_back(plans);
414 }
415 /** Get required-resources value.
416 * @return required-resources value
417 */
418 std::vector<std::string>
420 {
421 return required_resources_;
422 }
423
424 /** Set required-resources value.
425 * @param required_resources new value
426 */
427 void
428 set_required_resources(const std::vector<std::string> &required_resources)
429 {
430 required_resources_ = required_resources;
431 }
432 /** Add element to required-resources array.
433 * @param required_resources new value
434 */
435 void
437 {
438 required_resources_.push_back(std::move(required_resources));
439 }
440
441 /** Add element to required-resources array.
442 * The move-semantics version (std::move) should be preferred.
443 * @param required_resources new value
444 */
445 void
447 {
448 required_resources_.push_back(required_resources);
449 }
450 /** Get acquired-resources value.
451 * @return acquired-resources value
452 */
453 std::vector<std::string>
455 {
456 return acquired_resources_;
457 }
458
459 /** Set acquired-resources value.
460 * @param acquired_resources new value
461 */
462 void
463 set_acquired_resources(const std::vector<std::string> &acquired_resources)
464 {
465 acquired_resources_ = acquired_resources;
466 }
467 /** Add element to acquired-resources array.
468 * @param acquired_resources new value
469 */
470 void
472 {
473 acquired_resources_.push_back(std::move(acquired_resources));
474 }
475
476 /** Add element to acquired-resources array.
477 * The move-semantics version (std::move) should be preferred.
478 * @param acquired_resources new value
479 */
480 void
482 {
483 acquired_resources_.push_back(acquired_resources);
484 }
485
486private:
487 std::optional<std::string> kind_;
488 std::optional<std::string> apiVersion_;
489 std::optional<std::string> id_;
490 std::optional<std::string> type_;
491 std::optional<std::string> sub_type_;
492 std::optional<std::string> _class_;
493 std::optional<std::string> mode_;
494 std::optional<std::string> outcome_;
495 std::vector<std::string> error_;
496 std::optional<std::string> message_;
497 std::optional<std::string> parent_;
498 std::optional<int64_t> priority_;
499 std::vector<std::string> parameters_;
500 std::vector<std::string> meta_;
501 std::vector<std::string> plans_;
502 std::vector<std::string> required_resources_;
503 std::vector<std::string> acquired_resources_;
504};
Goal representation for JSON transfer.
Definition: Goal.h:28
std::optional< std::string > message() const
Get message value.
Definition: Goal.h:263
std::vector< std::string > error() const
Get error value.
Definition: Goal.h:228
virtual ~Goal()
Destructor.
Definition: Goal.cpp:38
std::vector< std::string > parameters() const
Get parameters value.
Definition: Goal.h:314
std::optional< std::string > mode() const
Get mode value.
Definition: Goal.h:194
void addto_meta(const std::string &&meta)
Add element to meta array.
Definition: Goal.h:366
void addto_error(const std::string &&error)
Add element to error array.
Definition: Goal.h:245
void set_message(const std::string &message)
Set message value.
Definition: Goal.h:272
void set_acquired_resources(const std::vector< std::string > &acquired_resources)
Set acquired-resources value.
Definition: Goal.h:463
std::vector< std::string > required_resources() const
Get required-resources value.
Definition: Goal.h:419
std::optional< std::string > _class() const
Get class value.
Definition: Goal.h:177
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
Definition: Goal.cpp:276
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
Definition: Goal.cpp:43
void set_parameters(const std::vector< std::string > &parameters)
Set parameters value.
Definition: Goal.h:323
std::vector< std::string > meta() const
Get meta value.
Definition: Goal.h:349
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
Definition: Goal.cpp:175
void set_id(const std::string &id)
Set id value.
Definition: Goal.h:135
void set_mode(const std::string &mode)
Set mode value.
Definition: Goal.h:203
std::vector< std::string > acquired_resources() const
Get acquired-resources value.
Definition: Goal.h:454
void addto_meta(const std::string &meta)
Add element to meta array.
Definition: Goal.h:376
void set_sub_type(const std::string &sub_type)
Set sub-type value.
Definition: Goal.h:169
void set_meta(const std::vector< std::string > &meta)
Set meta value.
Definition: Goal.h:358
void set_parent(const std::string &parent)
Set parent value.
Definition: Goal.h:289
void set_required_resources(const std::vector< std::string > &required_resources)
Set required-resources value.
Definition: Goal.h:428
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.
Definition: Goal.cpp:184
void set_plans(const std::vector< std::string > &plans)
Set plans value.
Definition: Goal.h:393
std::optional< std::string > id() const
Get id value.
Definition: Goal.h:126
std::optional< std::string > type() const
Get type value.
Definition: Goal.h:143
void addto_plans(const std::string &plans)
Add element to plans array.
Definition: Goal.h:411
void addto_acquired_resources(const std::string &&acquired_resources)
Add element to acquired-resources array.
Definition: Goal.h:471
void addto_parameters(const std::string &parameters)
Add element to parameters array.
Definition: Goal.h:341
void set_outcome(const std::string &outcome)
Set outcome value.
Definition: Goal.h:220
void addto_required_resources(const std::string &&required_resources)
Add element to required-resources array.
Definition: Goal.h:436
std::optional< std::string > outcome() const
Get outcome value.
Definition: Goal.h:211
std::optional< std::string > kind() const
Get kind value.
Definition: Goal.h:92
std::optional< std::string > sub_type() const
Get sub-type value.
Definition: Goal.h:160
void set__class(const std::string &_class)
Set class value.
Definition: Goal.h:186
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
Definition: Goal.cpp:62
void addto_acquired_resources(const std::string &acquired_resources)
Add element to acquired-resources array.
Definition: Goal.h:481
std::optional< int64_t > priority() const
Get priority value.
Definition: Goal.h:297
void set_kind(const std::string &kind)
Set kind value.
Definition: Goal.h:101
static std::string api_version()
Get version of implemented API.
Definition: Goal.h:48
void addto_plans(const std::string &&plans)
Add element to plans array.
Definition: Goal.h:401
void addto_error(const std::string &error)
Add element to error array.
Definition: Goal.h:255
void set_priority(const int64_t &priority)
Set priority value.
Definition: Goal.h:306
void addto_required_resources(const std::string &required_resources)
Add element to required-resources array.
Definition: Goal.h:446
void addto_parameters(const std::string &&parameters)
Add element to parameters array.
Definition: Goal.h:331
void set_error(const std::vector< std::string > &error)
Set error value.
Definition: Goal.h:237
std::optional< std::string > apiVersion() const
Get apiVersion value.
Definition: Goal.h:109
Goal()
Constructor.
Definition: Goal.cpp:24
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
Definition: Goal.h:118
std::vector< std::string > plans() const
Get plans value.
Definition: Goal.h:384
std::optional< std::string > parent() const
Get parent value.
Definition: Goal.h:280
void set_type(const std::string &type)
Set type value.
Definition: Goal.h:152