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

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

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

Public Member Functions

 ban ()
 
virtual ~ban ()=default
 
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...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. 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)
 

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.

D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0