Browse Source

Merge pull request #5 from sarcasmloading/docs/pre-release

Documented remaining audit log data types
pull/1161/head
Still Hsu GitHub 7 years ago
parent
commit
fb46f9a567
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 408 additions and 29 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/BanAuditLogData.cs
  2. +4
    -3
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelCreateAuditLogData.cs
  3. +2
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelDeleteAuditLogData.cs
  4. +14
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelUpdateAuditLogData.cs
  5. +2
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteCreateAuditLogData.cs
  6. +2
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteDeleteAuditLogData.cs
  7. +2
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteUpdateAuditLogData.cs
  8. +1
    -1
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/GuildInfo.cs
  9. +1
    -1
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/GuildUpdateAuditLogData.cs
  10. +4
    -4
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteCreateAuditLogData.cs
  11. +3
    -3
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteDeleteAuditLogData.cs
  12. +1
    -1
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteInfo.cs
  13. +15
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteUpdateAuditLogData.cs
  14. +9
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/KickAuditLogData.cs
  15. +16
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberRoleAuditLogData.cs
  16. +21
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberRoleEditInfo.cs
  17. +21
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberUpdateAuditLogData.cs
  18. +16
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MessageDeleteAuditLogData.cs
  19. +9
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteCreateAuditLogData.cs
  20. +9
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteDeleteAuditLogData.cs
  21. +29
    -1
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteUpdateAuditLogData.cs
  22. +18
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/PruneAuditLogData.cs
  23. +15
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleCreateAuditLogData.cs
  24. +15
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs
  25. +37
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs
  26. +21
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs
  27. +9
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs
  28. +33
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs
  29. +34
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs
  30. +22
    -0
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs
  31. +22
    -2
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs

