tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::Document Struct Reference

This object represents a general file (as opposed to photos, voice messages and audio files). https://core.telegram.org/bots/api#photosize voice messages https://core.telegram.org/bots/api#voice audio files https://core.telegram.org/bots/api#audio https://core.telegram.org/bots/api#document. More...

#include <Document.hpp>

Public Member Functions

 Document ()=default
 
 Document (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON. More...
 

Public Attributes

std::string fileId
 Identifier for this file, which can be used to download or reuse the file. More...
 
std::string fileUniqueId
 Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. More...
 
Ptr< PhotoSizethumbnail
 Optional. Document thumbnail as defined by sender. More...
 
std::string fileName
 Optional. Original filename as defined by sender. More...
 
std::string mimeType
 Optional. MIME type of the file as defined by sender. More...
 
std::int64_t fileSize {}
 Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. More...
 

Detailed Description

This object represents a general file (as opposed to photos, voice messages and audio files). https://core.telegram.org/bots/api#photosize voice messages https://core.telegram.org/bots/api#voice audio files https://core.telegram.org/bots/api#audio https://core.telegram.org/bots/api#document.

Definition at line 13 of file Document.hpp.

Constructor & Destructor Documentation

◆ Document() [1/2]

tgbotxx::Document::Document ( )
default

◆ Document() [2/2]

tgbotxx::Document::Document ( const nl::json &  json)
inlineexplicit

Definition at line 15 of file Document.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::Document::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 55 of file Document.hpp.

◆ toJson()

nl::json tgbotxx::Document::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 43 of file Document.hpp.

Member Data Documentation

◆ fileId

std::string tgbotxx::Document::fileId

Identifier for this file, which can be used to download or reuse the file.

Definition at line 20 of file Document.hpp.

◆ fileName

std::string tgbotxx::Document::fileName

Optional. Original filename as defined by sender.

Definition at line 30 of file Document.hpp.

◆ fileSize

std::int64_t tgbotxx::Document::fileSize {}

Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

Definition at line 38 of file Document.hpp.

◆ fileUniqueId

std::string tgbotxx::Document::fileUniqueId

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Definition at line 24 of file Document.hpp.

◆ mimeType

std::string tgbotxx::Document::mimeType

Optional. MIME type of the file as defined by sender.

Definition at line 33 of file Document.hpp.

◆ thumbnail

Ptr<PhotoSize> tgbotxx::Document::thumbnail

Optional. Document thumbnail as defined by sender.

Definition at line 27 of file Document.hpp.


The documentation for this struct was generated from the following file: