Fawkes API  Fawkes Development Version
DomainOperator.h
1 
2 /****************************************************************************
3  * ClipsExecutive -- Schema DomainOperator
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 "DomainOperatorParameter.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 /** DomainOperator representation for JSON transfer. */
29 {
30 public:
31  /** Constructor. */
33  /** Constructor from JSON.
34  * @param json JSON string to initialize from
35  */
36  DomainOperator(const std::string &json);
37  /** Constructor from JSON.
38  * @param v RapidJSON value object to initialize from.
39  */
40  DomainOperator(const rapidjson::Value &v);
41 
42  /** Destructor. */
43  virtual ~DomainOperator();
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: DomainOperator
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 wait-sensed value.
141  * @return wait-sensed value
142  */
143  std::optional<bool>
144  wait_sensed() const
145  {
146  return wait_sensed_;
147  }
148 
149  /** Set wait-sensed value.
150  * @param wait_sensed new value
151  */
152  void
154  {
155  wait_sensed_ = wait_sensed;
156  }
157  /** Get parameters value.
158  * @return parameters value
159  */
160  std::vector<std::shared_ptr<DomainOperatorParameter>>
161  parameters() const
162  {
163  return parameters_;
164  }
165 
166  /** Set parameters value.
167  * @param parameters new value
168  */
169  void
170  set_parameters(const std::vector<std::shared_ptr<DomainOperatorParameter>> &parameters)
171  {
172  parameters_ = parameters;
173  }
174  /** Add element to parameters array.
175  * @param parameters new value
176  */
177  void
178  addto_parameters(const std::shared_ptr<DomainOperatorParameter> &&parameters)
179  {
180  parameters_.push_back(std::move(parameters));
181  }
182 
183  /** Add element to parameters array.
184  * The move-semantics version (std::move) should be preferred.
185  * @param parameters new value
186  */
187  void
188  addto_parameters(const std::shared_ptr<DomainOperatorParameter> &parameters)
189  {
190  parameters_.push_back(parameters);
191  }
192  /** Add element to parameters array.
193  * @param parameters new value
194  */
195  void
197  {
198  parameters_.push_back(std::make_shared<DomainOperatorParameter>(std::move(parameters)));
199  }
200 
201 private:
202  std::optional<std::string> kind_;
203  std::optional<std::string> apiVersion_;
204  std::optional<std::string> name_;
205  std::optional<bool> wait_sensed_;
206  std::vector<std::shared_ptr<DomainOperatorParameter>> parameters_;
207 };
DomainOperatorParameter representation for JSON transfer.
DomainOperator representation for JSON transfer.
std::optional< std::string > kind() const
Get kind value.
void addto_parameters(const std::shared_ptr< DomainOperatorParameter > &&parameters)
Add element to parameters array.
DomainOperator()
Constructor.
std::optional< bool > wait_sensed() const
Get wait-sensed value.
std::optional< std::string > apiVersion() const
Get apiVersion value.
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
std::vector< std::shared_ptr< DomainOperatorParameter > > parameters() const
Get parameters value.
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
void set_kind(const std::string &kind)
Set kind value.
virtual ~DomainOperator()
Destructor.
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
void set_parameters(const std::vector< std::shared_ptr< DomainOperatorParameter >> &parameters)
Set parameters value.
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
static std::string api_version()
Get version of implemented API.
void set_name(const std::string &name)
Set name value.
void addto_parameters(const DomainOperatorParameter &&parameters)
Add element to parameters array.
void addto_parameters(const std::shared_ptr< DomainOperatorParameter > &parameters)
Add element to parameters array.
void set_wait_sensed(const bool &wait_sensed)
Set wait-sensed value.
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.
std::optional< std::string > name() const
Get name value.