yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
ChatPhoto_fromJson.cc
Go to the documentation of this file.
1 // From JSON Specialication //
4 #include <jsoncpp/json/json.h>
5 #include "types/telegram_type.h"
7 #include "types/ChatPhoto.h"
8 
9 using namespace std;
10 
11 namespace yatbcpp {
17  template<> ChatPhoto fromJson(Json::Value Data) {
18  if (!Data.isMember("small_file_id")) {
19  throw essential_key_missing("ChatPhoto::small_file_id is missing");
20  }
21  if (!Data.isMember("big_file_id")) {
22  throw essential_key_missing("ChatPhoto::big_file_id is missing");
23  }
24 
25  std::string small_file_id = Data["file_id"].asString();
26  std::string big_file_id = Data["file_id"].asString();
27 
28  ChatPhoto ret(small_file_id, big_file_id);
29 
30  return ret;
31  }
32 }
ChatPhoto fromJson(Json::Value Data)
Definition: Bot.h:27