From d4598bac11ff88385a324309b8ef3df8cc4b5c93 Mon Sep 17 00:00:00 2001 From: sarcasmloading <29299928+sarcasmloading@users.noreply.github.com> Date: Thu, 12 Jul 2018 12:13:53 +1200 Subject: [PATCH] Document remaining audit log data types --- .../DataTypes/RoleDeleteAuditLogData.cs | 15 ++++++++ .../AuditLogs/DataTypes/RoleEditInfo.cs | 37 +++++++++++++++++++ .../DataTypes/RoleUpdateAuditLogData.cs | 21 +++++++++++ .../AuditLogs/DataTypes/UnbanAuditLogData.cs | 9 +++++ .../DataTypes/WebhookCreateAuditLogData.cs | 34 ++++++++++++++++- .../DataTypes/WebhookDeleteAuditLogData.cs | 34 +++++++++++++++++ .../AuditLogs/DataTypes/WebhookInfo.cs | 22 +++++++++++ .../DataTypes/WebhookUpdateAuditLogData.cs | 24 +++++++++++- 8 files changed, 192 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs index 263909daf..ab5372ad4 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data relating to a role deletion. + /// public class RoleDeleteAuditLogData : IAuditLogData { private RoleDeleteAuditLogData(ulong id, RoleEditInfo props) @@ -41,7 +44,19 @@ namespace Discord.Rest new RoleEditInfo(color, mentionable, hoist, name, permissions)); } + /// + /// Gets the ID of the role that has been deleted. + /// + /// + /// A representing the snowflake identifer to the role that has been deleted. + /// public ulong RoleId { get; } + /// + /// Gets the role information that has been deleted. + /// + /// + /// An information object representing the properties of the role that has been deleted. + /// public RoleEditInfo Properties { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs index 186ea8d11..07bc9abf5 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs @@ -1,5 +1,8 @@ namespace Discord.Rest { + /// + /// Represents information for a role edit. + /// public struct RoleEditInfo { internal RoleEditInfo(Color? color, bool? mentionable, bool? hoist, string name, @@ -12,10 +15,44 @@ namespace Discord.Rest Permissions = permissions; } + /// + /// Gets the color of this role. + /// + /// + /// A color object representing the color assigned to this role; null if this role does not have a + /// color. + /// public Color? Color { get; } + /// + /// Determines whether this role is mentionable (i.e. it can be mentioned in a text channel). + /// + /// + /// true if other members can mention this role in a text channel; otherwise false. + /// public bool? Mentionable { get; } + /// + /// Determines whether this role is hoisted (i.e its members will appear in a seperate section on the user + /// list). + /// + /// + /// true if this role's members will appear in a seperate section in the user list; otherwise + /// false. + /// public bool? Hoist { get; } + /// + /// Gets the name of this role. + /// + /// + /// A string containing the name of this role. + /// public string Name { get; } + /// + /// Gets the permissions assigned to this role. + /// + /// + /// A guild permissions object representing the permissions that have been assigned to this role; null + /// if no permissions have been assigned. + /// public GuildPermissions? Permissions { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs index b645ef7ae..40a6c2283 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data related to a role update. + /// public class RoleUpdateAuditLogData : IAuditLogData { private RoleUpdateAuditLogData(ulong id, RoleEditInfo oldProps, RoleEditInfo newProps) @@ -55,8 +58,26 @@ namespace Discord.Rest return new RoleUpdateAuditLogData(entry.TargetId.Value, oldProps, newProps); } + /// + /// Gets the ID of the role that has been changed. + /// + /// + /// A representing the snowflake identifier of the role that has been changed. + /// public ulong RoleId { get; } + /// + /// Gets the role information before the changes. + /// + /// + /// A role information object containing the role information before the changes were made. + /// public RoleEditInfo Before { get; } + /// + /// Gets the role information after the changes. + /// + /// + /// A role information object containing the role information after the changes were made. + /// public RoleEditInfo After { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs index c94f18271..38615fdd7 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data related to an unban. + /// public class UnbanAuditLogData : IAuditLogData { private UnbanAuditLogData(IUser user) @@ -18,6 +21,12 @@ namespace Discord.Rest return new UnbanAuditLogData(RestUser.Create(discord, userInfo)); } + /// + /// Gets the user that was unbanned. + /// + /// + /// A user object representing the user that was unbanned. + /// public IUser Target { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs index 1ae45fb8c..5cc5a0c3d 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data related to a webhook creation. + /// public class WebhookCreateAuditLogData : IAuditLogData { private WebhookCreateAuditLogData(IWebhook webhook, WebhookType type, string name, ulong channelId) @@ -33,12 +36,39 @@ namespace Discord.Rest return new WebhookCreateAuditLogData(webhook, type, name, channelId); } - //Corresponds to the *current* data + // Doc Note: Corresponds to the *current* data + + /// + /// Gets the webhook that was created. + /// + /// + /// A webhook object representing the webhook that was created. + /// public IWebhook Webhook { get; } - //Corresponds to the *audit log* data + // Doc Note: Corresponds to the *audit log* data + + /// + /// Gets the type of webhook that was created. + /// + /// + /// The type of webhook that was created. + /// public WebhookType Type { get; } + + /// + /// Gets the name of the webhook. + /// + /// + /// A string containing the name of the webhook. + /// public string Name { get; } + /// + /// Gets the ID of the channel that the webhook can send to. + /// + /// + /// A representing the snowflake identifier of the channel that the webhook can send to. + /// public ulong ChannelId { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs index 2d536d868..d5a84a696 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data related to a webhook deletion. + /// public class WebhookDeleteAuditLogData : IAuditLogData { private WebhookDeleteAuditLogData(ulong id, ulong channel, WebhookType type, string name, string avatar) @@ -33,10 +36,41 @@ namespace Discord.Rest return new WebhookDeleteAuditLogData(entry.TargetId.Value, channelId, type, name, avatarHash); } + /// + /// Gets the ID of the webhook that was deleted. + /// + /// + /// A representing the snowflake identifier of the webhook that was deleted. + /// public ulong WebhookId { get; } + /// + /// Gets the ID of the channel that the webhook could send to. + /// + /// + /// A representing the snowflake identifier of the channel that the webhook could send + /// to. + /// public ulong ChannelId { get; } + /// + /// Gets the type of the webhook that was deleted. + /// + /// + /// The type of webhook that was deleted. + /// public WebhookType Type { get; } + /// + /// Gets the name of the webhook that was deleted. + /// + /// + /// A string containing the name of the webhook that was deleted. + /// public string Name { get; } + /// + /// Gets the hash value of the webhook's avatar. + /// + /// + /// A string containing the hash of the webhook's avatar. + /// public string Avatar { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs index 26975cc7c..e60157b1a 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs @@ -1,5 +1,8 @@ namespace Discord.Rest { + /// + /// Represents information for a webhook. + /// public struct WebhookInfo { internal WebhookInfo(string name, ulong? channelId, string avatar) @@ -9,8 +12,27 @@ namespace Discord.Rest Avatar = avatar; } + /// + /// Gets the name of this webhook. + /// + /// + /// A string containing the name of this webhook. + /// public string Name { get; } + /// + /// Gets the ID of the channel that this webhook sends to. + /// + /// + /// A representing the snowflake identifier of the channel that this webhook can send + /// to. + /// public ulong? ChannelId { get; } + /// + /// Gets the hash value of this webhook's avatar. + /// + /// + /// A string containing the hash of this webhook's avatar. + /// public string Avatar { get; } } } diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs index 7db7aee36..b1ac3b97d 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs @@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; namespace Discord.Rest { + /// + /// Contains audit log data related to a webhook update. + /// public class WebhookUpdateAuditLogData : IAuditLogData { private WebhookUpdateAuditLogData(IWebhook webhook, WebhookInfo before, WebhookInfo after) @@ -38,11 +41,28 @@ namespace Discord.Rest return new WebhookUpdateAuditLogData(webhook, before, after); } - //Again, the *current* data + /// + /// Gets the webhook that was updated. + /// + /// + /// A webhook objet representing the webhook that was updated. + /// public IWebhook Webhook { get; } - //And the *audit log* data + /// + /// Gets the webhook information before the changes. + /// + /// + /// A webhook information object representing the webhook before the changes were made. + /// public WebhookInfo Before { get; } + + /// + /// Gets the webhook information after the changes. + /// + /// + /// A webhook information object representing the webhook after the changes were made. + /// public WebhookInfo After { get; } } }