+ 1
- 1
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/BanAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to a ban.
/// Contains a piece of audit log data related to a ban.
/// </summary>
public class BanAuditLogData : IAuditLogData
{


+ 4
- 3
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelCreateAuditLogData.cs View File

@@ -7,7 +7,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to a channel creation.
/// Contains a piece of audit log data related to a channel creation.
/// </summary>
public class ChannelCreateAuditLogData : IAuditLogData
{
@@ -50,7 +50,7 @@ namespace Discord.Rest
/// Gets the snowflake ID of the created channel.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the snowflake identifier for the created channel.
/// A <see cref="ulong"/> representing the snowflake identifier for the created channel.
/// </returns>
public ulong ChannelId { get; }
/// <summary>
@@ -71,7 +71,8 @@ namespace Discord.Rest
/// Gets a collection of permission overwrites that was assigned to the created channel.
/// </summary>
/// <returns>
/// A collection of permission <see cref="Overwrite"/>.
/// A collection of permission <see cref="Overwrite"/>, containing the permission overwrites that were
/// assigned to the created channel.
/// </returns>
public IReadOnlyCollection<Overwrite> Overwrites { get; }
}


+ 2
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelDeleteAuditLogData.cs View File

@@ -7,7 +7,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to a channel deletion.
/// Contains a piece of audit log data related to a channel deletion.
/// </summary>
public class ChannelDeleteAuditLogData : IAuditLogData
{
@@ -41,7 +41,7 @@ namespace Discord.Rest
/// Gets the snowflake ID of the deleted channel.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the snowflake identifier for the deleted channel.
/// A <see cref="ulong"/> representing the snowflake identifier for the deleted channel.
/// </returns>
public ulong ChannelId { get; }
/// <summary>


+ 14
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ChannelUpdateAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to a channel update.
/// Contains a piece of audit log data related to a channel update.
/// </summary>
public class ChannelUpdateAuditLogData : IAuditLogData
{
@@ -45,10 +45,22 @@ namespace Discord.Rest
/// Gets the snowflake ID of the updated channel.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the snowflake identifier for the updated channel.
/// A <see cref="ulong"/> representing the snowflake identifier for the updated channel.
/// </returns>
public ulong ChannelId { get; }
/// <summary>
/// Gets the channel information before the changes.
/// </summary>
/// <returns>
/// An information object containing the original channel information before the changes were made.
/// </returns>
public ChannelInfo Before { get; }
/// <summary>
/// Gets the channel information after the changes.
/// </summary>
/// <returns>
/// An information object containing the channel information after the changes were made.
/// </returns>
public ChannelInfo After { get; }
}
}

+ 2
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteCreateAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to an emoji creation.
/// Contains a piece of audit log data related to an emoji creation.
/// </summary>
public class EmoteCreateAuditLogData : IAuditLogData
{
@@ -28,7 +28,7 @@ namespace Discord.Rest
/// Gets the snowflake ID of the created emoji.
/// </summary>
/// <returns>
/// An <see cref="System.UInt64"/> representing the snowflake identifier for the created emoji.
/// A <see cref="System.UInt64"/> representing the snowflake identifier for the created emoji.
/// </returns>
public ulong EmoteId { get; }
/// <summary>


+ 2
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteDeleteAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to an emoji deletion.
/// Contains a piece of audit log data related to an emoji deletion.
/// </summary>
public class EmoteDeleteAuditLogData : IAuditLogData
{
@@ -29,7 +29,7 @@ namespace Discord.Rest
/// Gets the snowflake ID of the deleted emoji.
/// </summary>
/// <returns>
/// An <see cref="System.UInt64"/> representing the snowflake identifier for the deleted emoji.
/// A <see cref="System.UInt64"/> representing the snowflake identifier for the deleted emoji.
/// </returns>
public ulong EmoteId { get; }
/// <summary>


+ 2
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/EmoteUpdateAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to an emoji update.
/// Contains a piece of audit log data related to an emoji update.
/// </summary>
public class EmoteUpdateAuditLogData : IAuditLogData
{
@@ -31,7 +31,7 @@ namespace Discord.Rest
/// Gets the snowflake ID of the updated emoji.
/// </summary>
/// <returns>
/// An <see cref="System.UInt64"/> representing the snowflake identifier of the updated emoji.
/// A <see cref="ulong"/> representing the snowflake identifier of the updated emoji.
/// </returns>
public ulong EmoteId { get; }
/// <summary>


+ 1
- 1
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/GuildInfo.cs View File

@@ -38,7 +38,7 @@ namespace Discord.Rest
/// Gets the ID of the AFK voice channel for this guild.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the snowflake identifier of the AFK voice channel; <c>null</c> if
/// A <see cref="ulong"/> representing the snowflake identifier of the AFK voice channel; <c>null</c> if
/// none is set.
/// </returns>
public ulong? AfkChannelId { get; }


+ 1
- 1
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/GuildUpdateAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to a guild update.
/// Contains a piece of audit log data related to a guild update.
/// </summary>
public class GuildUpdateAuditLogData : IAuditLogData
{


+ 4
- 4
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteCreateAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to an invite creation.
/// Contains a piece of audit log data related to an invite creation.
/// </summary>
public class InviteCreateAuditLogData : IAuditLogData
{
@@ -66,7 +66,7 @@ namespace Discord.Rest
/// when the user logs off).
/// </summary>
/// <returns>
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>false</c>.
/// </returns>
public bool Temporary { get; }
@@ -81,14 +81,14 @@ namespace Discord.Rest
/// Gets the ID of the channel this invite is linked to.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the channel snowflake identifier that the invite points to.
/// A <see cref="ulong"/> representing the channel snowflake identifier that the invite points to.
/// </returns>
public ulong ChannelId { get; }
/// <summary>
/// Gets the number of times this invite has been used.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of times this invite has been used.
/// An <see cref="int"/> representing the number of times this invite was used.
/// </returns>
public int Uses { get; }
/// <summary>


+ 3
- 3
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteDeleteAuditLogData.cs View File

@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry;
namespace Discord.Rest
{
/// <summary>
/// Represents a piece of audit log data related to an invite removal.
/// Contains a piece of audit log data related to an invite removal.
/// </summary>
public class InviteDeleteAuditLogData : IAuditLogData
{
@@ -66,7 +66,7 @@ namespace Discord.Rest
/// when the user logs off).
/// </summary>
/// <returns>
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>false</c>.
/// </returns>
public bool Temporary { get; }
@@ -81,7 +81,7 @@ namespace Discord.Rest
/// Gets the ID of the channel this invite is linked to.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the channel snowflake identifier that the invite points to.
/// A <see cref="ulong"/> representing the channel snowflake identifier that the invite points to.
/// </returns>
public ulong ChannelId { get; }
/// <summary>


+ 1
- 1
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteInfo.cs View File

@@ -42,7 +42,7 @@ namespace Discord.Rest
/// Gets the ID of the channel this invite is linked to.
/// </summary>
/// <returns>
/// An <see cref="ulong"/> representing the channel snowflake identifier that the invite points to;
/// A <see cref="ulong"/> representing the channel snowflake identifier that the invite points to;
/// <c>null</c> if not specified.
/// </returns>
public ulong? ChannelId { get; }


+ 15
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/InviteUpdateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data relating to an invite update.
/// </summary>
public class InviteUpdateAuditLogData : IAuditLogData
{
private InviteUpdateAuditLogData(InviteInfo before, InviteInfo after)
@@ -40,7 +43,19 @@ namespace Discord.Rest
return new InviteUpdateAuditLogData(before, after);
}

/// <summary>
/// Gets the invite information before the changes.
/// </summary>
/// <returns>
/// An information object containing the original invite information before the changes were made.
/// </returns>
public InviteInfo Before { get; }
/// <summary>
/// Gets the invite information after the changes.
/// </summary>
/// <returns>
/// An information object containing the invite information after the changes were made.
/// </returns>
public InviteInfo After { get; }
}
}

+ 9
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/KickAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a kick.
/// </summary>
public class KickAuditLogData : IAuditLogData
{
private KickAuditLogData(RestUser user)
@@ -18,6 +21,12 @@ namespace Discord.Rest
return new KickAuditLogData(RestUser.Create(discord, userInfo));
}

/// <summary>
/// Gets the user that was kicked.
/// </summary>
/// <returns>
/// A user object representing the kicked user.
/// </returns>
public IUser Target { get; }
}
}

+ 16
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberRoleAuditLogData.cs View File

@@ -6,6 +6,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a change in a guild member's roles.
/// </summary>
public class MemberRoleAuditLogData : IAuditLogData
{
private MemberRoleAuditLogData(IReadOnlyCollection<MemberRoleEditInfo> roles, IUser target)
@@ -29,7 +32,20 @@ namespace Discord.Rest
return new MemberRoleAuditLogData(roleInfos.ToReadOnlyCollection(), user);
}

/// <summary>
/// Gets a collection of role changes that were performed on the member.
/// </summary>
/// <returns>
/// A read-only collection of <see cref="MemberRoleEditInfo"/>, containing the roles that were changed on
/// the member.
/// </returns>
public IReadOnlyCollection<MemberRoleEditInfo> Roles { get; }
/// <summary>
/// Gets the user that the roles changes were performed on.
/// </summary>
/// <returns>
/// A user object representing the user that the role changes were performed on.
/// </returns>
public IUser Target { get; }
}
}

+ 21
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberRoleEditInfo.cs View File

@@ -1,5 +1,8 @@
namespace Discord.Rest
{
/// <summary>
/// An information object representing a change in one of a guild member's roles.
/// </summary>
public struct MemberRoleEditInfo
{
internal MemberRoleEditInfo(string name, ulong roleId, bool added)
@@ -9,8 +12,26 @@ namespace Discord.Rest
Added = added;
}

/// <summary>
/// Gets the name of the role that was changed.
/// </summary>
/// <returns>
/// A string containing the name of the role that was changed.
/// </returns>
public string Name { get; }
/// <summary>
/// Gets the ID of the role that was changed.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the role that was changed.
/// </returns>
public ulong RoleId { get; }
/// <summary>
/// Determines whether the role was added to the user.
/// </summary>
/// <returns>
/// <c>true</c> if the role was added to the user; otherwise <c>false</c>.
/// </returns>
public bool Added { get; }
}
}

+ 21
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MemberUpdateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a change in a guild member.
/// </summary>
public class MemberUpdateAuditLogData : IAuditLogData
{
private MemberUpdateAuditLogData(IUser target, string newNick, string oldNick)
@@ -27,8 +30,26 @@ namespace Discord.Rest
return new MemberUpdateAuditLogData(user, newNick, oldNick);
}

/// <summary>
/// Gets the user that the changes were performed on.
/// </summary>
/// <returns>
/// A user object representing the user who the changes were performed on.
/// </returns>
public IUser Target { get; }
/// <summary>
/// Gets the new nickname of the user.
/// </summary>
/// <returns>
/// A string containing the new nickname of the user; <c>null</c> if the user no longer had a nickname.
/// </returns>
public string NewNick { get; }
/// <summary>
/// Gets the old nickname of the user.
/// </summary>
/// <returns>
/// A string containing the old nickname of the user; <c>null</c> if the user did not have a nickname.
/// </returns>
public string OldNick { get; }
}
}

