16 #define RAPIDJSON_HAS_STDSTRING 1
17 #include "PlanAction.h"
19 #include <rapidjson/fwd.h>
37 Plan(
const std::string &json);
41 Plan(
const rapidjson::Value &v);
59 virtual std::string
to_json(
bool pretty =
false)
const;
64 virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v)
const;
70 virtual void from_json(
const std::string &json);
86 virtual void validate(
bool subcall =
false)
const;
93 std::optional<std::string>
110 std::optional<std::string>
127 std::optional<std::string>
144 std::optional<std::string>
178 std::vector<std::shared_ptr<PlanAction>>
198 actions_.push_back(std::move(
actions));
216 actions_.push_back(std::make_shared<PlanAction>(std::move(
actions)));
220 std::optional<std::string> kind_;
221 std::optional<std::string> apiVersion_;
222 std::optional<std::string> id_;
223 std::optional<std::string> goal_id_;
224 std::optional<float> cost_;
225 std::vector<std::shared_ptr<PlanAction>> actions_;
PlanAction representation for JSON transfer.
Plan representation for JSON transfer.
std::vector< std::shared_ptr< PlanAction > > actions() const
Get actions value.
void addto_actions(const std::shared_ptr< PlanAction > &&actions)
Add element to actions array.
virtual void to_json_value(rapidjson::Document &d, rapidjson::Value &v) const
Render object to JSON.
void set_id(const std::string &id)
Set id value.
std::optional< std::string > goal_id() const
Get goal-id value.
void set_goal_id(const std::string &goal_id)
Set goal-id value.
virtual ~Plan()
Destructor.
std::optional< std::string > apiVersion() const
Get apiVersion value.
std::optional< std::string > id() const
Get id value.
static std::string api_version()
Get version of implemented API.
virtual std::string to_json(bool pretty=false) const
Render object to JSON.
virtual void from_json(const std::string &json)
Retrieve data from JSON string.
void set_kind(const std::string &kind)
Set kind value.
void set_actions(const std::vector< std::shared_ptr< PlanAction >> &actions)
Set actions value.
void addto_actions(const std::shared_ptr< PlanAction > &actions)
Add element to actions array.
std::optional< float > cost() const
Get cost value.
std::optional< std::string > kind() const
Get kind value.
virtual void validate(bool subcall=false) const
Validate if all required fields have been set.
void set_cost(const float &cost)
Set cost value.
void set_apiVersion(const std::string &apiVersion)
Set apiVersion value.
void addto_actions(const PlanAction &&actions)
Add element to actions array.
virtual void from_json_value(const rapidjson::Value &v)
Retrieve data from JSON string.