tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::OwnedGift Struct Reference

Base class for a gift owned by a user or a chat Can be either OwnedGiftRegular or OwnedGiftUnique. More...

#include <OwnedGift.hpp>

Inheritance diagram for tgbotxx::OwnedGift:
tgbotxx::OwnedGiftRegular tgbotxx::OwnedGiftUnique

Public Member Functions

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

Public Attributes

std::string type
 Type of the gift: "regular" or "unique".
 

Detailed Description

Base class for a gift owned by a user or a chat Can be either OwnedGiftRegular or OwnedGiftUnique.

Definition at line 12 of file OwnedGift.hpp.

Constructor & Destructor Documentation

◆ OwnedGift() [1/2]

tgbotxx::OwnedGift::OwnedGift ( )
default

◆ OwnedGift() [2/2]

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

Definition at line 14 of file OwnedGift.hpp.

◆ ~OwnedGift()

virtual tgbotxx::OwnedGift::~OwnedGift ( )
virtualdefault

Member Function Documentation

◆ fromJson()

virtual void tgbotxx::OwnedGift::fromJson ( const nl::json &  json)
inlinevirtual

Deserializes this object from JSON.

Reimplemented in tgbotxx::OwnedGiftRegular, and tgbotxx::OwnedGiftUnique.

Definition at line 31 of file OwnedGift.hpp.

◆ toJson()

virtual nl::json tgbotxx::OwnedGift::toJson ( ) const
inlinevirtual

Serializes this object to JSON.

Returns
JSON representation of this object

Reimplemented in tgbotxx::OwnedGiftRegular, and tgbotxx::OwnedGiftUnique.

Definition at line 24 of file OwnedGift.hpp.

Member Data Documentation

◆ type

std::string tgbotxx::OwnedGift::type

Type of the gift: "regular" or "unique".

Definition at line 20 of file OwnedGift.hpp.


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