dpp::sku
dpp::managed
dpp::json_interface< sku >
sku.h
struct friend struct json_interface< sku > json_interface< sku > dpp::sku::json_interface< sku > json_interface< sku >
snowflake snowflake dpp::sku::application_id application_id dpp::sku::application_id {0}

ID of the parent application.

uint16_t uint16_t dpp::sku::flags flags dpp::sku::flags {0}

Flags bitmap from dpp::sku_flags.

snowflake snowflake dpp::managed::id id dpp::managed::id = {}

Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.

std::string std::string dpp::sku::name name dpp::sku::name {}

Customer-facing name of your premium offering.

std::string std::string dpp::sku::slug slug dpp::sku::slug {}

System-generated URL slug based on the SKU's name.

sku_type sku_type dpp::sku::type type dpp::sku::type {sku_type::SUBSCRIPTION}

The type of SKU.

sku & sku & dpp::sku::fill_from_json_impl (nlohmann::json *j) fill_from_json_impl dpp::sku::fill_from_json_impl nlohmann::json * j

Read class values from json object j

A json object to read from

A reference to self

json json dpp::sku::to_json_impl (bool with_id=false) const to_json_impl dpp::sku::to_json_impl bool with_id false

Build json for this SKU object.

with_id

include the ID in the json

json JSON object

dpp::sku::sku
()=default
sku
dpp::sku::sku

Construct a new SKU object.

dpp::sku::sku
(const snowflake id, const sku_type type, const snowflake application_id, const std::string name, const std::string slug, const uint16_t flags)
sku
dpp::sku::sku
const snowflake id
const sku_type type
const snowflake application_id
const std::string name
const std::string slug
const uint16_t flags

Construct a new SKU object with all data required.

id

ID of the SKU.

type

Type of SKU (sku_type).

application_id

ID of the parent application.

name

Customer-facing name of your premium offering.

slug

System-generated URL slug based on the SKU's name.

flags

Flags bitmap from dpp::sku_flags.

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

Convert object to json string.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

std::string Json built from the structure

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

Convert object from nlohmann::json.

j

nlohmann::json object

T& Reference to self for fluent calling

double double dpp::managed::get_creation_time () const noexcept get_creation_time dpp::managed::get_creation_time

Get the creation time of this object according to Discord.

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

sku_type sku_type dpp::sku::get_type () const get_type dpp::sku::get_type

Get the type of SKU.

sku_type SKU type

bool bool dpp::sku::is_available () const is_available dpp::sku::is_available

Is the SKU available for purchase?

true if the SKU can be purchased.

bool bool dpp::sku::is_guild_subscription () const is_guild_subscription dpp::sku::is_guild_subscription

Is the SKU a guild subscription?

true if the SKU is a guild subscription.

bool bool dpp::sku::is_user_subscription () const is_user_subscription dpp::sku::is_user_subscription

Is the SKU a user subscription?

true if the SKU is a user subscription

bool bool dpp::managed::operator!= (const managed &other) const noexcept operator!= dpp::managed::operator!= const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are not the same id

false objects are the same id

bool bool dpp::managed::operator== (const managed &other) const noexcept operator== dpp::managed::operator== const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are the same id

false objects are not the same id

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

Convert object to nlohmann::json.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

json Json built from the structure

A definition of a discord SKU.

dpp::json_interface< T >
dpp::json_interface< sku >
< sku >
dpp::managed
dpp::sku
dpp::json_interface< T >
dpp::json_interface< sku >
< sku >
dpp::managed
id
dpp::sku
type
application_id
name
slug
flags
dpp::snowflake
value
sku_type
std::basic_string< Char >
std::string
uint16_t
uint64_t
- dpp::sku
  application_id
- dpp::sku
  build_json
- dpp::sku
  fill_from_json
- dpp::sku
  fill_from_json_impl
- dpp::sku
  flags
- dpp::sku
  get_creation_time
- dpp::sku
  get_type
- dpp::sku
  id
- dpp::sku
  is_available
- dpp::sku
  is_guild_subscription
- dpp::sku
  is_user_subscription
- dpp::sku
  json_interface< sku >
- dpp::sku
  managed
- dpp::sku
  managed
- dpp::sku
  managed
- dpp::sku
  managed
- dpp::sku
  name
- dpp::sku
  operator!=
- dpp::sku
  operator=
- dpp::sku
  operator=
- dpp::sku
  operator==
- dpp::sku
  sku
- dpp::sku
  sku
- dpp::sku
  slug
- dpp::sku
  to_json
- dpp::sku
  to_json_impl
- dpp::sku
  type
- dpp::sku
  ~managed