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 {
31 public:
32  /** Constructor. */
34  /** Constructor from JSON.
35  * @param json JSON string to initialize from
36  */
37  DomainOperator(const std::string &json);
38  /** Constructor from JSON.
39  * @param v RapidJSON value object to initialize from.
40  */
41  DomainOperator(const rapidjson::Value &v);
42 
43  /** Destructor. */
44  virtual ~DomainOperator();
45 
46  /** Get version of implemented API.
47  * @return string representation of version
48  */
49  static std::string
51  {
52  return "v1beta1";
53  }
54 
55  /** Render object to JSON.
56  * @param pretty true to enable pretty printing (readable spacing)
57  * @return JSON string
58  */
59  virtual std::string to_json(bool pretty = false) const;
60  /** Render object to JSON.
61  * @param d RapidJSON document to retrieve allocator from
62  * @param v RapidJSON value to add data to
63  */
64  virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const;
65  /** Retrieve data from JSON string.
66  * @param json JSON representation suitable for this object.
67  * Will allow partial assignment and not validate automaticaly.
68  * @see validate()
69  */
70  virtual void from_json(const std::string &json);
71  /** Retrieve data from JSON string.
72  * @param v RapidJSON value suitable for this object.
73  * Will allow partial assignment and not validate automaticaly.
74  * @see validate()
75  */
76  virtual void from_json_value(const rapidjson::Value &v);
77 
78  /** Validate if all required fields have been set.
79  * @param subcall true if this is called from another class, e.g.,
80  * a sub-class or array holder. Will modify the kind of exception thrown.
81  * @exception std::vector<std::string> thrown if required information is
82  * missing and @p subcall is set to true. Contains a list of missing fields.
83  * @exception std::runtime_error informative message describing the missing
84  * fields
85  */
86  virtual void validate(bool subcall = false) const;
87 
88  // Schema: DomainOperator
89 public:
90  /** Get kind value.
91  * @return kind value
92  */
93  std::optional<std::string>
94  kind() const
95  {
96  return kind_;
97  }
98 
99  /** Set kind value.
100  * @param kind new value
101  */
102  void
103  set_kind(const std::string &kind)
104  {
105  kind_ = kind;
106  }
107  /** Get apiVersion value.
108  * @return apiVersion value
109  */
110  std::optional<std::string>
111  apiVersion() const
112  {
113  return apiVersion_;
114  }
115 
116  /** Set apiVersion value.
117  * @param apiVersion new value
118  */
119  void
120  set_apiVersion(const std::string &apiVersion)
121  {
122  apiVersion_ = apiVersion;
123  }
124  /** Get name value.
125  * @return name value
126  */
127  std::optional<std::string>
128  name() const
129  {
130  return name_;
131  }
132 
133  /** Set name value.
134  * @param name new value
135  */
136  void
137  set_name(const std::string &name)
138  {
139  name_ = name;
140  }
141  /** Get wait-sensed value.
142  * @return wait-sensed value
143  */
144  std::optional<bool>
145  wait_sensed() const
146  {
147  return wait_sensed_;
148  }
149 
150  /** Set wait-sensed value.
151  * @param wait_sensed new value
152  */
153  void
155  {
156  wait_sensed_ = wait_sensed;
157  }
158  /** Get parameters value.
159  * @return parameters value
160  */
161  std::vector<std::shared_ptr<DomainOperatorParameter>>
162  parameters() const
163  {
164  return parameters_;
165  }
166 
167  /** Set parameters value.
168  * @param parameters new value
169  */
170  void
171  set_parameters(const std::vector<std::shared_ptr<DomainOperatorParameter>> &parameters)
172  {
173  parameters_ = parameters;
174  }
175  /** Add element to parameters array.
176  * @param parameters new value
177  */
178  void
179  addto_parameters(const std::shared_ptr<DomainOperatorParameter> &&parameters)
180  {
181  parameters_.push_back(std::move(parameters));
182  }
183 
184  /** Add element to parameters array.
185  * The move-semantics version (std::move) should be preferred.
186  * @param parameters new value
187  */
188  void
189  addto_parameters(const std::shared_ptr<DomainOperatorParameter> &parameters)
190  {
191  parameters_.push_back(parameters);
192  }
193  /** Add element to parameters array.
194  * @param parameters new value
195  */
196  void
198  {
199  parameters_.push_back(std::make_shared<DomainOperatorParameter>(std::move(parameters)));
200  }
201 
202 private:
203  std::optional<std::string> kind_;
204  std::optional<std::string> apiVersion_;
205  std::optional<std::string> name_;
206  std::optional<bool> wait_sensed_;
207  std::vector<std::shared_ptr<DomainOperatorParameter>> parameters_;
208 };
DomainOperator representation for JSON transfer.
void set_parameters(const std::vector< std::shared_ptr< DomainOperatorParameter >> &parameters)
Set parameters value.
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
void addto_parameters(const std::shared_ptr< DomainOperatorParameter > &&parameters)
Add element to parameters array.
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
virtual ~DomainOperator()
Destructor.
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.
DomainOperator()
Constructor.
void addto_parameters(const DomainOperatorParameter &&parameters)
Add element to parameters array.
static std::string api_version()
Get version of implemented API.
void set_wait_sensed(const bool &wait_sensed)
Set wait-sensed value.
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
std::vector< std::shared_ptr< DomainOperatorParameter > > parameters() const
Get parameters value.
void addto_parameters(const std::shared_ptr< DomainOperatorParameter > &parameters)
Add element to parameters array.
std::optional< std::string > apiVersion() const
Get apiVersion value.
std::optional< std::string > name() const
Get name value.
std::optional< std::string > kind() const
Get kind value.
void set_kind(const std::string &kind)
Set kind value.
void set_name(const std::string &name)
Set name value.
DomainOperatorParameter representation for JSON transfer.
std::optional< bool > wait_sensed() const
Get wait-sensed value.