Cppgram  1.0.0
Easy and modern C++14 Telegram Bot API wrapper
venue.hpp
1 #ifndef CPPGRAM_VENUE_HPP
2 #define CPPGRAM_VENUE_HPP
3 
4 #include <experimental/optional>
5 #include <string>
6 
7 #include <json/json.h>
8 
9 #include "location.hpp"
10 
11 namespace cppgram
12 {
13 namespace types
14 {
21 class Venue
22 {
25  public:
28 
30  std::string title,
31 
33  address;
34 
36  std::experimental::optional<std::string> foursquare_id;
37 
38  Venue( Json::Value &json_venue )
39  : location( Location( json_venue["location"] ) )
40  , title( json_venue["title"].asString() )
41  , address( json_venue["address"].asString() )
42  {
43  if ( !json_venue["foursquare_id"].isNull() )
44  {
45  foursquare_id.emplace( json_venue["foursquare_id"].asString() );
46  }
47  }
48 };
49 }
50 }
51 
52 #endif
std::string title
Name of the venue.
Definition: venue.hpp:30
This object represents a venue.
Definition: venue.hpp:21
std::experimental::optional< std::string > foursquare_id
Optional. Foursquare identifier of the venue
Definition: venue.hpp:36
Location location
Venue location.
Definition: venue.hpp:27
A location send by a user.
Definition: location.hpp:19
main namespace for Cppgram
std::string address
Address of the venue.
Definition: venue.hpp:30