| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::connection Class Reference

The connection object that the user has attached. More...

`#include <integration.h>`

Inheritance diagram for dpp::connection:
[legend]
Collaboration diagram for dpp::connection:
[legend]

## Public Member Functions

| connection ()
| Construct a new connection object.
std::string | build_json (bool with_id=false) const
| Convert object to json string.
connection & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

bool | friend_sync
| Whether friend sync is enabled for this connection.
std::string | id
| ID of the connection account.
std::vector< integration > | integrations
| Optional: an array of partial server integrations.
std::string | name
| the username of the connection account.
bool | revoked
| Optional: whether the connection is revoked.
bool | show_activity
| Whether activities related to this connection will be shown in presence updates.
bool | two_way_link
| Whether this connection has a corresponding third party OAuth2 token.
std::string | type
| the service of the connection (twitch, youtube, discord, or guild_subscription).
bool | verified
| Whether the connection is verified.
bool | visible
| Visibility of this connection.

## Protected Member Functions

connection & | fill_from_json_impl (nlohmann::json *j)

## Friends

struct | json_interface< connection >

## Detailed Description

The connection object that the user has attached.

## Constructor & Destructor Documentation

## ◆ connection()

dpp::connection::connection | ( |  | ) |

Construct a new connection object.

## Member Function Documentation

## ◆ build_json()

std::string dpp::json_interface< connection >::build_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to json string.

Parameters

  with_id | Whether 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()

connection & dpp::json_interface< connection >::fill_from_json | ( | nlohmann::json * | j | ) |

inline inherited

Convert object from nlohmann::json.

Parameters

  j | nlohmann::json object

Returns
  T& Reference to self for fluent calling

## ◆ fill_from_json_impl()

connection & dpp::connection::fill_from_json_impl | ( | nlohmann::json * | j | ) |

protected

Read class values from json object

Parameters

  j | A json object to read from

Returns
  A reference to self

## ◆ to_json()

auto dpp::json_interface< connection >::to_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to nlohmann::json.

Parameters

  with_id | Whether 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 Symbol Documentation

## ◆ json_interface< connection >

friend struct json_interface< connection >

friend

## Member Data Documentation

## ◆ friend_sync

bool dpp::connection::friend_sync

Whether friend sync is enabled for this connection.

## ◆ id

std::string dpp::connection::id

ID of the connection account.

## ◆ integrations

std::vector<integration> dpp::connection::integrations

Optional: an array of partial server integrations.

## ◆ name

std::string dpp::connection::name

the username of the connection account.

## ◆ revoked

bool dpp::connection::revoked

Optional: whether the connection is revoked.

## ◆ show_activity

bool dpp::connection::show_activity

Whether activities related to this connection will be shown in presence updates.

## ◆ two_way_link

bool dpp::connection::two_way_link

Whether this connection has a corresponding third party OAuth2 token.

## ◆ type

std::string dpp::connection::type

the service of the connection (twitch, youtube, discord, or guild_subscription).

## ◆ verified

bool dpp::connection::verified

Whether the connection is verified.

## ◆ visible

bool dpp::connection::visible

Visibility of this connection.

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