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

Represents an integration on a guild, e.g. More...

#include "integration.h"

Inheritance diagram for dpp::integration:
Collaboration diagram for dpp::integration:

Public Member Functions

 integration ()
 Default constructor. More...
 
 ~integration ()=default
 Default destructor. More...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 
bool emoticons_enabled () const
 Are emoticons enabled for this integration? More...
 
bool expiry_kicks_user () const
 Will the user be kicked if their subscription runs out to the integration? If false, the integration will simply remove the role that is specified by role_id. More...
 
integrationfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
constexpr double get_creation_time () const noexcept
 Get the creation time of this object according to Discord. More...
 
bool is_enabled () const
 Is the integration enabled? More...
 
bool is_revoked () const
 Has this integration been revoked? More...
 
bool is_syncing () const
 Is the integration syncing? More...
 
constexpr bool operator!= (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
constexpr bool operator== (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 

Public Attributes

integration_account account
 Integration account information. More...
 
integration_app app
 The bot/OAuth2 application for discord integrations. More...
 
uint32_t expire_grace_period
 The grace period (in days) before expiring subscribers. More...
 
uint8_t flags
 Integration flags from dpp::integration_flags. More...
 
snowflake id = {}
 Unique ID of object set by Discord. More...
 
std::string name
 Integration name. More...
 
snowflake role_id
 ID that this integration uses for "subscribers". More...
 
std::vector< std::string > scopes
 The scopes the application has been authorized for. More...
 
uint32_t subscriber_count
 How many subscribers this integration has. More...
 
time_t synced_at
 When this integration was last synced. More...
 
integration_type type
 Integration type (twitch, youtube, discord, or guild_subscription). More...
 
user user_obj
 User for this integration. More...
 

Protected Member Functions

integrationfill_from_json_impl (nlohmann::json *j)
 Read class values from json object. More...
 
virtual json to_json_impl (bool with_id=false) const
 Build a json from this object. More...
 

Friends

struct json_interface< integration >
 

Detailed Description

Represents an integration on a guild, e.g.

a connection to twitch.

Constructor & Destructor Documentation

◆ integration()

dpp::integration::integration ( )

Default constructor.

References dpp::unicode_emoji::flags, and dpp::if_syncing.

◆ ~integration()

dpp::integration::~integration ( )
default

Default destructor.

Member Function Documentation

◆ build_json()

std::string dpp::json_interface< integration >::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

◆ emoticons_enabled()

bool dpp::integration::emoticons_enabled ( ) const

Are emoticons enabled for this integration?

Warning
This is not provided for discord bot integrations.

◆ expiry_kicks_user()

bool dpp::integration::expiry_kicks_user ( ) const

Will the user be kicked if their subscription runs out to the integration? If false, the integration will simply remove the role that is specified by role_id.

Warning
This is not provided for discord bot integrations.

◆ fill_from_json()

integration & dpp::json_interface< integration >::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()

integration & dpp::integration::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

◆ get_creation_time()

constexpr double dpp::managed::get_creation_time ( ) const
inlineconstexprnoexceptinherited

Get the creation time of this object according to Discord.

Returns
double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.

◆ is_enabled()

bool dpp::integration::is_enabled ( ) const

Is the integration enabled?

Warning
This is not provided for discord bot integrations.

◆ is_revoked()

bool dpp::integration::is_revoked ( ) const

Has this integration been revoked?

Warning
This is not provided for discord bot integrations.

◆ is_syncing()

bool dpp::integration::is_syncing ( ) const

Is the integration syncing?

Warning
This is not provided for discord bot integrations.

◆ operator!=()

constexpr bool dpp::managed::operator!= ( const managed other) const
inlineconstexprnoexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are not the same id
false objects are the same id

◆ operator==()

constexpr bool dpp::managed::operator== ( const managed other) const
inlineconstexprnoexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are the same id
false objects are not the same id

◆ to_json()

auto dpp::json_interface< integration >::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()

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

Build a json from this object.

Parameters
with_idAdd ID to output
Returns
JSON of the object

References dpp::unicode_emoji::flags, and dpp::if_revoked.

Friends And Related Function Documentation

◆ json_interface< integration >

friend struct json_interface< integration >
friend

Member Data Documentation

◆ account

integration_account dpp::integration::account

Integration account information.

◆ app

integration_app dpp::integration::app

The bot/OAuth2 application for discord integrations.

◆ expire_grace_period

uint32_t dpp::integration::expire_grace_period

The grace period (in days) before expiring subscribers.

Warning
This is not provided for discord bot integrations.

◆ flags

uint8_t dpp::integration::flags

Integration flags from dpp::integration_flags.

◆ id

◆ name

std::string dpp::integration::name

Integration name.

◆ role_id

snowflake dpp::integration::role_id

ID that this integration uses for "subscribers".

Warning
This is not provided for discord bot integrations.

◆ scopes

std::vector<std::string> dpp::integration::scopes

The scopes the application has been authorized for.

◆ subscriber_count

uint32_t dpp::integration::subscriber_count

How many subscribers this integration has.

Warning
This is not provided for discord bot integrations.

◆ synced_at

time_t dpp::integration::synced_at

When this integration was last synced.

Warning
This is not provided for discord bot integrations.

◆ type

integration_type dpp::integration::type

Integration type (twitch, youtube, discord, or guild_subscription).

◆ user_obj

user dpp::integration::user_obj

User for this integration.


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