Fawkes API Fawkes Development Version
SkillInfo.h
1
2/****************************************************************************
3 * BehaviorEngine -- Schema SkillInfo
4 * (auto-generated, do not modify directly)
5 *
6 * Behavior Engine REST API.
7 * Visualize, monitor, and instruct the Skill Execution Run-Time of
8 * the Lua-based Behavior Engine.
9 *
10 * API Contact: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
11 * API Version: v1beta1
12 * API License: Apache 2.0
13 ****************************************************************************/
14
15#pragma once
16
17#define RAPIDJSON_HAS_STDSTRING 1
18#include <rapidjson/fwd.h>
19
20#include <cstdint>
21#include <memory>
22#include <optional>
23#include <string>
24#include <vector>
25
26/** SkillInfo representation for JSON transfer. */
28
29{
30public:
31 /** Constructor. */
32 SkillInfo();
33 /** Constructor from JSON.
34 * @param json JSON string to initialize from
35 */
36 SkillInfo(const std::string &json);
37 /** Constructor from JSON.
38 * @param v RapidJSON value object to initialize from.
39 */
40 SkillInfo(const rapidjson::Value &v);
41
42 /** Destructor. */
43 virtual ~SkillInfo();
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: SkillInfo
88public:
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>
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
141private:
142 std::optional<std::string> kind_;
143 std::optional<std::string> apiVersion_;
144 std::optional<std::string> name_;
145};
SkillInfo representation for JSON transfer.
Definition: SkillInfo.h:29
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
Definition: SkillInfo.cpp:43
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
Definition: SkillInfo.cpp:87
void set_name(const std::string &name)
Set name value.
Definition: SkillInfo.h:136
std::optional< std::string > name() const
Get name value.
Definition: SkillInfo.h:127
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
Definition: SkillInfo.cpp:110
SkillInfo()
Constructor.
Definition: SkillInfo.cpp:24
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
Definition: SkillInfo.cpp:62
std::optional< std::string > apiVersion() const
Get apiVersion value.
Definition: SkillInfo.h:110
std::optional< std::string > kind() const
Get kind value.
Definition: SkillInfo.h:93
static std::string api_version()
Get version of implemented API.
Definition: SkillInfo.h:49
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
Definition: SkillInfo.h:119
virtual ~SkillInfo()
Destructor.
Definition: SkillInfo.cpp:38
void set_kind(const std::string &kind)
Set kind value.
Definition: SkillInfo.h:102
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.
Definition: SkillInfo.cpp:96