+ 16
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/MessageDeleteAuditLogData.cs View File

@@ -3,6 +3,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to message deletion(s).
/// </summary>
public class MessageDeleteAuditLogData : IAuditLogData
{
private MessageDeleteAuditLogData(ulong channelId, int count)
@@ -16,7 +19,20 @@ namespace Discord.Rest
return new MessageDeleteAuditLogData(entry.Options.MessageDeleteChannelId.Value, entry.Options.MessageDeleteCount.Value);
}

/// <summary>
/// Gets the number of messages that were deleted.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of messages that were deleted from the channel.
/// </returns>
public int MessageCount { get; }
/// <summary>
/// Gets the ID of the channel that the messages were deleted from.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifer for the channel that the messages were
/// deleted from.
/// </returns>
public ulong ChannelId { get; }
}
}

+ 9
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteCreateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data for a permissions overwrite creation.
/// </summary>
public class OverwriteCreateAuditLogData : IAuditLogData
{
private OverwriteCreateAuditLogData(Overwrite overwrite)
@@ -32,6 +35,12 @@ namespace Discord.Rest
return new OverwriteCreateAuditLogData(new Overwrite(id, target, permissions));
}

/// <summary>
/// Gets the permission overwrite object that was created.
/// </summary>
/// <returns>
/// An <see cref="Overwrite"/> object representing the overwrite that was created.
/// </returns>
public Overwrite Overwrite { get; }
}
}

