1 #ifndef CPPGRAM_AUDIO_HPP 2 #define CPPGRAM_AUDIO_HPP 4 #include <experimental/optional> 41 std::experimental::optional<uint_fast32_t>
file_size;
43 Audio( Json::Value &json_audio )
44 : file_id( json_audio[
"file_id"].asString() )
45 , duration( json_audio[
"duration"].asUInt() )
47 if ( !json_audio[
"performer"].isNull() )
49 performer.emplace( json_audio[
"performer"].asString() );
52 if ( !json_audio[
"title"].isNull() )
54 title.emplace( json_audio[
"title"].asString() );
57 if ( !json_audio[
"mime_type"].isNull() )
59 mime_type.emplace( json_audio[
"mime_type"].asString() );
62 if ( !json_audio[
"file_size"].isNull() )
64 file_size.emplace( json_audio[
"file_size"].asUInt() );
std::experimental::optional< std::string > mime_type
Optional. MIME type of the file as defined by sender
Definition: audio.hpp:32
uint_fast32_t duration
Duration of the audio in seconds as defined by sender.
Definition: audio.hpp:29
std::experimental::optional< std::string > title
Optional. Title of the audio as defined by sender or by audio tags
Definition: audio.hpp:32
std::experimental::optional< uint_fast32_t > file_size
Optional. File size
Definition: audio.hpp:41
main namespace for Cppgram
std::experimental::optional< std::string > performer
Optional. Performer of the audio as defined by sender or by audio tags
Definition: audio.hpp:32
std::string file_id
Unique identifier for this file.
Definition: audio.hpp:26
Audio message sent by a user.
Definition: audio.hpp:20