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

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

Represents a guild template. More...

`#include <dtemplate.h>`

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

## Public Member Functions

| dtemplate ()
| Construct a new dtemplate object.
virtual | ~dtemplate ()=default
| Destroy the dtemplate object.
std::string | build_json (bool with_id=false) const
| Convert object to json string.
dtemplate & | 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

std::string | code
| Template code.
time_t | created_at
| Creation date/time.
snowflake | creator_id
| User ID of creator.
std::string | description
| Template description.
bool | is_dirty
| True if needs synchronising.
std::string | name
| Template name.
snowflake | source_guild_id
| Guild id the template is created from.
time_t | updated_at
| Last update date/time.
uint32_t | usage_count
| Usage counter.

## Protected Member Functions

dtemplate & | fill_from_json_impl (nlohmann::json *j)
json | to_json_impl (bool with_id=false) const
| Build the JSON for this object.

## Friends

struct | json_interface< dtemplate >

## Detailed Description

Represents a guild template.

## Constructor & Destructor Documentation

## ◆ dtemplate()

dpp::dtemplate::dtemplate | ( |  | ) |

Construct a new dtemplate object.

## ◆ ~dtemplate()

virtual dpp::dtemplate::~dtemplate | ( |  | ) |

virtual default

Destroy the dtemplate object.

## Member Function Documentation

## ◆ build_json()

std::string dpp::json_interface< dtemplate >::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()

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

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

## ◆ to_json_impl()

json dpp::dtemplate::to_json_impl | ( | bool | with_id = false | ) | const

protected

Build the JSON for this object.

Parameters

  with_id | Add ID to output

Returns
  json JSON content

## Friends And Related Symbol Documentation

## ◆ json_interface< dtemplate >

friend struct json_interface< dtemplate >

friend

## Member Data Documentation

## ◆ code

std::string dpp::dtemplate::code

Template code.

## ◆ created_at

time_t dpp::dtemplate::created_at

Creation date/time.

## ◆ creator_id

snowflake dpp::dtemplate::creator_id

User ID of creator.

## ◆ description

std::string dpp::dtemplate::description

Template description.

## ◆ is_dirty

bool dpp::dtemplate::is_dirty

True if needs synchronising.

## ◆ name

std::string dpp::dtemplate::name

Template name.

## ◆ source_guild_id

snowflake dpp::dtemplate::source_guild_id

Guild id the template is created from.

## ◆ updated_at

time_t dpp::dtemplate::updated_at

Last update date/time.

## ◆ usage_count

uint32_t dpp::dtemplate::usage_count

Usage counter.

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