+ 9
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteDeleteAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to the deletion of a permission overwrite.
/// </summary>
public class OverwriteDeleteAuditLogData : IAuditLogData
{
private OverwriteDeleteAuditLogData(Overwrite deletedOverwrite)
@@ -31,6 +34,12 @@ namespace Discord.Rest
return new OverwriteDeleteAuditLogData(new Overwrite(id, target, new OverwritePermissions(allow, deny)));
}

/// <summary>
/// Gets the permission overwrite object that was deleted.
/// </summary>
/// <returns>
/// An <see cref="Overwrite"/> object representing the overwrite that was deleted.
/// </returns>
public Overwrite Overwrite { get; }
}
}

+ 29
- 1
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/OverwriteUpdateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to the update of a permission overwrite.
/// </summary>
public class OverwriteUpdateAuditLogData : IAuditLogData
{
private OverwriteUpdateAuditLogData(OverwritePermissions before, OverwritePermissions after, ulong targetId, PermissionTarget targetType)
@@ -35,10 +38,35 @@ namespace Discord.Rest
return new OverwriteUpdateAuditLogData(beforePermissions, afterPermissions, entry.Options.OverwriteTargetId.Value, target);
}

/// <summary>
/// Gets the overwrite permissions before the changes.
/// </summary>
/// <returns>
/// An overwrite permissions object representing the overwrite permissions that the overwrite had before
/// the changes were made.
/// </returns>
public OverwritePermissions OldPermissions { get; }
/// <summary>
/// Gets the overwrite permissions after the changes.
/// </summary>
/// <returns>
/// An overwrite permissions object representing the overwrite permissions that the overwrite had after the
/// changes.
/// </returns>
public OverwritePermissions NewPermissions { get; }

/// <summary>
/// Gets the ID of the overwrite that was updated.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the overwrite that was updated.
/// </returns>
public ulong OverwriteTargetId { get; }
/// <summary>
/// Gets the target of the updated permission overwrite.
/// </summary>
/// <returns>
/// The target of the updated permission overwrite.
/// </returns>
public PermissionTarget OverwriteType { get; }
}
}

+ 18
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/PruneAuditLogData.cs View File

@@ -3,6 +3,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a guild prune.
/// </summary>
public class PruneAuditLogData : IAuditLogData
{
private PruneAuditLogData(int pruneDays, int membersRemoved)
@@ -16,7 +19,22 @@ namespace Discord.Rest
return new PruneAuditLogData(entry.Options.PruneDeleteMemberDays.Value, entry.Options.PruneMembersRemoved.Value);
}

/// <summary>
/// Gets the threshold for a guild member to not be kicked.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the amount of days that a member must have been seen in the server,
/// to avoid being kicked. (i.e. If a user has not been seen for more than <paramref cref="PruneDays"/>, they will be
/// kicked from the server)
/// </returns>
public int PruneDays { get; }
/// <summary>
/// Gets the number of members that were kicked during the purge.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of members that were removed from this guild for having
/// not been seen within <paramref cref="PruneDays"/>.
/// </returns>
public int MembersRemoved { get; }
}
}

