function.h
1 
2 #ifndef NAF_FUNCTIONS_FUNCTION
3 #define NAF_FUNCTIONS_FUNCTION
4 
5 
6 #include <string>
7 #include <vector>
8 #include <map>
9 #include <memory>
10 
11 #include "functions/action.h"
12 #include "http/methods.h"
13 #include "query/parameter.h"
14 
15 
16 namespace NAF
17 {
18  namespace Functions
19  {
20  class Function;
21  }
22 }
23 
24 
26 {
27  public:
28  using Ptr = std::shared_ptr<Functions::Function>;
29 
30  Function();
31  Function(std::string endpoint, HTTP::EnumMethods type);
32 
33  std::string get_endpoint() const { return endpoint_; }
34  std::string get_target() const { return target_; }
35  HTTP::EnumMethods get_method() const { return method_; }
36  std::vector<Action::Ptr>& get_actions()
37  {
38  auto& var = actions_;
39  return var;
40  }
41  HTTP::Methods& get_methods()
42  {
43  auto& var = methods_;
44  return var;
45  }
46 
47  void set_endpoint(std::string endpoint) { endpoint_ = endpoint; }
48  void set_target(std::string target) { target_ = target; }
49  void set_method(HTTP::EnumMethods type) { method_ = type; }
50 
51  Action::Ptr AddAction_(std::string identifier);
52 
53  private:
54  std::string endpoint_;
55  std::string target_;
56  HTTP::EnumMethods method_;
57  std::vector<Action::Ptr> actions_;
58  HTTP::Methods methods_;
59 };
60 
61 
62 #endif // NAF_FUNCTIONS_FUNCTION
Definition: function.h:26
Definition: methods.h:59