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

Search
Loading...
Searching...
No Matches
dpp::audit_entry Struct Reference

An individual audit log entry. More...

`#include <auditlog.h>`

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

## Public Member Functions

| audit_entry ()
virtual | ~audit_entry ()=default
std::string | build_json (bool with_id=false) const
| Convert object to json string.
audit_entry & | 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::vector< audit_change > | changes
| Optional: changes made to the target_id.
std::optional< audit_extra > | extra
| Optional: additional info for certain action types.
snowflake | id
| ID of the entry.
std::string | reason
| Optional: the reason for the change (1-512 characters).
snowflake | target_id
audit_type | type
| Type of action that occurred.
snowflake | user_id
| The user or app that made the changes (may be empty).

## Protected Member Functions

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

## Friends

struct | json_interface< audit_entry >

## Detailed Description

An individual audit log entry.

## Constructor & Destructor Documentation

## ◆ audit_entry()

dpp::audit_entry::audit_entry | ( |  | ) |

Constructor

## ◆ ~audit_entry()

virtual dpp::audit_entry::~audit_entry | ( |  | ) |

virtual default

Destructor

## Member Function Documentation

## ◆ build_json()

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

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

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

friend struct json_interface< audit_entry >

friend

## Member Data Documentation

## ◆ changes

std::vector<audit_change> dpp::audit_entry::changes

Optional: changes made to the target_id.

## ◆ extra

std::optional<audit_extra> dpp::audit_entry::extra

Optional: additional info for certain action types.

## ◆ id

snowflake dpp::audit_entry::id

ID of the entry.

## ◆ reason

std::string dpp::audit_entry::reason

Optional: the reason for the change (1-512 characters).

## ◆ target_id

snowflake dpp::audit_entry::target_id

ID of the affected entity (webhook, user, role, etc.) (may be empty)

Note
  For dpp::audit_type::aut_appcommand_permission_update updates, it's the command ID or the app ID

## ◆ type

audit_type dpp::audit_entry::type

Type of action that occurred.

## ◆ user_id

snowflake dpp::audit_entry::user_id

The user or app that made the changes (may be empty).

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