D++ (DPP)  10.0.30
C++ Discord API Bot Library
dpp::ban Class Reference

The ban class represents a ban on a guild. More...

#include "ban.h"

Inheritance diagram for dpp::ban:
Collaboration diagram for dpp::ban:

Public Member Functions

 ban ()
 Constructor. More...
 
virtual ~ban ()=default
 Destructor. More...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 
banfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 

Public Attributes

std::string reason
 The ban reason. More...
 
snowflake user_id
 User ID the ban applies to. More...
 

Protected Member Functions

banfill_from_json_impl (nlohmann::json *j)
 Read class values from json object. More...
 

Friends

struct json_interface< ban >
 

Detailed Description

The ban class represents a ban on a guild.

Constructor & Destructor Documentation

◆ ban()

dpp::ban::ban ( )

Constructor.

◆ ~ban()

virtual dpp::ban::~ban ( )
virtualdefault

Destructor.

Member Function Documentation

◆ build_json()

std::string dpp::json_interface< ban >::build_json ( bool  with_id = false) const
inlineinherited

Convert object to json string.

Parameters
with_idWhether to include the ID or not
Note
Some fields are conditionally filled, do not rely on all fields being present
Returns
std::string Json built from the structure

◆ fill_from_json()

ban & dpp::json_interface< ban >::fill_from_json ( nlohmann::json j)
inlineinherited

Convert object from nlohmann::json.

Parameters
jnlohmann::json object
Returns
T& Reference to self for fluent calling

◆ fill_from_json_impl()

ban & dpp::ban::fill_from_json_impl ( nlohmann::json j)
protected

Read class values from json object.

Parameters
jA json object to read from
Returns
A reference to self

◆ to_json()

auto dpp::json_interface< ban >::to_json ( bool  with_id = false) const
inlineinherited

Convert object to nlohmann::json.

Parameters
with_idWhether to include the ID or not
Note
Some fields are conditionally filled, do not rely on all fields being present
Returns
json Json built from the structure

Friends And Related Function Documentation

◆ json_interface< ban >

friend struct json_interface< ban >
friend

Member Data Documentation

◆ reason

std::string dpp::ban::reason

The ban reason.

◆ user_id

snowflake dpp::ban::user_id

User ID the ban applies to.


The documentation for this class was generated from the following files: