@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data relating to a role deletion. | |||||
/// </summary> | |||||
public class RoleDeleteAuditLogData : IAuditLogData | public class RoleDeleteAuditLogData : IAuditLogData | ||||
{ | { | ||||
private RoleDeleteAuditLogData(ulong id, RoleEditInfo props) | private RoleDeleteAuditLogData(ulong id, RoleEditInfo props) | ||||
@@ -41,7 +44,19 @@ namespace Discord.Rest | |||||
new RoleEditInfo(color, mentionable, hoist, name, permissions)); | new RoleEditInfo(color, mentionable, hoist, name, permissions)); | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the ID of the role that has been deleted. | |||||
/// </summary> | |||||
/// <return> | |||||
/// A <see cref="ulong"/> representing the snowflake identifer to the role that has been deleted. | |||||
/// </return> | |||||
public ulong RoleId { get; } | public ulong RoleId { get; } | ||||
/// <summary> | |||||
/// Gets the role information that has been deleted. | |||||
/// </summary> | |||||
/// <return> | |||||
/// An information object representing the properties of the role that has been deleted. | |||||
/// </return> | |||||
public RoleEditInfo Properties { get; } | public RoleEditInfo Properties { get; } | ||||
} | } | ||||
} | } |
@@ -1,5 +1,8 @@ | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents information for a role edit. | |||||
/// </summary> | |||||
public struct RoleEditInfo | public struct RoleEditInfo | ||||
{ | { | ||||
internal RoleEditInfo(Color? color, bool? mentionable, bool? hoist, string name, | internal RoleEditInfo(Color? color, bool? mentionable, bool? hoist, string name, | ||||
@@ -12,10 +15,44 @@ namespace Discord.Rest | |||||
Permissions = permissions; | Permissions = permissions; | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the color of this role. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A color object representing the color assigned to this role; <c>null</c> if this role does not have a | |||||
/// color. | |||||
/// </returns> | |||||
public Color? Color { get; } | public Color? Color { get; } | ||||
/// <summary> | |||||
/// Determines whether this role is mentionable (i.e. it can be mentioned in a text channel). | |||||
/// </summary> | |||||
/// <returns> | |||||
/// <c>true</c> if other members can mention this role in a text channel; otherwise <c>false</c>. | |||||
/// </returns> | |||||
public bool? Mentionable { get; } | public bool? Mentionable { get; } | ||||
/// <summary> | |||||
/// Determines whether this role is hoisted (i.e its members will appear in a seperate section on the user | |||||
/// list). | |||||
/// </summary> | |||||
/// <returns> | |||||
/// <c>true</c> if this role's members will appear in a seperate section in the user list; otherwise | |||||
/// <c>false</c>. | |||||
/// </returns> | |||||
public bool? Hoist { get; } | public bool? Hoist { get; } | ||||
/// <summary> | |||||
/// Gets the name of this role. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the name of this role. | |||||
/// </returns> | |||||
public string Name { get; } | public string Name { get; } | ||||
/// <summary> | |||||
/// Gets the permissions assigned to this role. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A guild permissions object representing the permissions that have been assigned to this role; <c>null</c> | |||||
/// if no permissions have been assigned. | |||||
/// </returns> | |||||
public GuildPermissions? Permissions { get; } | public GuildPermissions? Permissions { get; } | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data related to a role update. | |||||
/// </summary> | |||||
public class RoleUpdateAuditLogData : IAuditLogData | public class RoleUpdateAuditLogData : IAuditLogData | ||||
{ | { | ||||
private RoleUpdateAuditLogData(ulong id, RoleEditInfo oldProps, RoleEditInfo newProps) | private RoleUpdateAuditLogData(ulong id, RoleEditInfo oldProps, RoleEditInfo newProps) | ||||
@@ -55,8 +58,26 @@ namespace Discord.Rest | |||||
return new RoleUpdateAuditLogData(entry.TargetId.Value, oldProps, newProps); | return new RoleUpdateAuditLogData(entry.TargetId.Value, oldProps, newProps); | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the ID of the role that has been changed. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="ulong"/> representing the snowflake identifier of the role that has been changed. | |||||
/// </returns> | |||||
public ulong RoleId { get; } | public ulong RoleId { get; } | ||||
/// <summary> | |||||
/// Gets the role information before the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A role information object containing the role information before the changes were made. | |||||
/// </returns> | |||||
public RoleEditInfo Before { get; } | public RoleEditInfo Before { get; } | ||||
/// <summary> | |||||
/// Gets the role information after the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A role information object containing the role information after the changes were made. | |||||
/// </returns> | |||||
public RoleEditInfo After { get; } | public RoleEditInfo After { get; } | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data related to an unban. | |||||
/// </summary> | |||||
public class UnbanAuditLogData : IAuditLogData | public class UnbanAuditLogData : IAuditLogData | ||||
{ | { | ||||
private UnbanAuditLogData(IUser user) | private UnbanAuditLogData(IUser user) | ||||
@@ -18,6 +21,12 @@ namespace Discord.Rest | |||||
return new UnbanAuditLogData(RestUser.Create(discord, userInfo)); | return new UnbanAuditLogData(RestUser.Create(discord, userInfo)); | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the user that was unbanned. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A user object representing the user that was unbanned. | |||||
/// </returns> | |||||
public IUser Target { get; } | public IUser Target { get; } | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data related to a webhook creation. | |||||
/// </summary> | |||||
public class WebhookCreateAuditLogData : IAuditLogData | public class WebhookCreateAuditLogData : IAuditLogData | ||||
{ | { | ||||
private WebhookCreateAuditLogData(IWebhook webhook, WebhookType type, string name, ulong channelId) | private WebhookCreateAuditLogData(IWebhook webhook, WebhookType type, string name, ulong channelId) | ||||
@@ -33,12 +36,39 @@ namespace Discord.Rest | |||||
return new WebhookCreateAuditLogData(webhook, type, name, channelId); | return new WebhookCreateAuditLogData(webhook, type, name, channelId); | ||||
} | } | ||||
//Corresponds to the *current* data | |||||
// Doc Note: Corresponds to the *current* data | |||||
/// <summary> | |||||
/// Gets the webhook that was created. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A webhook object representing the webhook that was created. | |||||
/// </returns> | |||||
public IWebhook Webhook { get; } | public IWebhook Webhook { get; } | ||||
//Corresponds to the *audit log* data | |||||
// Doc Note: Corresponds to the *audit log* data | |||||
/// <summary> | |||||
/// Gets the type of webhook that was created. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// The type of webhook that was created. | |||||
/// </returns> | |||||
public WebhookType Type { get; } | public WebhookType Type { get; } | ||||
/// <summary> | |||||
/// Gets the name of the webhook. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the name of the webhook. | |||||
/// </returns> | |||||
public string Name { get; } | public string Name { get; } | ||||
/// <summary> | |||||
/// Gets the ID of the channel that the webhook can send to. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="ulong"/> representing the snowflake identifier of the channel that the webhook can send to. | |||||
/// </returns> | |||||
public ulong ChannelId { get; } | public ulong ChannelId { get; } | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data related to a webhook deletion. | |||||
/// </summary> | |||||
public class WebhookDeleteAuditLogData : IAuditLogData | public class WebhookDeleteAuditLogData : IAuditLogData | ||||
{ | { | ||||
private WebhookDeleteAuditLogData(ulong id, ulong channel, WebhookType type, string name, string avatar) | 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); | return new WebhookDeleteAuditLogData(entry.TargetId.Value, channelId, type, name, avatarHash); | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the ID of the webhook that was deleted. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="ulong"/> representing the snowflake identifier of the webhook that was deleted. | |||||
/// </returns> | |||||
public ulong WebhookId { get; } | public ulong WebhookId { get; } | ||||
/// <summary> | |||||
/// Gets the ID of the channel that the webhook could send to. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="ulong"/> representing the snowflake identifier of the channel that the webhook could send | |||||
/// to. | |||||
/// </returns> | |||||
public ulong ChannelId { get; } | public ulong ChannelId { get; } | ||||
/// <summary> | |||||
/// Gets the type of the webhook that was deleted. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// The type of webhook that was deleted. | |||||
/// </returns> | |||||
public WebhookType Type { get; } | public WebhookType Type { get; } | ||||
/// <summary> | |||||
/// Gets the name of the webhook that was deleted. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the name of the webhook that was deleted. | |||||
/// </returns> | |||||
public string Name { get; } | public string Name { get; } | ||||
/// <summary> | |||||
/// Gets the hash value of the webhook's avatar. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the hash of the webhook's avatar. | |||||
/// </returns> | |||||
public string Avatar { get; } | public string Avatar { get; } | ||||
} | } | ||||
} | } |
@@ -1,5 +1,8 @@ | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents information for a webhook. | |||||
/// </summary> | |||||
public struct WebhookInfo | public struct WebhookInfo | ||||
{ | { | ||||
internal WebhookInfo(string name, ulong? channelId, string avatar) | internal WebhookInfo(string name, ulong? channelId, string avatar) | ||||
@@ -9,8 +12,27 @@ namespace Discord.Rest | |||||
Avatar = avatar; | Avatar = avatar; | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the name of this webhook. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the name of this webhook. | |||||
/// </returns> | |||||
public string Name { get; } | public string Name { get; } | ||||
/// <summary> | |||||
/// Gets the ID of the channel that this webhook sends to. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A <see cref="ulong"/> representing the snowflake identifier of the channel that this webhook can send | |||||
/// to. | |||||
/// </returns> | |||||
public ulong? ChannelId { get; } | public ulong? ChannelId { get; } | ||||
/// <summary> | |||||
/// Gets the hash value of this webhook's avatar. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A string containing the hash of this webhook's avatar. | |||||
/// </returns> | |||||
public string Avatar { get; } | public string Avatar { get; } | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Contains audit log data related to a webhook update. | |||||
/// </summary> | |||||
public class WebhookUpdateAuditLogData : IAuditLogData | public class WebhookUpdateAuditLogData : IAuditLogData | ||||
{ | { | ||||
private WebhookUpdateAuditLogData(IWebhook webhook, WebhookInfo before, WebhookInfo after) | private WebhookUpdateAuditLogData(IWebhook webhook, WebhookInfo before, WebhookInfo after) | ||||
@@ -38,11 +41,28 @@ namespace Discord.Rest | |||||
return new WebhookUpdateAuditLogData(webhook, before, after); | return new WebhookUpdateAuditLogData(webhook, before, after); | ||||
} | } | ||||
//Again, the *current* data | |||||
/// <summary> | |||||
/// Gets the webhook that was updated. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A webhook objet representing the webhook that was updated. | |||||
/// </returns> | |||||
public IWebhook Webhook { get; } | public IWebhook Webhook { get; } | ||||
//And the *audit log* data | |||||
/// <summary> | |||||
/// Gets the webhook information before the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A webhook information object representing the webhook before the changes were made. | |||||
/// </returns> | |||||
public WebhookInfo Before { get; } | public WebhookInfo Before { get; } | ||||
/// <summary> | |||||
/// Gets the webhook information after the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// A webhook information object representing the webhook after the changes were made. | |||||
/// </returns> | |||||
public WebhookInfo After { get; } | public WebhookInfo After { get; } | ||||
} | } | ||||
} | } |