aegis.cpp
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
footer.hpp
1 //
2 // footer.hpp
3 // **********
4 //
5 // Copyright (c) 2019 Sharon W (sharon at aegis dot gg)
6 //
7 // Distributed under the MIT License. (See accompanying file LICENSE)
8 //
9 
10 #pragma once
11 
12 #include "aegis/config.hpp"
13 #include <nlohmann/json.hpp>
14 
15 namespace aegis
16 {
17 
18 namespace gateway
19 {
20 
21 namespace objects
22 {
23 
26 struct footer
27 {
28  footer(std::string txt) : text(txt) {}
29  footer() = default;
30  std::string text;
31  std::string icon_url;
32  std::string proxy_icon_url;
33 };
34 
36 inline void from_json(const nlohmann::json& j, footer& m)
37 {
38  if (j.count("text") && !j["text"].is_null())
39  m.text = j["text"].get<std::string>();
40  if (j.count("icon_url") && !j["icon_url"].is_null())
41  m.icon_url = j["icon_url"].get<std::string>();
42  if (j.count("proxy_icon_url") && !j["proxy_icon_url"].is_null())
43  m.proxy_icon_url = j["proxy_icon_url"].get<std::string>();
44 }
45 
46 inline void to_json(nlohmann::json& j, const footer& m)
47 {
48  j["text"] = m.text;
49  j["icon_url"] = m.icon_url;
50  //j["proxy_icon_url"] = m.proxy_icon_url;
51 }
53 
54 }
55 
56 }
57 
58 }
std::string proxy_icon_url
Definition: footer.hpp:32
std::string text
Definition: footer.hpp:30
Definition: footer.hpp:26
std::string icon_url
Definition: footer.hpp:31