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

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. https://core.telegram.org/bots/api#passportfile. More...

#include <PassportFile.hpp>

Public Member Functions

 PassportFile ()=default
 
 PassportFile (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...
 
std::int64_t fileSize {}
 File size in bytes. More...
 
std::time_t fileDate {}
 Unix time when the file was uploaded. More...
 

Detailed Description

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. https://core.telegram.org/bots/api#passportfile.

Definition at line 8 of file PassportFile.hpp.

Constructor & Destructor Documentation

◆ PassportFile() [1/2]

tgbotxx::PassportFile::PassportFile ( )
default

◆ PassportFile() [2/2]

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

Definition at line 10 of file PassportFile.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 39 of file PassportFile.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 29 of file PassportFile.hpp.

Member Data Documentation

◆ fileDate

std::time_t tgbotxx::PassportFile::fileDate {}

Unix time when the file was uploaded.

Definition at line 25 of file PassportFile.hpp.

◆ fileId

std::string tgbotxx::PassportFile::fileId

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

Definition at line 15 of file PassportFile.hpp.

◆ fileSize

std::int64_t tgbotxx::PassportFile::fileSize {}

File size in bytes.

Definition at line 22 of file PassportFile.hpp.

◆ fileUniqueId

std::string tgbotxx::PassportFile::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 19 of file PassportFile.hpp.


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