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

Represents a voice region on discord. More...

+ Inheritance diagram for dpp::voiceregion:
+ Collaboration diagram for dpp::voiceregion:

Public Member Functions

 voiceregion ()
 Construct a new voiceregion object. More...
 
virtual ~voiceregion ()=default
 Destroy the voiceregion object. More...
 
bool is_optimal () const
 True if is the optimal voice server. More...
 
bool is_deprecated () const
 True if is a deprecated voice server. More...
 
bool is_custom () const
 True if is a custom voice server. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))>
T & fill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 

Public Attributes

std::string id
 Voice server ID. More...
 
std::string name
 Voice server name. More...
 
uint8_t flags
 Flags bitmap. More...
 

Protected Member Functions

voiceregionfill_from_json_impl (nlohmann::json *j)
 Fill object properties from JSON. More...
 
virtual json to_json_impl (bool with_id=false) const
 Build a json for this object. More...
 

Friends

struct json_interface< voiceregion >
 

Detailed Description

Represents a voice region on discord.

Constructor & Destructor Documentation

◆ voiceregion()

dpp::voiceregion::voiceregion ( )

Construct a new voiceregion object.

◆ ~voiceregion()

virtual dpp::voiceregion::~voiceregion ( )
virtualdefault

Destroy the voiceregion object.

Member Function Documentation

◆ build_json()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
std::string dpp::json_interface< T >::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()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))>
T& dpp::json_interface< T >::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()

voiceregion& dpp::voiceregion::fill_from_json_impl ( nlohmann::json *  j)
protected

Fill object properties from JSON.

Parameters
jJSON to fill from
Returns
voiceregion& Reference to self

◆ is_custom()

bool dpp::voiceregion::is_custom ( ) const

True if is a custom voice server.

Returns
true if custom

◆ is_deprecated()

bool dpp::voiceregion::is_deprecated ( ) const

True if is a deprecated voice server.

Returns
true if deprecated

◆ is_optimal()

bool dpp::voiceregion::is_optimal ( ) const

True if is the optimal voice server.

Returns
true if optimal

◆ to_json()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
auto dpp::json_interface< T >::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

◆ to_json_impl()

virtual json dpp::voiceregion::to_json_impl ( bool  with_id = false) const
protectedvirtual

Build a json for this object.

Parameters
with_idAdd ID to output
Returns
json JSON string

Friends And Related Function Documentation

◆ json_interface< voiceregion >

friend struct json_interface< voiceregion >
friend

Member Data Documentation

◆ flags

uint8_t dpp::voiceregion::flags

Flags bitmap.

◆ id

std::string dpp::voiceregion::id

Voice server ID.

◆ name

std::string dpp::voiceregion::name

Voice server name.

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