1 #ifndef CPPGRAM_DOCUMENT_HPP 2 #define CPPGRAM_DOCUMENT_HPP 4 #include <experimental/optional> 9 #include "photo_size.hpp" 31 std::experimental::optional<PhotoSize>
thumb;
40 std::experimental::optional<int_fast32_t>
file_size;
42 Document( Json::Value &json_document )
43 : file_id( json_document[
"file_id"].asString() )
45 if ( !json_document[
"thumb"].isNull() )
47 thumb.emplace(
PhotoSize( json_document[
"thumb"] ) );
50 if ( !json_document[
"file_name"].isNull() )
52 file_name.emplace( json_document[
"file_name"].asString() );
55 if ( !json_document[
"mime_type"].isNull() )
57 mime_type.emplace( json_document[
"mime_type"].asString() );
60 if ( !json_document[
"file_size"].isNull() )
62 file_size.emplace( json_document[
"file_size"].asUInt() );
std::string file_id
Unique file identifier.
Definition: document.hpp:28
A photo or thumbnail.
Definition: photo_size.hpp:20
std::experimental::optional< std::string > mime_type
Optional. MIME type of the file as defined by sender
Definition: document.hpp:34
std::experimental::optional< int_fast32_t > file_size
Optional. File size
Definition: document.hpp:40
A document send by a user.
Definition: document.hpp:22
std::experimental::optional< PhotoSize > thumb
Optional. Document thumbnail as defined by sender
Definition: document.hpp:31
main namespace for Cppgram
std::experimental::optional< std::string > file_name
Optional. Original filename as defined by sender
Definition: document.hpp:34