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

Contains information about a suggested post. https://core.telegram.org/bots/api#suggestedpostinfo. More...

#include <SuggestedPostInfo.hpp>

Public Types

enum class  State : std::uint8_t { Pending = 0 , Approved , Declined }
 Enum of possible types of State. More...
 

Public Member Functions

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

Static Public Member Functions

static std::optional< std::string > StateToString (const State type) noexcept
 Converts enum State to a string.
 
static std::optional< StateStringToState (const std::string &str) noexcept
 Converts string to an enum State.
 

Public Attributes

State state {}
 State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.
 
Ptr< SuggestedPostPriceprice
 Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
 
std::time_t sendDate {}
 Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.
 

Detailed Description

Contains information about a suggested post. https://core.telegram.org/bots/api#suggestedpostinfo.

Definition at line 8 of file SuggestedPostInfo.hpp.

Member Enumeration Documentation

◆ State

enum class tgbotxx::SuggestedPostInfo::State : std::uint8_t
strong

Enum of possible types of State.

Enumerator
Pending 
Approved 
Declined 

Definition at line 15 of file SuggestedPostInfo.hpp.

Constructor & Destructor Documentation

◆ SuggestedPostInfo() [1/2]

tgbotxx::SuggestedPostInfo::SuggestedPostInfo ( )
default

◆ SuggestedPostInfo() [2/2]

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

Definition at line 10 of file SuggestedPostInfo.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 57 of file SuggestedPostInfo.hpp.

◆ StateToString()

static std::optional< std::string > tgbotxx::SuggestedPostInfo::StateToString ( const State  type)
inlinestaticnoexcept

Converts enum State to a string.

Definition at line 21 of file SuggestedPostInfo.hpp.

◆ StringToState()

static std::optional< State > tgbotxx::SuggestedPostInfo::StringToState ( const std::string &  str)
inlinestaticnoexcept

Converts string to an enum State.

Definition at line 28 of file SuggestedPostInfo.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 48 of file SuggestedPostInfo.hpp.

Member Data Documentation

◆ price

Ptr<SuggestedPostPrice> tgbotxx::SuggestedPostInfo::price

Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.

Definition at line 38 of file SuggestedPostInfo.hpp.

◆ sendDate

std::time_t tgbotxx::SuggestedPostInfo::sendDate {}

Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.

Definition at line 43 of file SuggestedPostInfo.hpp.

◆ state

State tgbotxx::SuggestedPostInfo::state {}

State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.

Definition at line 35 of file SuggestedPostInfo.hpp.


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