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

This object represents a portion of the price for goods or services. https://core.telegram.org/bots/api#labeledprice. More...

#include <LabeledPrice.hpp>

Public Member Functions

 LabeledPrice ()=default
 
 LabeledPrice (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 label
 Portion label. More...
 
std::int32_t amount {}
 Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). More...
 

Detailed Description

This object represents a portion of the price for goods or services. https://core.telegram.org/bots/api#labeledprice.

Definition at line 7 of file LabeledPrice.hpp.

Constructor & Destructor Documentation

◆ LabeledPrice() [1/2]

tgbotxx::LabeledPrice::LabeledPrice ( )
default

◆ LabeledPrice() [2/2]

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

Definition at line 9 of file LabeledPrice.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 32 of file LabeledPrice.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 24 of file LabeledPrice.hpp.

Member Data Documentation

◆ amount

std::int32_t tgbotxx::LabeledPrice::amount {}

Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

Definition at line 19 of file LabeledPrice.hpp.

◆ label

std::string tgbotxx::LabeledPrice::label

Portion label.

Definition at line 14 of file LabeledPrice.hpp.


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