+ 15
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleCreateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a role creation.
/// </summary>
public class RoleCreateAuditLogData : IAuditLogData
{
private RoleCreateAuditLogData(ulong id, RoleEditInfo props)
@@ -41,7 +44,19 @@ namespace Discord.Rest
new RoleEditInfo(color, mentionable, hoist, name, permissions));
}

/// <summary>
/// Gets the ID of the role that was created.
/// </summary>
/// <return>
/// A <see cref="ulong"/> representing the snowflake identifer to the role that was created.
/// </return>
public ulong RoleId { get; }
/// <summary>
/// Gets the role information that was created.
/// </summary>
/// <return>
/// An information object representing the properties of the role that was created.
/// </return>
public RoleEditInfo Properties { get; }
}
}

+ 15
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleDeleteAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data relating to a role deletion.
/// </summary>
public class RoleDeleteAuditLogData : IAuditLogData
{
private RoleDeleteAuditLogData(ulong id, RoleEditInfo props)
@@ -41,7 +44,19 @@ namespace Discord.Rest
new RoleEditInfo(color, mentionable, hoist, name, permissions));
}

/// <summary>
/// Gets the ID of the role that was deleted.
/// </summary>
/// <return>
/// A <see cref="ulong"/> representing the snowflake identifer to the role that was deleted.
/// </return>
public ulong RoleId { get; }
/// <summary>
/// Gets the role information that was deleted.
/// </summary>
/// <return>
/// An information object representing the properties of the role that was deleted.
/// </return>
public RoleEditInfo Properties { get; }
}
}

+ 37
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleEditInfo.cs View File

@@ -1,5 +1,8 @@
namespace Discord.Rest
{
/// <summary>
/// Represents information for a role edit.
/// </summary>
public struct RoleEditInfo
{
internal RoleEditInfo(Color? color, bool? mentionable, bool? hoist, string name,
@@ -12,10 +15,44 @@ namespace Discord.Rest
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; }
/// <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; }
/// <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; }
/// <summary>
/// Gets the name of this role.
/// </summary>
/// <returns>
/// A string containing the name of this role.
/// </returns>
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; }
}
}

+ 21
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/RoleUpdateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a role update.
/// </summary>
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);
}

/// <summary>
/// Gets the ID of the role that was changed.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the role that was changed.
/// </returns>
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; }
/// <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; }
}
}

+ 9
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/UnbanAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to an unban.
/// </summary>
public class UnbanAuditLogData : IAuditLogData
{
private UnbanAuditLogData(IUser user)
@@ -18,6 +21,12 @@ namespace Discord.Rest
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; }
}
}

+ 33
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookCreateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a webhook creation.
/// </summary>
public class WebhookCreateAuditLogData : IAuditLogData
{
private WebhookCreateAuditLogData(IWebhook webhook, WebhookType type, string name, ulong channelId)
@@ -33,12 +36,40 @@ namespace Discord.Rest
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; }

//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; }

/// <summary>
/// Gets the name of the webhook.
/// </summary>
/// <returns>
/// A string containing the name of the webhook.
/// </returns>
public string Name { 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; }
}
}

+ 34
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookDeleteAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a webhook deletion.
/// </summary>
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);
}

/// <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; }
/// <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; }
/// <summary>
/// Gets the type of the webhook that was deleted.
/// </summary>
/// <returns>
/// The type of webhook that was deleted.
/// </returns>
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; }
/// <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; }
}
}

+ 22
- 0
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookInfo.cs View File

@@ -1,5 +1,8 @@
namespace Discord.Rest
{
/// <summary>
/// Represents information for a webhook.
/// </summary>
public struct WebhookInfo
{
internal WebhookInfo(string name, ulong? channelId, string avatar)
@@ -9,8 +12,27 @@ namespace Discord.Rest
Avatar = avatar;
}

/// <summary>
/// Gets the name of this webhook.
/// </summary>
/// <returns>
/// A string containing the name of this webhook.
/// </returns>
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; }
/// <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; }
}
}

+ 22
- 2
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs View File

@@ -5,6 +5,9 @@ using EntryModel = Discord.API.AuditLogEntry;

namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a webhook update.
/// </summary>
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
/// <summary>
/// Gets the webhook that was updated.
/// </summary>
/// <returns>
/// A webhook objet representing the webhook that was updated.
/// </returns>
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; }

/// <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; }
}
}

Loading…
Cancel
Save