Browse Source

Fix almost all data classes

pull/2493/head
TheStachelfisch 2 years ago
parent
commit
c3425849fe
No known key found for this signature in database GPG Key ID: FDBE46E36F3928DB
100 changed files with 751 additions and 752 deletions
  1. +14
    -15
      src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
  2. +3
    -3
      src/Discord.Net.Rest/API/Common/ActionRowComponent.cs
  3. +5
    -5
      src/Discord.Net.Rest/API/Common/AllowedMentions.cs
  4. +15
    -15
      src/Discord.Net.Rest/API/Common/Application.cs
  5. +15
    -15
      src/Discord.Net.Rest/API/Common/ApplicationCommand.cs
  6. +6
    -6
      src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs
  7. +5
    -5
      src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs
  8. +7
    -7
      src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs
  9. +18
    -18
      src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs
  10. +5
    -5
      src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs
  11. +4
    -4
      src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs
  12. +11
    -11
      src/Discord.Net.Rest/API/Common/Attachment.cs
  13. +6
    -6
      src/Discord.Net.Rest/API/Common/AuditLog.cs
  14. +4
    -4
      src/Discord.Net.Rest/API/Common/AuditLogChange.cs
  15. +8
    -8
      src/Discord.Net.Rest/API/Common/AuditLogEntry.cs
  16. +9
    -9
      src/Discord.Net.Rest/API/Common/AuditLogOptions.cs
  17. +6
    -6
      src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs
  18. +6
    -6
      src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs
  19. +3
    -3
      src/Discord.Net.Rest/API/Common/Ban.cs
  20. +8
    -8
      src/Discord.Net.Rest/API/Common/ButtonComponent.cs
  21. +26
    -26
      src/Discord.Net.Rest/API/Common/Channel.cs
  22. +3
    -3
      src/Discord.Net.Rest/API/Common/ChannelThreads.cs
  23. +10
    -10
      src/Discord.Net.Rest/API/Common/Connection.cs
  24. +4
    -4
      src/Discord.Net.Rest/API/Common/DiscordError.cs
  25. +14
    -14
      src/Discord.Net.Rest/API/Common/Embed.cs
  26. +5
    -5
      src/Discord.Net.Rest/API/Common/EmbedAuthor.cs
  27. +4
    -4
      src/Discord.Net.Rest/API/Common/EmbedField.cs
  28. +4
    -4
      src/Discord.Net.Rest/API/Common/EmbedFooter.cs
  29. +5
    -5
      src/Discord.Net.Rest/API/Common/EmbedImage.cs
  30. +3
    -3
      src/Discord.Net.Rest/API/Common/EmbedProvider.cs
  31. +5
    -5
      src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs
  32. +4
    -4
      src/Discord.Net.Rest/API/Common/EmbedVideo.cs
  33. +8
    -8
      src/Discord.Net.Rest/API/Common/Emoji.cs
  34. +3
    -3
      src/Discord.Net.Rest/API/Common/Error.cs
  35. +5
    -5
      src/Discord.Net.Rest/API/Common/ForumTags.cs
  36. +8
    -8
      src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs
  37. +19
    -19
      src/Discord.Net.Rest/API/Common/Game.cs
  38. +5
    -5
      src/Discord.Net.Rest/API/Common/GameAssets.cs
  39. +3
    -3
      src/Discord.Net.Rest/API/Common/GameParty.cs
  40. +5
    -5
      src/Discord.Net.Rest/API/Common/GameSecrets.cs
  41. +4
    -4
      src/Discord.Net.Rest/API/Common/GameTimestamps.cs
  42. +40
    -40
      src/Discord.Net.Rest/API/Common/Guild.cs
  43. +5
    -5
      src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs
  44. +11
    -11
      src/Discord.Net.Rest/API/Common/GuildMember.cs
  45. +17
    -17
      src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs
  46. +2
    -2
      src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs
  47. +4
    -4
      src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs
  48. +3
    -3
      src/Discord.Net.Rest/API/Common/GuildWidget.cs
  49. +3
    -3
      src/Discord.Net.Rest/API/Common/InstallParams.cs
  50. +17
    -17
      src/Discord.Net.Rest/API/Common/Integration.cs
  51. +3
    -3
      src/Discord.Net.Rest/API/Common/IntegrationAccount.cs
  52. +7
    -7
      src/Discord.Net.Rest/API/Common/IntegrationApplication.cs
  53. +14
    -14
      src/Discord.Net.Rest/API/Common/Interaction.cs
  54. +10
    -10
      src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs
  55. +3
    -3
      src/Discord.Net.Rest/API/Common/InteractionResponse.cs
  56. +9
    -9
      src/Discord.Net.Rest/API/Common/Invite.cs
  57. +4
    -4
      src/Discord.Net.Rest/API/Common/InviteChannel.cs
  58. +4
    -4
      src/Discord.Net.Rest/API/Common/InviteGuild.cs
  59. +6
    -6
      src/Discord.Net.Rest/API/Common/InviteMetadata.cs
  60. +3
    -3
      src/Discord.Net.Rest/API/Common/InviteVanity.cs
  61. +27
    -27
      src/Discord.Net.Rest/API/Common/Message.cs
  62. +3
    -3
      src/Discord.Net.Rest/API/Common/MessageActivity.cs
  63. +6
    -6
      src/Discord.Net.Rest/API/Common/MessageApplication.cs
  64. +5
    -5
      src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs
  65. +5
    -5
      src/Discord.Net.Rest/API/Common/MessageInteraction.cs
  66. +5
    -5
      src/Discord.Net.Rest/API/Common/MessageReference.cs
  67. +3
    -3
      src/Discord.Net.Rest/API/Common/ModalInteractionData.cs
  68. +2
    -2
      src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs
  69. +5
    -5
      src/Discord.Net.Rest/API/Common/Overwrite.cs
  70. +9
    -9
      src/Discord.Net.Rest/API/Common/Presence.cs
  71. +3
    -3
      src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs
  72. +4
    -4
      src/Discord.Net.Rest/API/Common/Ratelimit.cs
  73. +4
    -4
      src/Discord.Net.Rest/API/Common/Reaction.cs
  74. +4
    -4
      src/Discord.Net.Rest/API/Common/ReadState.cs
  75. +4
    -4
      src/Discord.Net.Rest/API/Common/Relationship.cs
  76. +12
    -12
      src/Discord.Net.Rest/API/Common/Role.cs
  77. +4
    -4
      src/Discord.Net.Rest/API/Common/RoleTags.cs
  78. +9
    -9
      src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs
  79. +6
    -6
      src/Discord.Net.Rest/API/Common/SelectMenuOption.cs
  80. +5
    -5
      src/Discord.Net.Rest/API/Common/SessionStartLimit.cs
  81. +7
    -7
      src/Discord.Net.Rest/API/Common/StageInstance.cs
  82. +12
    -12
      src/Discord.Net.Rest/API/Common/Sticker.cs
  83. +4
    -4
      src/Discord.Net.Rest/API/Common/StickerItem.cs
  84. +8
    -8
      src/Discord.Net.Rest/API/Common/StickerPack.cs
  85. +6
    -6
      src/Discord.Net.Rest/API/Common/Team.cs
  86. +5
    -5
      src/Discord.Net.Rest/API/Common/TeamMember.cs
  87. +10
    -10
      src/Discord.Net.Rest/API/Common/TextInputComponent.cs
  88. +5
    -5
      src/Discord.Net.Rest/API/Common/ThreadMember.cs
  89. +7
    -7
      src/Discord.Net.Rest/API/Common/ThreadMetadata.cs
  90. +15
    -15
      src/Discord.Net.Rest/API/Common/User.cs
  91. +6
    -6
      src/Discord.Net.Rest/API/Common/UserGuild.cs
  92. +7
    -7
      src/Discord.Net.Rest/API/Common/VoiceRegion.cs
  93. +14
    -14
      src/Discord.Net.Rest/API/Common/VoiceState.cs
  94. +9
    -9
      src/Discord.Net.Rest/API/Common/Webhook.cs
  95. +6
    -6
      src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs
  96. +10
    -10
      src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs
  97. +8
    -8
      src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
  98. +2
    -2
      src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs
  99. +11
    -11
      src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
  100. +4
    -4
      src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs

+ 14
- 15
src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs View File

@@ -1,4 +1,3 @@
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@@ -19,7 +18,7 @@ namespace Discord
/// Gets a <see cref="OverwritePermissions" /> that grants all permissions for the given channel. /// Gets a <see cref="OverwritePermissions" /> that grants all permissions for the given channel.
/// </summary> /// </summary>
/// <exception cref="ArgumentException">Unknown channel type.</exception> /// <exception cref="ArgumentException">Unknown channel type.</exception>
public static OverwritePermissions AllowAll(IChannel channel)
public static OverwritePermissions AllowAll(IChannel channel)
=> new OverwritePermissions(ChannelPermissions.All(channel).RawValue, 0); => new OverwritePermissions(ChannelPermissions.All(channel).RawValue, 0);
/// <summary> /// <summary>
/// Gets a <see cref="OverwritePermissions" /> that denies all permissions for the given channel. /// Gets a <see cref="OverwritePermissions" /> that denies all permissions for the given channel.
@@ -116,24 +115,24 @@ namespace Discord


private OverwritePermissions(ulong allowValue, ulong denyValue, private OverwritePermissions(ulong allowValue, ulong denyValue,
PermValue? createInstantInvite = null, PermValue? createInstantInvite = null,
PermValue? manageChannel = null,
PermValue? manageChannel = null,
PermValue? addReactions = null, PermValue? addReactions = null,
PermValue? viewChannel = null, PermValue? viewChannel = null,
PermValue? sendMessages = null, PermValue? sendMessages = null,
PermValue? sendTTSMessages = null, PermValue? sendTTSMessages = null,
PermValue? manageMessages = null,
PermValue? manageMessages = null,
PermValue? embedLinks = null, PermValue? embedLinks = null,
PermValue? attachFiles = null, PermValue? attachFiles = null,
PermValue? readMessageHistory = null, PermValue? readMessageHistory = null,
PermValue? mentionEveryone = null,
PermValue? mentionEveryone = null,
PermValue? useExternalEmojis = null, PermValue? useExternalEmojis = null,
PermValue? connect = null, PermValue? connect = null,
PermValue? speak = null, PermValue? speak = null,
PermValue? muteMembers = null,
PermValue? muteMembers = null,
PermValue? deafenMembers = null, PermValue? deafenMembers = null,
PermValue? moveMembers = null, PermValue? moveMembers = null,
PermValue? useVoiceActivation = null, PermValue? useVoiceActivation = null,
PermValue? manageRoles = null,
PermValue? manageRoles = null,
PermValue? manageWebhooks = null, PermValue? manageWebhooks = null,
PermValue? prioritySpeaker = null, PermValue? prioritySpeaker = null,
PermValue? stream = null, PermValue? stream = null,
@@ -194,7 +193,7 @@ namespace Discord
PermValue viewChannel = PermValue.Inherit, PermValue viewChannel = PermValue.Inherit,
PermValue sendMessages = PermValue.Inherit, PermValue sendMessages = PermValue.Inherit,
PermValue sendTTSMessages = PermValue.Inherit, PermValue sendTTSMessages = PermValue.Inherit,
PermValue manageMessages = PermValue.Inherit,
PermValue manageMessages = PermValue.Inherit,
PermValue embedLinks = PermValue.Inherit, PermValue embedLinks = PermValue.Inherit,
PermValue attachFiles = PermValue.Inherit, PermValue attachFiles = PermValue.Inherit,
PermValue readMessageHistory = PermValue.Inherit, PermValue readMessageHistory = PermValue.Inherit,
@@ -221,8 +220,8 @@ namespace Discord
PermValue useExternalStickers = PermValue.Inherit, PermValue useExternalStickers = PermValue.Inherit,
PermValue sendMessagesInThreads = PermValue.Inherit, PermValue sendMessagesInThreads = PermValue.Inherit,
PermValue startEmbeddedActivities = PermValue.Inherit) PermValue startEmbeddedActivities = PermValue.Inherit)
: this(0, 0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
: this(0, 0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands, moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands,
requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers, requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers,
sendMessagesInThreads, startEmbeddedActivities) { } sendMessagesInThreads, startEmbeddedActivities) { }
@@ -238,11 +237,11 @@ namespace Discord
PermValue? viewChannel = null, PermValue? viewChannel = null,
PermValue? sendMessages = null, PermValue? sendMessages = null,
PermValue? sendTTSMessages = null, PermValue? sendTTSMessages = null,
PermValue? manageMessages = null,
PermValue? manageMessages = null,
PermValue? embedLinks = null, PermValue? embedLinks = null,
PermValue? attachFiles = null, PermValue? attachFiles = null,
PermValue? readMessageHistory = null, PermValue? readMessageHistory = null,
PermValue? mentionEveryone = null,
PermValue? mentionEveryone = null,
PermValue? useExternalEmojis = null, PermValue? useExternalEmojis = null,
PermValue? connect = null, PermValue? connect = null,
PermValue? speak = null, PermValue? speak = null,
@@ -265,8 +264,8 @@ namespace Discord
PermValue? useExternalStickers = null, PermValue? useExternalStickers = null,
PermValue? sendMessagesInThreads = null, PermValue? sendMessagesInThreads = null,
PermValue? startEmbeddedActivities = null) PermValue? startEmbeddedActivities = null)
=> new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
=> new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands, moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands,
requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers, requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers,
sendMessagesInThreads, startEmbeddedActivities); sendMessagesInThreads, startEmbeddedActivities);
@@ -305,7 +304,7 @@ namespace Discord
} }


public override string ToString() => $"Allow {AllowValue}, Deny {DenyValue}"; public override string ToString() => $"Allow {AllowValue}, Deny {DenyValue}";
private string DebuggerDisplay =>
private string DebuggerDisplay =>
$"Allow {string.Join(", ", ToAllowList())}, " + $"Allow {string.Join(", ", ToAllowList())}, " +
$"Deny {string.Join(", ", ToDenyList())}"; $"Deny {string.Join(", ", ToDenyList())}";
} }


+ 3
- 3
src/Discord.Net.Rest/API/Common/ActionRowComponent.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Linq; using System.Linq;


namespace Discord.API namespace Discord.API
{ {
internal class ActionRowComponent : IMessageComponent internal class ActionRowComponent : IMessageComponent
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ComponentType Type { get; set; } public ComponentType Type { get; set; }


[JsonProperty("components")]
[JsonPropertyName("components")]
public IMessageComponent[] Components { get; set; } public IMessageComponent[] Components { get; set; }


internal ActionRowComponent() { } internal ActionRowComponent() { }


+ 5
- 5
src/Discord.Net.Rest/API/Common/AllowedMentions.cs View File

@@ -1,17 +1,17 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AllowedMentions internal class AllowedMentions
{ {
[JsonProperty("parse")]
[JsonPropertyName("parse")]
public Optional<string[]> Parse { get; set; } public Optional<string[]> Parse { get; set; }
// Roles and Users have a max size of 100 // Roles and Users have a max size of 100
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<ulong[]> Roles { get; set; } public Optional<ulong[]> Roles { get; set; }
[JsonProperty("users")]
[JsonPropertyName("users")]
public Optional<ulong[]> Users { get; set; } public Optional<ulong[]> Users { get; set; }
[JsonProperty("replied_user")]
[JsonPropertyName("replied_user")]
public Optional<bool> RepliedUser { get; set; } public Optional<bool> RepliedUser { get; set; }
} }
} }

+ 15
- 15
src/Discord.Net.Rest/API/Common/Application.cs View File

@@ -1,36 +1,36 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Application internal class Application
{ {
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
[JsonProperty("rpc_origins")]
[JsonPropertyName("rpc_origins")]
public Optional<string[]> RPCOrigins { get; set; } public Optional<string[]> RPCOrigins { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public string Icon { get; set; } public string Icon { get; set; }
[JsonProperty("bot_public")]
[JsonPropertyName("bot_public")]
public bool IsBotPublic { get; set; } public bool IsBotPublic { get; set; }
[JsonProperty("bot_require_code_grant")]
[JsonPropertyName("bot_require_code_grant")]
public bool BotRequiresCodeGrant { get; set; } public bool BotRequiresCodeGrant { get; set; }
[JsonProperty("install_params")]
[JsonPropertyName("install_params")]
public Optional<InstallParams> InstallParams { get; set; } public Optional<InstallParams> InstallParams { get; set; }
[JsonProperty("team")]
[JsonPropertyName("team")]
public Team Team { get; set; } public Team Team { get; set; }
[JsonProperty("flags"), Int53]
[JsonPropertyName("flags"), Int53]
public Optional<ApplicationFlags> Flags { get; set; } public Optional<ApplicationFlags> Flags { get; set; }
[JsonProperty("owner")]
[JsonPropertyName("owner")]
public Optional<User> Owner { get; set; } public Optional<User> Owner { get; set; }
[JsonProperty("tags")]
[JsonPropertyName("tags")]
public Optional<string[]> Tags { get; set; } public Optional<string[]> Tags { get; set; }
[JsonProperty("terms_of_service_url")]
[JsonPropertyName("terms_of_service_url")]
public string TermsOfService { get; set; } public string TermsOfService { get; set; }
[JsonProperty("privacy_policy_url")]
[JsonPropertyName("privacy_policy_url")]
public string PrivacyPolicy { get; set; } public string PrivacyPolicy { get; set; }
} }
} }

+ 15
- 15
src/Discord.Net.Rest/API/Common/ApplicationCommand.cs View File

@@ -1,48 +1,48 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommand internal class ApplicationCommand
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; } = ApplicationCommandType.Slash; // defaults to 1 which is slash. public ApplicationCommandType Type { get; set; } = ApplicationCommandType.Slash; // defaults to 1 which is slash.


[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public ulong ApplicationId { get; set; } public ulong ApplicationId { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<ApplicationCommandOption[]> Options { get; set; } public Optional<ApplicationCommandOption[]> Options { get; set; }


[JsonProperty("default_permission")]
[JsonPropertyName("default_permission")]
public Optional<bool> DefaultPermissions { get; set; } public Optional<bool> DefaultPermissions { get; set; }


[JsonProperty("name_localizations")]
[JsonPropertyName("name_localizations")]
public Optional<Dictionary<string, string>> NameLocalizations { get; set; } public Optional<Dictionary<string, string>> NameLocalizations { get; set; }


[JsonProperty("description_localizations")]
[JsonPropertyName("description_localizations")]
public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; } public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; }


[JsonProperty("name_localized")]
[JsonPropertyName("name_localized")]
public Optional<string> NameLocalized { get; set; } public Optional<string> NameLocalized { get; set; }


[JsonProperty("description_localized")]
[JsonPropertyName("description_localized")]
public Optional<string> DescriptionLocalized { get; set; } public Optional<string> DescriptionLocalized { get; set; }
// V2 Permissions // V2 Permissions
[JsonProperty("dm_permission")]
[JsonPropertyName("dm_permission")]
public Optional<bool?> DmPermission { get; set; } public Optional<bool?> DmPermission { get; set; }


[JsonProperty("default_member_permissions")]
[JsonPropertyName("default_member_permissions")]
public Optional<GuildPermission?> DefaultMemberPermission { get; set; } public Optional<GuildPermission?> DefaultMemberPermission { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommandInteractionData : IResolvable, IDiscordInteractionData internal class ApplicationCommandInteractionData : IResolvable, IDiscordInteractionData
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; } public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; }


[JsonProperty("resolved")]
[JsonPropertyName("resolved")]
public Optional<ApplicationCommandInteractionDataResolved> Resolved { get; set; } public Optional<ApplicationCommandInteractionDataResolved> Resolved { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; } public ApplicationCommandType Type { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommandInteractionDataOption internal class ApplicationCommandInteractionDataOption
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandOptionType Type { get; set; } public ApplicationCommandOptionType Type { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public Optional<object> Value { get; set; } public Optional<object> Value { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; } public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; }
} }
} }

+ 7
- 7
src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs View File

@@ -1,24 +1,24 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommandInteractionDataResolved internal class ApplicationCommandInteractionDataResolved
{ {
[JsonProperty("users")]
[JsonPropertyName("users")]
public Optional<Dictionary<string, User>> Users { get; set; } public Optional<Dictionary<string, User>> Users { get; set; }


[JsonProperty("members")]
[JsonPropertyName("members")]
public Optional<Dictionary<string, GuildMember>> Members { get; set; } public Optional<Dictionary<string, GuildMember>> Members { get; set; }


[JsonProperty("channels")]
[JsonPropertyName("channels")]
public Optional<Dictionary<string, Channel>> Channels { get; set; } public Optional<Dictionary<string, Channel>> Channels { get; set; }


[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<Dictionary<string, Role>> Roles { get; set; } public Optional<Dictionary<string, Role>> Roles { get; set; }
[JsonProperty("messages")]
[JsonPropertyName("messages")]
public Optional<Dictionary<string, Message>> Messages { get; set; } public Optional<Dictionary<string, Message>> Messages { get; set; }
[JsonProperty("attachments")]
[JsonPropertyName("attachments")]
public Optional<Dictionary<string, Attachment>> Attachments { get; set; } public Optional<Dictionary<string, Attachment>> Attachments { get; set; }
} }
} }

+ 18
- 18
src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;


@@ -6,55 +6,55 @@ namespace Discord.API
{ {
internal class ApplicationCommandOption internal class ApplicationCommandOption
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandOptionType Type { get; set; } public ApplicationCommandOptionType Type { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }


[JsonProperty("default")]
[JsonPropertyName("default")]
public Optional<bool> Default { get; set; } public Optional<bool> Default { get; set; }


[JsonProperty("required")]
[JsonPropertyName("required")]
public Optional<bool> Required { get; set; } public Optional<bool> Required { get; set; }


[JsonProperty("choices")]
[JsonPropertyName("choices")]
public Optional<ApplicationCommandOptionChoice[]> Choices { get; set; } public Optional<ApplicationCommandOptionChoice[]> Choices { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<ApplicationCommandOption[]> Options { get; set; } public Optional<ApplicationCommandOption[]> Options { get; set; }


[JsonProperty("autocomplete")]
[JsonPropertyName("autocomplete")]
public Optional<bool> Autocomplete { get; set; } public Optional<bool> Autocomplete { get; set; }


[JsonProperty("min_value")]
[JsonPropertyName("min_value")]
public Optional<double> MinValue { get; set; } public Optional<double> MinValue { get; set; }


[JsonProperty("max_value")]
[JsonPropertyName("max_value")]
public Optional<double> MaxValue { get; set; } public Optional<double> MaxValue { get; set; }


[JsonProperty("channel_types")]
[JsonPropertyName("channel_types")]
public Optional<ChannelType[]> ChannelTypes { get; set; } public Optional<ChannelType[]> ChannelTypes { get; set; }


[JsonProperty("name_localizations")]
[JsonPropertyName("name_localizations")]
public Optional<Dictionary<string, string>> NameLocalizations { get; set; } public Optional<Dictionary<string, string>> NameLocalizations { get; set; }


[JsonProperty("description_localizations")]
[JsonPropertyName("description_localizations")]
public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; } public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; }


[JsonProperty("name_localized")]
[JsonPropertyName("name_localized")]
public Optional<string> NameLocalized { get; set; } public Optional<string> NameLocalized { get; set; }


[JsonProperty("description_localized")]
[JsonPropertyName("description_localized")]
public Optional<string> DescriptionLocalized { get; set; } public Optional<string> DescriptionLocalized { get; set; }


[JsonProperty("min_length")]
[JsonPropertyName("min_length")]
public Optional<int> MinLength { get; set; } public Optional<int> MinLength { get; set; }


[JsonProperty("max_length")]
[JsonPropertyName("max_length")]
public Optional<int> MaxLength { get; set; } public Optional<int> MaxLength { get; set; }


public ApplicationCommandOption() { } public ApplicationCommandOption() { }


+ 5
- 5
src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs View File

@@ -1,20 +1,20 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommandOptionChoice internal class ApplicationCommandOptionChoice
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public object Value { get; set; } public object Value { get; set; }


[JsonProperty("name_localizations")]
[JsonPropertyName("name_localizations")]
public Optional<Dictionary<string, string>> NameLocalizations { get; set; } public Optional<Dictionary<string, string>> NameLocalizations { get; set; }


[JsonProperty("name_localized")]
[JsonPropertyName("name_localized")]
public Optional<string> NameLocalized { get; set; } public Optional<string> NameLocalized { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ApplicationCommandPermissions internal class ApplicationCommandPermissions
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandPermissionTarget Type { get; set; } public ApplicationCommandPermissionTarget Type { get; set; }


[JsonProperty("permission")]
[JsonPropertyName("permission")]
public bool Permission { get; set; } public bool Permission { get; set; }
} }
} }

+ 11
- 11
src/Discord.Net.Rest/API/Common/Attachment.cs View File

@@ -1,28 +1,28 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Attachment internal class Attachment
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("filename")]
[JsonPropertyName("filename")]
public string Filename { get; set; } public string Filename { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public Optional<string> Description { get; set; } public Optional<string> Description { get; set; }
[JsonProperty("content_type")]
[JsonPropertyName("content_type")]
public Optional<string> ContentType { get; set; } public Optional<string> ContentType { get; set; }
[JsonProperty("size")]
[JsonPropertyName("size")]
public int Size { get; set; } public int Size { get; set; }
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("proxy_url")]
[JsonPropertyName("proxy_url")]
public string ProxyUrl { get; set; } public string ProxyUrl { get; set; }
[JsonProperty("height")]
[JsonPropertyName("height")]
public Optional<int> Height { get; set; } public Optional<int> Height { get; set; }
[JsonProperty("width")]
[JsonPropertyName("width")]
public Optional<int> Width { get; set; } public Optional<int> Width { get; set; }
[JsonProperty("ephemeral")]
[JsonPropertyName("ephemeral")]
public Optional<bool> Ephemeral { get; set; } public Optional<bool> Ephemeral { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/AuditLog.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AuditLog internal class AuditLog
{ {
[JsonProperty("webhooks")]
[JsonPropertyName("webhooks")]
public Webhook[] Webhooks { get; set; } public Webhook[] Webhooks { get; set; }


[JsonProperty("threads")]
[JsonPropertyName("threads")]
public Channel[] Threads { get; set; } public Channel[] Threads { get; set; }


[JsonProperty("integrations")]
[JsonPropertyName("integrations")]
public Integration[] Integrations { get; set; } public Integration[] Integrations { get; set; }


[JsonProperty("users")]
[JsonPropertyName("users")]
public User[] Users { get; set; } public User[] Users { get; set; }


[JsonProperty("audit_log_entries")]
[JsonPropertyName("audit_log_entries")]
public AuditLogEntry[] Entries { get; set; } public AuditLogEntry[] Entries { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/AuditLogChange.cs View File

@@ -1,17 +1,17 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;


namespace Discord.API namespace Discord.API
{ {
internal class AuditLogChange internal class AuditLogChange
{ {
[JsonProperty("key")]
[JsonPropertyName("key")]
public string ChangedProperty { get; set; } public string ChangedProperty { get; set; }


[JsonProperty("new_value")]
[JsonPropertyName("new_value")]
public JToken NewValue { get; set; } public JToken NewValue { get; set; }


[JsonProperty("old_value")]
[JsonPropertyName("old_value")]
public JToken OldValue { get; set; } public JToken OldValue { get; set; }
} }
} }

+ 8
- 8
src/Discord.Net.Rest/API/Common/AuditLogEntry.cs View File

@@ -1,26 +1,26 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AuditLogEntry internal class AuditLogEntry
{ {
[JsonProperty("target_id")]
[JsonPropertyName("target_id")]
public ulong? TargetId { get; set; } public ulong? TargetId { get; set; }
[JsonProperty("user_id")]
[JsonPropertyName("user_id")]
public ulong? UserId { get; set; } public ulong? UserId { get; set; }


[JsonProperty("changes")]
[JsonPropertyName("changes")]
public AuditLogChange[] Changes { get; set; } public AuditLogChange[] Changes { get; set; }
[JsonProperty("options")]
[JsonPropertyName("options")]
public AuditLogOptions Options { get; set; } public AuditLogOptions Options { get; set; }


[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("action_type")]
[JsonPropertyName("action_type")]
public ActionType Action { get; set; } public ActionType Action { get; set; }


[JsonProperty("reason")]
[JsonPropertyName("reason")]
public string Reason { get; set; } public string Reason { get; set; }
} }
} }

+ 9
- 9
src/Discord.Net.Rest/API/Common/AuditLogOptions.cs View File

@@ -1,28 +1,28 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AuditLogOptions internal class AuditLogOptions
{ {
[JsonProperty("count")]
[JsonPropertyName("count")]
public int? Count { get; set; } public int? Count { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong? ChannelId { get; set; } public ulong? ChannelId { get; set; }
[JsonProperty("message_id")]
[JsonPropertyName("message_id")]
public ulong? MessageId { get; set; } public ulong? MessageId { get; set; }


//Prune //Prune
[JsonProperty("delete_member_days")]
[JsonPropertyName("delete_member_days")]
public int? PruneDeleteMemberDays { get; set; } public int? PruneDeleteMemberDays { get; set; }
[JsonProperty("members_removed")]
[JsonPropertyName("members_removed")]
public int? PruneMembersRemoved { get; set; } public int? PruneMembersRemoved { get; set; }


//Overwrite Update //Overwrite Update
[JsonProperty("role_name")]
[JsonPropertyName("role_name")]
public string OverwriteRoleName { get; set; } public string OverwriteRoleName { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public PermissionTarget OverwriteType { get; set; } public PermissionTarget OverwriteType { get; set; }
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong? OverwriteTargetId { get; set; } public ulong? OverwriteTargetId { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AutocompleteInteractionData : IDiscordInteractionData internal class AutocompleteInteractionData : IDiscordInteractionData
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; } public ApplicationCommandType Type { get; set; }


[JsonProperty("version")]
[JsonPropertyName("version")]
public ulong Version { get; set; } public ulong Version { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public AutocompleteInteractionDataOption[] Options { get; set; } public AutocompleteInteractionDataOption[] Options { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class AutocompleteInteractionDataOption internal class AutocompleteInteractionDataOption
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandOptionType Type { get; set; } public ApplicationCommandOptionType Type { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<AutocompleteInteractionDataOption[]> Options { get; set; } public Optional<AutocompleteInteractionDataOption[]> Options { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public Optional<object> Value { get; set; } public Optional<object> Value { get; set; }


[JsonProperty("focused")]
[JsonPropertyName("focused")]
public Optional<bool> Focused { get; set; } public Optional<bool> Focused { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/Ban.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Ban internal class Ban
{ {
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
[JsonProperty("reason")]
[JsonPropertyName("reason")]
public string Reason { get; set; } public string Reason { get; set; }
} }
} }

+ 8
- 8
src/Discord.Net.Rest/API/Common/ButtonComponent.cs View File

@@ -1,28 +1,28 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ButtonComponent : IMessageComponent internal class ButtonComponent : IMessageComponent
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ComponentType Type { get; set; } public ComponentType Type { get; set; }


[JsonProperty("style")]
[JsonPropertyName("style")]
public ButtonStyle Style { get; set; } public ButtonStyle Style { get; set; }


[JsonProperty("label")]
[JsonPropertyName("label")]
public Optional<string> Label { get; set; } public Optional<string> Label { get; set; }


[JsonProperty("emoji")]
[JsonPropertyName("emoji")]
public Optional<Emoji> Emote { get; set; } public Optional<Emoji> Emote { get; set; }


[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public Optional<string> CustomId { get; set; } public Optional<string> CustomId { get; set; }


[JsonProperty("url")]
[JsonPropertyName("url")]
public Optional<string> Url { get; set; } public Optional<string> Url { get; set; }


[JsonProperty("disabled")]
[JsonPropertyName("disabled")]
public Optional<bool> Disabled { get; set; } public Optional<bool> Disabled { get; set; }


public ButtonComponent() { } public ButtonComponent() { }


+ 26
- 26
src/Discord.Net.Rest/API/Common/Channel.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
@@ -6,72 +6,72 @@ namespace Discord.API
internal class Channel internal class Channel
{ {
//Shared //Shared
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public ChannelType Type { get; set; } public ChannelType Type { get; set; }
[JsonProperty("last_message_id")]
[JsonPropertyName("last_message_id")]
public ulong? LastMessageId { get; set; } public ulong? LastMessageId { get; set; }


//GuildChannel //GuildChannel
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public Optional<string> Name { get; set; } public Optional<string> Name { get; set; }
[JsonProperty("position")]
[JsonPropertyName("position")]
public Optional<int> Position { get; set; } public Optional<int> Position { get; set; }
[JsonProperty("permission_overwrites")]
[JsonPropertyName("permission_overwrites")]
public Optional<Overwrite[]> PermissionOverwrites { get; set; } public Optional<Overwrite[]> PermissionOverwrites { get; set; }
[JsonProperty("parent_id")]
[JsonPropertyName("parent_id")]
public ulong? CategoryId { get; set; } public ulong? CategoryId { get; set; }


//TextChannel //TextChannel
[JsonProperty("topic")]
[JsonPropertyName("topic")]
public Optional<string> Topic { get; set; } public Optional<string> Topic { get; set; }
[JsonProperty("last_pin_timestamp")]
[JsonPropertyName("last_pin_timestamp")]
public Optional<DateTimeOffset?> LastPinTimestamp { get; set; } public Optional<DateTimeOffset?> LastPinTimestamp { get; set; }
[JsonProperty("nsfw")]
[JsonPropertyName("nsfw")]
public Optional<bool> Nsfw { get; set; } public Optional<bool> Nsfw { get; set; }
[JsonProperty("rate_limit_per_user")]
[JsonPropertyName("rate_limit_per_user")]
public Optional<int> SlowMode { get; set; } public Optional<int> SlowMode { get; set; }


//VoiceChannel //VoiceChannel
[JsonProperty("bitrate")]
[JsonPropertyName("bitrate")]
public Optional<int> Bitrate { get; set; } public Optional<int> Bitrate { get; set; }
[JsonProperty("user_limit")]
[JsonPropertyName("user_limit")]
public Optional<int> UserLimit { get; set; } public Optional<int> UserLimit { get; set; }
[JsonProperty("rtc_region")]
[JsonPropertyName("rtc_region")]
public Optional<string> RTCRegion { get; set; } public Optional<string> RTCRegion { get; set; }


//PrivateChannel //PrivateChannel
[JsonProperty("recipients")]
[JsonPropertyName("recipients")]
public Optional<User[]> Recipients { get; set; } public Optional<User[]> Recipients { get; set; }


//GroupChannel //GroupChannel
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public Optional<string> Icon { get; set; } public Optional<string> Icon { get; set; }


//ThreadChannel //ThreadChannel
[JsonProperty("member")]
[JsonPropertyName("member")]
public Optional<ThreadMember> ThreadMember { get; set; } public Optional<ThreadMember> ThreadMember { get; set; }


[JsonProperty("thread_metadata")]
[JsonPropertyName("thread_metadata")]
public Optional<ThreadMetadata> ThreadMetadata { get; set; } public Optional<ThreadMetadata> ThreadMetadata { get; set; }


[JsonProperty("owner_id")]
[JsonPropertyName("owner_id")]
public Optional<ulong> OwnerId { get; set; } public Optional<ulong> OwnerId { get; set; }


[JsonProperty("message_count")]
[JsonPropertyName("message_count")]
public Optional<int> MessageCount { get; set; } public Optional<int> MessageCount { get; set; }


[JsonProperty("member_count")]
[JsonPropertyName("member_count")]
public Optional<int> MemberCount { get; set; } public Optional<int> MemberCount { get; set; }


//ForumChannel //ForumChannel
[JsonProperty("available_tags")]
[JsonPropertyName("available_tags")]
public Optional<ForumTags[]> ForumTags { get; set; } public Optional<ForumTags[]> ForumTags { get; set; }
[JsonProperty("default_auto_archive_duration")]
[JsonPropertyName("default_auto_archive_duration")]
public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/ChannelThreads.cs View File

@@ -1,13 +1,13 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
internal class ChannelThreads internal class ChannelThreads
{ {
[JsonProperty("threads")]
[JsonPropertyName("threads")]
public Channel[] Threads { get; set; } public Channel[] Threads { get; set; }


[JsonProperty("members")]
[JsonPropertyName("members")]
public ThreadMember[] Members { get; set; } public ThreadMember[] Members { get; set; }
} }
} }

+ 10
- 10
src/Discord.Net.Rest/API/Common/Connection.cs View File

@@ -1,27 +1,27 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord.API namespace Discord.API
{ {
internal class Connection internal class Connection
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; } public string Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public string Type { get; set; } public string Type { get; set; }
[JsonProperty("revoked")]
[JsonPropertyName("revoked")]
public Optional<bool> Revoked { get; set; } public Optional<bool> Revoked { get; set; }
[JsonProperty("integrations")]
[JsonPropertyName("integrations")]
public Optional<IReadOnlyCollection<Integration>> Integrations { get; set; } public Optional<IReadOnlyCollection<Integration>> Integrations { get; set; }
[JsonProperty("verified")]
[JsonPropertyName("verified")]
public bool Verified { get; set; } public bool Verified { get; set; }
[JsonProperty("friend_sync")]
[JsonPropertyName("friend_sync")]
public bool FriendSync { get; set; } public bool FriendSync { get; set; }
[JsonProperty("show_activity")]
[JsonPropertyName("show_activity")]
public bool ShowActivity { get; set; } public bool ShowActivity { get; set; }
[JsonProperty("visibility")]
[JsonPropertyName("visibility")]
public ConnectionVisibility Visibility { get; set; } public ConnectionVisibility Visibility { get; set; }


} }


+ 4
- 4
src/Discord.Net.Rest/API/Common/DiscordError.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -10,11 +10,11 @@ namespace Discord.API
[JsonConverter(typeof(Discord.Net.Converters.DiscordErrorConverter))] [JsonConverter(typeof(Discord.Net.Converters.DiscordErrorConverter))]
internal class DiscordError internal class DiscordError
{ {
[JsonProperty("message")]
[JsonPropertyName("message")]
public string Message { get; set; } public string Message { get; set; }
[JsonProperty("code")]
[JsonPropertyName("code")]
public DiscordErrorCode Code { get; set; } public DiscordErrorCode Code { get; set; }
[JsonProperty("errors")]
[JsonPropertyName("errors")]
public Optional<ErrorDetails[]> Errors { get; set; } public Optional<ErrorDetails[]> Errors { get; set; }
} }
} }

+ 14
- 14
src/Discord.Net.Rest/API/Common/Embed.cs View File

@@ -1,36 +1,36 @@
using System; using System;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Discord.Net.Converters; using Discord.Net.Converters;


namespace Discord.API namespace Discord.API
{ {
internal class Embed internal class Embed
{ {
[JsonProperty("title")]
[JsonPropertyName("title")]
public string Title { get; set; } public string Title { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("color")]
[JsonPropertyName("color")]
public uint? Color { get; set; } public uint? Color { get; set; }
[JsonProperty("type"), JsonConverter(typeof(EmbedTypeConverter))]
[JsonPropertyName("type"), JsonConverter(typeof(EmbedTypeConverter))]
public EmbedType Type { get; set; } public EmbedType Type { get; set; }
[JsonProperty("timestamp")]
[JsonPropertyName("timestamp")]
public DateTimeOffset? Timestamp { get; set; } public DateTimeOffset? Timestamp { get; set; }
[JsonProperty("author")]
[JsonPropertyName("author")]
public Optional<EmbedAuthor> Author { get; set; } public Optional<EmbedAuthor> Author { get; set; }
[JsonProperty("footer")]
[JsonPropertyName("footer")]
public Optional<EmbedFooter> Footer { get; set; } public Optional<EmbedFooter> Footer { get; set; }
[JsonProperty("video")]
[JsonPropertyName("video")]
public Optional<EmbedVideo> Video { get; set; } public Optional<EmbedVideo> Video { get; set; }
[JsonProperty("thumbnail")]
[JsonPropertyName("thumbnail")]
public Optional<EmbedThumbnail> Thumbnail { get; set; } public Optional<EmbedThumbnail> Thumbnail { get; set; }
[JsonProperty("image")]
[JsonPropertyName("image")]
public Optional<EmbedImage> Image { get; set; } public Optional<EmbedImage> Image { get; set; }
[JsonProperty("provider")]
[JsonPropertyName("provider")]
public Optional<EmbedProvider> Provider { get; set; } public Optional<EmbedProvider> Provider { get; set; }
[JsonProperty("fields")]
[JsonPropertyName("fields")]
public Optional<EmbedField[]> Fields { get; set; } public Optional<EmbedField[]> Fields { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/EmbedAuthor.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedAuthor internal class EmbedAuthor
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("icon_url")]
[JsonPropertyName("icon_url")]
public string IconUrl { get; set; } public string IconUrl { get; set; }
[JsonProperty("proxy_icon_url")]
[JsonPropertyName("proxy_icon_url")]
public string ProxyIconUrl { get; set; } public string ProxyIconUrl { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/EmbedField.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedField internal class EmbedField
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("value")]
[JsonPropertyName("value")]
public string Value { get; set; } public string Value { get; set; }
[JsonProperty("inline")]
[JsonPropertyName("inline")]
public bool Inline { get; set; } public bool Inline { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/EmbedFooter.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedFooter internal class EmbedFooter
{ {
[JsonProperty("text")]
[JsonPropertyName("text")]
public string Text { get; set; } public string Text { get; set; }
[JsonProperty("icon_url")]
[JsonPropertyName("icon_url")]
public string IconUrl { get; set; } public string IconUrl { get; set; }
[JsonProperty("proxy_icon_url")]
[JsonPropertyName("proxy_icon_url")]
public string ProxyIconUrl { get; set; } public string ProxyIconUrl { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/EmbedImage.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedImage internal class EmbedImage
{ {
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("proxy_url")]
[JsonPropertyName("proxy_url")]
public string ProxyUrl { get; set; } public string ProxyUrl { get; set; }
[JsonProperty("height")]
[JsonPropertyName("height")]
public Optional<int> Height { get; set; } public Optional<int> Height { get; set; }
[JsonProperty("width")]
[JsonPropertyName("width")]
public Optional<int> Width { get; set; } public Optional<int> Width { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/EmbedProvider.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedProvider internal class EmbedProvider
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedThumbnail internal class EmbedThumbnail
{ {
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("proxy_url")]
[JsonPropertyName("proxy_url")]
public string ProxyUrl { get; set; } public string ProxyUrl { get; set; }
[JsonProperty("height")]
[JsonPropertyName("height")]
public Optional<int> Height { get; set; } public Optional<int> Height { get; set; }
[JsonProperty("width")]
[JsonPropertyName("width")]
public Optional<int> Width { get; set; } public Optional<int> Width { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/EmbedVideo.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class EmbedVideo internal class EmbedVideo
{ {
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonProperty("height")]
[JsonPropertyName("height")]
public Optional<int> Height { get; set; } public Optional<int> Height { get; set; }
[JsonProperty("width")]
[JsonPropertyName("width")]
public Optional<int> Width { get; set; } public Optional<int> Width { get; set; }
} }
} }

+ 8
- 8
src/Discord.Net.Rest/API/Common/Emoji.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Emoji internal class Emoji
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong? Id { get; set; } public ulong? Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("animated")]
[JsonPropertyName("animated")]
public bool? Animated { get; set; } public bool? Animated { get; set; }
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public ulong[] Roles { get; set; } public ulong[] Roles { get; set; }
[JsonProperty("require_colons")]
[JsonPropertyName("require_colons")]
public bool RequireColons { get; set; } public bool RequireColons { get; set; }
[JsonProperty("managed")]
[JsonPropertyName("managed")]
public bool Managed { get; set; } public bool Managed { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public Optional<User> User { get; set; } public Optional<User> User { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/Error.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Error internal class Error
{ {
[JsonProperty("code")]
[JsonPropertyName("code")]
public string Code { get; set; } public string Code { get; set; }
[JsonProperty("message")]
[JsonPropertyName("message")]
public string Message { get; set; } public string Message { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/ForumTags.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,13 +9,13 @@ namespace Discord.API
{ {
internal class ForumTags internal class ForumTags
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("emoji_id")]
[JsonPropertyName("emoji_id")]
public Optional<ulong?> EmojiId { get; set; } public Optional<ulong?> EmojiId { get; set; }
[JsonProperty("emoji_name")]
[JsonPropertyName("emoji_name")]
public Optional<string> EmojiName { get; set; } public Optional<string> EmojiName { get; set; }
} }
} }

+ 8
- 8
src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,25 +9,25 @@ namespace Discord.API
{ {
internal class ForumThreadMessage internal class ForumThreadMessage
{ {
[JsonProperty("content")]
[JsonPropertyName("content")]
public Optional<string> Content { get; set; } public Optional<string> Content { get; set; }


[JsonProperty("nonce")]
[JsonPropertyName("nonce")]
public Optional<string> Nonce { get; set; } public Optional<string> Nonce { get; set; }


[JsonProperty("embeds")]
[JsonPropertyName("embeds")]
public Optional<Embed[]> Embeds { get; set; } public Optional<Embed[]> Embeds { get; set; }


[JsonProperty("allowed_mentions")]
[JsonPropertyName("allowed_mentions")]
public Optional<AllowedMentions> AllowedMentions { get; set; } public Optional<AllowedMentions> AllowedMentions { get; set; }


[JsonProperty("components")]
[JsonPropertyName("components")]
public Optional<API.ActionRowComponent[]> Components { get; set; } public Optional<API.ActionRowComponent[]> Components { get; set; }


[JsonProperty("sticker_ids")]
[JsonPropertyName("sticker_ids")]
public Optional<ulong[]> Stickers { get; set; } public Optional<ulong[]> Stickers { get; set; }


[JsonProperty("flags")]
[JsonPropertyName("flags")]
public Optional<MessageFlags> Flags { get; set; } public Optional<MessageFlags> Flags { get; set; }
} }
} }

+ 19
- 19
src/Discord.Net.Rest/API/Common/Game.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System.Runtime.Serialization; using System.Runtime.Serialization;


@@ -6,41 +6,41 @@ namespace Discord.API
{ {
internal class Game internal class Game
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("url")]
[JsonPropertyName("url")]
public Optional<string> StreamUrl { get; set; } public Optional<string> StreamUrl { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public Optional<ActivityType?> Type { get; set; } public Optional<ActivityType?> Type { get; set; }
[JsonProperty("details")]
[JsonPropertyName("details")]
public Optional<string> Details { get; set; } public Optional<string> Details { get; set; }
[JsonProperty("state")]
[JsonPropertyName("state")]
public Optional<string> State { get; set; } public Optional<string> State { get; set; }
[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public Optional<ulong> ApplicationId { get; set; } public Optional<ulong> ApplicationId { get; set; }
[JsonProperty("assets")]
[JsonPropertyName("assets")]
public Optional<API.GameAssets> Assets { get; set; } public Optional<API.GameAssets> Assets { get; set; }
[JsonProperty("party")]
[JsonPropertyName("party")]
public Optional<API.GameParty> Party { get; set; } public Optional<API.GameParty> Party { get; set; }
[JsonProperty("secrets")]
[JsonPropertyName("secrets")]
public Optional<API.GameSecrets> Secrets { get; set; } public Optional<API.GameSecrets> Secrets { get; set; }
[JsonProperty("timestamps")]
[JsonPropertyName("timestamps")]
public Optional<API.GameTimestamps> Timestamps { get; set; } public Optional<API.GameTimestamps> Timestamps { get; set; }
[JsonProperty("instance")]
[JsonPropertyName("instance")]
public Optional<bool> Instance { get; set; } public Optional<bool> Instance { get; set; }
[JsonProperty("sync_id")]
[JsonPropertyName("sync_id")]
public Optional<string> SyncId { get; set; } public Optional<string> SyncId { get; set; }
[JsonProperty("session_id")]
[JsonPropertyName("session_id")]
public Optional<string> SessionId { get; set; } public Optional<string> SessionId { get; set; }
[JsonProperty("Flags")]
[JsonPropertyName("Flags")]
public Optional<ActivityProperties> Flags { get; set; } public Optional<ActivityProperties> Flags { get; set; }
[JsonProperty("id")]
[JsonPropertyName("id")]
public Optional<string> Id { get; set; } public Optional<string> Id { get; set; }
[JsonProperty("emoji")]
[JsonPropertyName("emoji")]
public Optional<Emoji> Emoji { get; set; } public Optional<Emoji> Emoji { get; set; }
[JsonProperty("created_at")]
[JsonPropertyName("created_at")]
public Optional<long> CreatedAt { get; set; } public Optional<long> CreatedAt { get; set; }
//[JsonProperty("buttons")]
//[JsonPropertyName("buttons")]
//public Optional<RichPresenceButton[]> Buttons { get; set; } //public Optional<RichPresenceButton[]> Buttons { get; set; }


[OnError] [OnError]


+ 5
- 5
src/Discord.Net.Rest/API/Common/GameAssets.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GameAssets internal class GameAssets
{ {
[JsonProperty("small_text")]
[JsonPropertyName("small_text")]
public Optional<string> SmallText { get; set; } public Optional<string> SmallText { get; set; }
[JsonProperty("small_image")]
[JsonPropertyName("small_image")]
public Optional<string> SmallImage { get; set; } public Optional<string> SmallImage { get; set; }
[JsonProperty("large_text")]
[JsonPropertyName("large_text")]
public Optional<string> LargeText { get; set; } public Optional<string> LargeText { get; set; }
[JsonProperty("large_image")]
[JsonPropertyName("large_image")]
public Optional<string> LargeImage { get; set; } public Optional<string> LargeImage { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/GameParty.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GameParty internal class GameParty
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; } public string Id { get; set; }
[JsonProperty("size")]
[JsonPropertyName("size")]
public long[] Size { get; set; } public long[] Size { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/GameSecrets.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GameSecrets internal class GameSecrets
{ {
[JsonProperty("match")]
[JsonPropertyName("match")]
public string Match { get; set; } public string Match { get; set; }
[JsonProperty("join")]
[JsonPropertyName("join")]
public string Join { get; set; } public string Join { get; set; }
[JsonProperty("spectate")]
[JsonPropertyName("spectate")]
public string Spectate { get; set; } public string Spectate { get; set; }
} }
}
}

+ 4
- 4
src/Discord.Net.Rest/API/Common/GameTimestamps.cs View File

@@ -1,15 +1,15 @@
using System; using System;
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GameTimestamps internal class GameTimestamps
{ {
[JsonProperty("start")]
[JsonPropertyName("start")]
[UnixTimestamp] [UnixTimestamp]
public Optional<DateTimeOffset> Start { get; set; } public Optional<DateTimeOffset> Start { get; set; }
[JsonProperty("end")]
[JsonPropertyName("end")]
[UnixTimestamp] [UnixTimestamp]
public Optional<DateTimeOffset> End { get; set; } public Optional<DateTimeOffset> End { get; set; }
} }
}
}

+ 40
- 40
src/Discord.Net.Rest/API/Common/Guild.cs View File

@@ -1,87 +1,87 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Guild internal class Guild
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public string Icon { get; set; } public string Icon { get; set; }
[JsonProperty("splash")]
[JsonPropertyName("splash")]
public string Splash { get; set; } public string Splash { get; set; }
[JsonProperty("discovery_splash")]
[JsonPropertyName("discovery_splash")]
public string DiscoverySplash { get; set; } public string DiscoverySplash { get; set; }
[JsonProperty("owner_id")]
[JsonPropertyName("owner_id")]
public ulong OwnerId { get; set; } public ulong OwnerId { get; set; }
[JsonProperty("region")]
[JsonPropertyName("region")]
public string Region { get; set; } public string Region { get; set; }
[JsonProperty("afk_channel_id")]
[JsonPropertyName("afk_channel_id")]
public ulong? AFKChannelId { get; set; } public ulong? AFKChannelId { get; set; }
[JsonProperty("afk_timeout")]
[JsonPropertyName("afk_timeout")]
public int AFKTimeout { get; set; } public int AFKTimeout { get; set; }
[JsonProperty("verification_level")]
[JsonPropertyName("verification_level")]
public VerificationLevel VerificationLevel { get; set; } public VerificationLevel VerificationLevel { get; set; }
[JsonProperty("default_message_notifications")]
[JsonPropertyName("default_message_notifications")]
public DefaultMessageNotifications DefaultMessageNotifications { get; set; } public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
[JsonProperty("explicit_content_filter")]
[JsonPropertyName("explicit_content_filter")]
public ExplicitContentFilterLevel ExplicitContentFilter { get; set; } public ExplicitContentFilterLevel ExplicitContentFilter { get; set; }
[JsonProperty("voice_states")]
[JsonPropertyName("voice_states")]
public VoiceState[] VoiceStates { get; set; } public VoiceState[] VoiceStates { get; set; }
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Role[] Roles { get; set; } public Role[] Roles { get; set; }
[JsonProperty("emojis")]
[JsonPropertyName("emojis")]
public Emoji[] Emojis { get; set; } public Emoji[] Emojis { get; set; }
[JsonProperty("features")]
[JsonPropertyName("features")]
public GuildFeatures Features { get; set; } public GuildFeatures Features { get; set; }
[JsonProperty("mfa_level")]
[JsonPropertyName("mfa_level")]
public MfaLevel MfaLevel { get; set; } public MfaLevel MfaLevel { get; set; }
[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public ulong? ApplicationId { get; set; } public ulong? ApplicationId { get; set; }
[JsonProperty("widget_enabled")]
[JsonPropertyName("widget_enabled")]
public Optional<bool> WidgetEnabled { get; set; } public Optional<bool> WidgetEnabled { get; set; }
[JsonProperty("widget_channel_id")]
[JsonPropertyName("widget_channel_id")]
public Optional<ulong?> WidgetChannelId { get; set; } public Optional<ulong?> WidgetChannelId { get; set; }
[JsonProperty("system_channel_id")]
[JsonPropertyName("system_channel_id")]
public ulong? SystemChannelId { get; set; } public ulong? SystemChannelId { get; set; }
[JsonProperty("premium_tier")]
[JsonPropertyName("premium_tier")]
public PremiumTier PremiumTier { get; set; } public PremiumTier PremiumTier { get; set; }
[JsonProperty("vanity_url_code")]
[JsonPropertyName("vanity_url_code")]
public string VanityURLCode { get; set; } public string VanityURLCode { get; set; }
[JsonProperty("banner")]
[JsonPropertyName("banner")]
public string Banner { get; set; } public string Banner { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
// this value is inverted, flags set will turn OFF features // this value is inverted, flags set will turn OFF features
[JsonProperty("system_channel_flags")]
[JsonPropertyName("system_channel_flags")]
public SystemChannelMessageDeny SystemChannelFlags { get; set; } public SystemChannelMessageDeny SystemChannelFlags { get; set; }
[JsonProperty("rules_channel_id")]
[JsonPropertyName("rules_channel_id")]
public ulong? RulesChannelId { get; set; } public ulong? RulesChannelId { get; set; }
[JsonProperty("max_presences")]
[JsonPropertyName("max_presences")]
public Optional<int?> MaxPresences { get; set; } public Optional<int?> MaxPresences { get; set; }
[JsonProperty("max_members")]
[JsonPropertyName("max_members")]
public Optional<int> MaxMembers { get; set; } public Optional<int> MaxMembers { get; set; }
[JsonProperty("premium_subscription_count")]
[JsonPropertyName("premium_subscription_count")]
public int? PremiumSubscriptionCount { get; set; } public int? PremiumSubscriptionCount { get; set; }
[JsonProperty("preferred_locale")]
[JsonPropertyName("preferred_locale")]
public string PreferredLocale { get; set; } public string PreferredLocale { get; set; }
[JsonProperty("public_updates_channel_id")]
[JsonPropertyName("public_updates_channel_id")]
public ulong? PublicUpdatesChannelId { get; set; } public ulong? PublicUpdatesChannelId { get; set; }
[JsonProperty("max_video_channel_users")]
[JsonPropertyName("max_video_channel_users")]
public Optional<int> MaxVideoChannelUsers { get; set; } public Optional<int> MaxVideoChannelUsers { get; set; }
[JsonProperty("approximate_member_count")]
[JsonPropertyName("approximate_member_count")]
public Optional<int> ApproximateMemberCount { get; set; } public Optional<int> ApproximateMemberCount { get; set; }
[JsonProperty("approximate_presence_count")]
[JsonPropertyName("approximate_presence_count")]
public Optional<int> ApproximatePresenceCount { get; set; } public Optional<int> ApproximatePresenceCount { get; set; }
[JsonProperty("threads")]
[JsonPropertyName("threads")]
public Optional<Channel[]> Threads { get; set; } public Optional<Channel[]> Threads { get; set; }
[JsonProperty("nsfw_level")]
[JsonPropertyName("nsfw_level")]
public NsfwLevel NsfwLevel { get; set; } public NsfwLevel NsfwLevel { get; set; }
[JsonProperty("stickers")]
[JsonPropertyName("stickers")]
public Sticker[] Stickers { get; set; } public Sticker[] Stickers { get; set; }
[JsonProperty("premium_progress_bar_enabled")]
[JsonPropertyName("premium_progress_bar_enabled")]
public Optional<bool> IsBoostProgressBarEnabled { get; set; } public Optional<bool> IsBoostProgressBarEnabled { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GuildApplicationCommandPermission internal class GuildApplicationCommandPermission
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public ulong ApplicationId { get; set; } public ulong ApplicationId { get; set; }


[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public ulong GuildId { get; set; } public ulong GuildId { get; set; }


[JsonProperty("permissions")]
[JsonPropertyName("permissions")]
public ApplicationCommandPermissions[] Permissions { get; set; } public ApplicationCommandPermissions[] Permissions { get; set; }
} }
} }

+ 11
- 11
src/Discord.Net.Rest/API/Common/GuildMember.cs View File

@@ -1,29 +1,29 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class GuildMember internal class GuildMember
{ {
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
[JsonProperty("nick")]
[JsonPropertyName("nick")]
public Optional<string> Nick { get; set; } public Optional<string> Nick { get; set; }
[JsonProperty("avatar")]
[JsonPropertyName("avatar")]
public Optional<string> Avatar { get; set; } public Optional<string> Avatar { get; set; }
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<ulong[]> Roles { get; set; } public Optional<ulong[]> Roles { get; set; }
[JsonProperty("joined_at")]
[JsonPropertyName("joined_at")]
public Optional<DateTimeOffset> JoinedAt { get; set; } public Optional<DateTimeOffset> JoinedAt { get; set; }
[JsonProperty("deaf")]
[JsonPropertyName("deaf")]
public Optional<bool> Deaf { get; set; } public Optional<bool> Deaf { get; set; }
[JsonProperty("mute")]
[JsonPropertyName("mute")]
public Optional<bool> Mute { get; set; } public Optional<bool> Mute { get; set; }
[JsonProperty("pending")]
[JsonPropertyName("pending")]
public Optional<bool> Pending { get; set; } public Optional<bool> Pending { get; set; }
[JsonProperty("premium_since")]
[JsonPropertyName("premium_since")]
public Optional<DateTimeOffset?> PremiumSince { get; set; } public Optional<DateTimeOffset?> PremiumSince { get; set; }
[JsonProperty("communication_disabled_until")]
[JsonPropertyName("communication_disabled_until")]
public Optional<DateTimeOffset?> TimedOutUntil { get; set; } public Optional<DateTimeOffset?> TimedOutUntil { get; set; }
} }
} }

+ 17
- 17
src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,37 +9,37 @@ namespace Discord.API
{ {
internal class GuildScheduledEvent internal class GuildScheduledEvent
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public ulong GuildId { get; set; } public ulong GuildId { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public Optional<ulong?> ChannelId { get; set; } public Optional<ulong?> ChannelId { get; set; }
[JsonProperty("creator_id")]
[JsonPropertyName("creator_id")]
public Optional<ulong> CreatorId { get; set; } public Optional<ulong> CreatorId { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public Optional<string> Description { get; set; } public Optional<string> Description { get; set; }
[JsonProperty("scheduled_start_time")]
[JsonPropertyName("scheduled_start_time")]
public DateTimeOffset ScheduledStartTime { get; set; } public DateTimeOffset ScheduledStartTime { get; set; }
[JsonProperty("scheduled_end_time")]
[JsonPropertyName("scheduled_end_time")]
public DateTimeOffset? ScheduledEndTime { get; set; } public DateTimeOffset? ScheduledEndTime { get; set; }
[JsonProperty("privacy_level")]
[JsonPropertyName("privacy_level")]
public GuildScheduledEventPrivacyLevel PrivacyLevel { get; set; } public GuildScheduledEventPrivacyLevel PrivacyLevel { get; set; }
[JsonProperty("status")]
[JsonPropertyName("status")]
public GuildScheduledEventStatus Status { get; set; } public GuildScheduledEventStatus Status { get; set; }
[JsonProperty("entity_type")]
[JsonPropertyName("entity_type")]
public GuildScheduledEventType EntityType { get; set; } public GuildScheduledEventType EntityType { get; set; }
[JsonProperty("entity_id")]
[JsonPropertyName("entity_id")]
public ulong? EntityId { get; set; } public ulong? EntityId { get; set; }
[JsonProperty("entity_metadata")]
[JsonPropertyName("entity_metadata")]
public GuildScheduledEventEntityMetadata EntityMetadata { get; set; } public GuildScheduledEventEntityMetadata EntityMetadata { get; set; }
[JsonProperty("creator")]
[JsonPropertyName("creator")]
public Optional<User> Creator { get; set; } public Optional<User> Creator { get; set; }
[JsonProperty("user_count")]
[JsonPropertyName("user_count")]
public Optional<int> UserCount { get; set; } public Optional<int> UserCount { get; set; }
[JsonProperty("image")]
[JsonPropertyName("image")]
public string Image { get; set; } public string Image { get; set; }
} }
} }

+ 2
- 2
src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,7 +9,7 @@ namespace Discord.API
{ {
internal class GuildScheduledEventEntityMetadata internal class GuildScheduledEventEntityMetadata
{ {
[JsonProperty("location")]
[JsonPropertyName("location")]
public Optional<string> Location { get; set; } public Optional<string> Location { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,11 +9,11 @@ namespace Discord.API
{ {
internal class GuildScheduledEventUser internal class GuildScheduledEventUser
{ {
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
[JsonProperty("member")]
[JsonPropertyName("member")]
public Optional<GuildMember> Member { get; set; } public Optional<GuildMember> Member { get; set; }
[JsonProperty("guild_scheduled_event_id")]
[JsonPropertyName("guild_scheduled_event_id")]
public ulong GuildScheduledEventId { get; set; } public ulong GuildScheduledEventId { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/GuildWidget.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class GuildWidget internal class GuildWidget
{ {
[JsonProperty("enabled")]
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } public bool Enabled { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong? ChannelId { get; set; } public ulong? ChannelId { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/InstallParams.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,9 +9,9 @@ namespace Discord.API
{ {
internal class InstallParams internal class InstallParams
{ {
[JsonProperty("scopes")]
[JsonPropertyName("scopes")]
public string[] Scopes { get; set; } public string[] Scopes { get; set; }
[JsonProperty("permissions")]
[JsonPropertyName("permissions")]
public ulong Permission { get; set; } public ulong Permission { get; set; }
} }
} }

+ 17
- 17
src/Discord.Net.Rest/API/Common/Integration.cs View File

@@ -1,42 +1,42 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class Integration internal class Integration
{ {
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }


[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public string Type { get; set; } public string Type { get; set; }
[JsonProperty("enabled")]
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } public bool Enabled { get; set; }
[JsonProperty("syncing")]
[JsonPropertyName("syncing")]
public Optional<bool?> Syncing { get; set; } public Optional<bool?> Syncing { get; set; }
[JsonProperty("role_id")]
[JsonPropertyName("role_id")]
public Optional<ulong?> RoleId { get; set; } public Optional<ulong?> RoleId { get; set; }
[JsonProperty("enable_emoticons")]
[JsonPropertyName("enable_emoticons")]
public Optional<bool?> EnableEmoticons { get; set; } public Optional<bool?> EnableEmoticons { get; set; }
[JsonProperty("expire_behavior")]
[JsonPropertyName("expire_behavior")]
public Optional<IntegrationExpireBehavior> ExpireBehavior { get; set; } public Optional<IntegrationExpireBehavior> ExpireBehavior { get; set; }
[JsonProperty("expire_grace_period")]
[JsonPropertyName("expire_grace_period")]
public Optional<int?> ExpireGracePeriod { get; set; } public Optional<int?> ExpireGracePeriod { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public Optional<User> User { get; set; } public Optional<User> User { get; set; }
[JsonProperty("account")]
[JsonPropertyName("account")]
public Optional<IntegrationAccount> Account { get; set; } public Optional<IntegrationAccount> Account { get; set; }
[JsonProperty("synced_at")]
[JsonPropertyName("synced_at")]
public Optional<DateTimeOffset> SyncedAt { get; set; } public Optional<DateTimeOffset> SyncedAt { get; set; }
[JsonProperty("subscriber_count")]
[JsonPropertyName("subscriber_count")]
public Optional<int?> SubscriberAccount { get; set; } public Optional<int?> SubscriberAccount { get; set; }
[JsonProperty("revoked")]
[JsonPropertyName("revoked")]
public Optional<bool?> Revoked { get; set; } public Optional<bool?> Revoked { get; set; }
[JsonProperty("application")]
[JsonPropertyName("application")]
public Optional<IntegrationApplication> Application { get; set; } public Optional<IntegrationApplication> Application { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/IntegrationAccount.cs View File

@@ -1,12 +1,12 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class IntegrationAccount internal class IntegrationAccount
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; } public string Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
} }
} }

+ 7
- 7
src/Discord.Net.Rest/API/Common/IntegrationApplication.cs View File

@@ -1,20 +1,20 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class IntegrationApplication internal class IntegrationApplication
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public Optional<string> Icon { get; set; } public Optional<string> Icon { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
[JsonProperty("summary")]
[JsonPropertyName("summary")]
public string Summary { get; set; } public string Summary { get; set; }
[JsonProperty("bot")]
[JsonPropertyName("bot")]
public Optional<User> Bot { get; set; } public Optional<User> Bot { get; set; }
} }
} }

+ 14
- 14
src/Discord.Net.Rest/API/Common/Interaction.cs View File

@@ -1,47 +1,47 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
[JsonConverter(typeof(Net.Converters.InteractionConverter))] [JsonConverter(typeof(Net.Converters.InteractionConverter))]
internal class Interaction internal class Interaction
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public ulong ApplicationId { get; set; } public ulong ApplicationId { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public InteractionType Type { get; set; } public InteractionType Type { get; set; }


[JsonProperty("data")]
[JsonPropertyName("data")]
public Optional<IDiscordInteractionData> Data { get; set; } public Optional<IDiscordInteractionData> Data { get; set; }


[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }


[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public Optional<ulong> ChannelId { get; set; } public Optional<ulong> ChannelId { get; set; }


[JsonProperty("member")]
[JsonPropertyName("member")]
public Optional<GuildMember> Member { get; set; } public Optional<GuildMember> Member { get; set; }


[JsonProperty("user")]
[JsonPropertyName("user")]
public Optional<User> User { get; set; } public Optional<User> User { get; set; }


[JsonProperty("token")]
[JsonPropertyName("token")]
public string Token { get; set; } public string Token { get; set; }


[JsonProperty("version")]
[JsonPropertyName("version")]
public int Version { get; set; } public int Version { get; set; }


[JsonProperty("message")]
[JsonPropertyName("message")]
public Optional<Message> Message { get; set; } public Optional<Message> Message { get; set; }


[JsonProperty("locale")]
[JsonPropertyName("locale")]
public Optional<string> UserLocale { get; set; } public Optional<string> UserLocale { get; set; }


[JsonProperty("guild_locale")]
[JsonPropertyName("guild_locale")]
public Optional<string> GuildLocale { get; set; } public Optional<string> GuildLocale { get; set; }
} }
} }

+ 10
- 10
src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs View File

@@ -1,34 +1,34 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class InteractionCallbackData internal class InteractionCallbackData
{ {
[JsonProperty("tts")]
[JsonPropertyName("tts")]
public Optional<bool> TTS { get; set; } public Optional<bool> TTS { get; set; }


[JsonProperty("content")]
[JsonPropertyName("content")]
public Optional<string> Content { get; set; } public Optional<string> Content { get; set; }


[JsonProperty("embeds")]
[JsonPropertyName("embeds")]
public Optional<Embed[]> Embeds { get; set; } public Optional<Embed[]> Embeds { get; set; }


[JsonProperty("allowed_mentions")]
[JsonPropertyName("allowed_mentions")]
public Optional<AllowedMentions> AllowedMentions { get; set; } public Optional<AllowedMentions> AllowedMentions { get; set; }


[JsonProperty("flags")]
[JsonPropertyName("flags")]
public Optional<MessageFlags> Flags { get; set; } public Optional<MessageFlags> Flags { get; set; }


[JsonProperty("components")]
[JsonPropertyName("components")]
public Optional<ActionRowComponent[]> Components { get; set; } public Optional<ActionRowComponent[]> Components { get; set; }


[JsonProperty("choices")]
[JsonPropertyName("choices")]
public Optional<ApplicationCommandOptionChoice[]> Choices { get; set; } public Optional<ApplicationCommandOptionChoice[]> Choices { get; set; }


[JsonProperty("title")]
[JsonPropertyName("title")]
public Optional<string> Title { get; set; } public Optional<string> Title { get; set; }


[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public Optional<string> CustomId { get; set; } public Optional<string> CustomId { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/InteractionResponse.cs View File

@@ -1,13 +1,13 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class InteractionResponse internal class InteractionResponse
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public InteractionResponseType Type { get; set; } public InteractionResponseType Type { get; set; }


[JsonProperty("data")]
[JsonPropertyName("data")]
public Optional<InteractionCallbackData> Data { get; set; } public Optional<InteractionCallbackData> Data { get; set; }
} }
} }

+ 9
- 9
src/Discord.Net.Rest/API/Common/Invite.cs View File

@@ -1,24 +1,24 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Invite internal class Invite
{ {
[JsonProperty("code")]
[JsonPropertyName("code")]
public string Code { get; set; } public string Code { get; set; }
[JsonProperty("guild")]
[JsonPropertyName("guild")]
public Optional<InviteGuild> Guild { get; set; } public Optional<InviteGuild> Guild { get; set; }
[JsonProperty("channel")]
[JsonPropertyName("channel")]
public InviteChannel Channel { get; set; } public InviteChannel Channel { get; set; }
[JsonProperty("inviter")]
[JsonPropertyName("inviter")]
public Optional<User> Inviter { get; set; } public Optional<User> Inviter { get; set; }
[JsonProperty("approximate_presence_count")]
[JsonPropertyName("approximate_presence_count")]
public Optional<int?> PresenceCount { get; set; } public Optional<int?> PresenceCount { get; set; }
[JsonProperty("approximate_member_count")]
[JsonPropertyName("approximate_member_count")]
public Optional<int?> MemberCount { get; set; } public Optional<int?> MemberCount { get; set; }
[JsonProperty("target_user")]
[JsonPropertyName("target_user")]
public Optional<User> TargetUser { get; set; } public Optional<User> TargetUser { get; set; }
[JsonProperty("target_user_type")]
[JsonPropertyName("target_user_type")]
public Optional<TargetUserType> TargetUserType { get; set; } public Optional<TargetUserType> TargetUserType { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/InviteChannel.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class InviteChannel internal class InviteChannel
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public int Type { get; set; } public int Type { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/InviteGuild.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class InviteGuild internal class InviteGuild
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("splash_hash")]
[JsonPropertyName("splash_hash")]
public string SplashHash { get; set; } public string SplashHash { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/InviteMetadata.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class InviteMetadata : Invite internal class InviteMetadata : Invite
{ {
[JsonProperty("uses")]
[JsonPropertyName("uses")]
public int Uses { get; set; } public int Uses { get; set; }
[JsonProperty("max_uses")]
[JsonPropertyName("max_uses")]
public int MaxUses { get; set; } public int MaxUses { get; set; }
[JsonProperty("max_age")]
[JsonPropertyName("max_age")]
public int MaxAge { get; set; } public int MaxAge { get; set; }
[JsonProperty("temporary")]
[JsonPropertyName("temporary")]
public bool Temporary { get; set; } public bool Temporary { get; set; }
[JsonProperty("created_at")]
[JsonPropertyName("created_at")]
public DateTimeOffset CreatedAt { get; set; } public DateTimeOffset CreatedAt { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/InviteVanity.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
@@ -10,13 +10,13 @@ namespace Discord.API
/// <summary> /// <summary>
/// The unique code for the invite link. /// The unique code for the invite link.
/// </summary> /// </summary>
[JsonProperty("code")]
[JsonPropertyName("code")]
public string Code { get; set; } public string Code { get; set; }


/// <summary> /// <summary>
/// The total amount of vanity invite uses. /// The total amount of vanity invite uses.
/// </summary> /// </summary>
[JsonProperty("uses")]
[JsonPropertyName("uses")]
public int Uses { get; set; } public int Uses { get; set; }
} }
} }

+ 27
- 27
src/Discord.Net.Rest/API/Common/Message.cs View File

@@ -1,66 +1,66 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class Message internal class Message
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public MessageType Type { get; set; } public MessageType Type { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong ChannelId { get; set; } public ulong ChannelId { get; set; }
// ALWAYS sent on WebSocket messages // ALWAYS sent on WebSocket messages
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }
[JsonProperty("webhook_id")]
[JsonPropertyName("webhook_id")]
public Optional<ulong> WebhookId { get; set; } public Optional<ulong> WebhookId { get; set; }
[JsonProperty("author")]
[JsonPropertyName("author")]
public Optional<User> Author { get; set; } public Optional<User> Author { get; set; }
// ALWAYS sent on WebSocket messages // ALWAYS sent on WebSocket messages
[JsonProperty("member")]
[JsonPropertyName("member")]
public Optional<GuildMember> Member { get; set; } public Optional<GuildMember> Member { get; set; }
[JsonProperty("content")]
[JsonPropertyName("content")]
public Optional<string> Content { get; set; } public Optional<string> Content { get; set; }
[JsonProperty("timestamp")]
[JsonPropertyName("timestamp")]
public Optional<DateTimeOffset> Timestamp { get; set; } public Optional<DateTimeOffset> Timestamp { get; set; }
[JsonProperty("edited_timestamp")]
[JsonPropertyName("edited_timestamp")]
public Optional<DateTimeOffset?> EditedTimestamp { get; set; } public Optional<DateTimeOffset?> EditedTimestamp { get; set; }
[JsonProperty("tts")]
[JsonPropertyName("tts")]
public Optional<bool> IsTextToSpeech { get; set; } public Optional<bool> IsTextToSpeech { get; set; }
[JsonProperty("mention_everyone")]
[JsonPropertyName("mention_everyone")]
public Optional<bool> MentionEveryone { get; set; } public Optional<bool> MentionEveryone { get; set; }
[JsonProperty("mentions")]
[JsonPropertyName("mentions")]
public Optional<User[]> UserMentions { get; set; } public Optional<User[]> UserMentions { get; set; }
[JsonProperty("mention_roles")]
[JsonPropertyName("mention_roles")]
public Optional<ulong[]> RoleMentions { get; set; } public Optional<ulong[]> RoleMentions { get; set; }
[JsonProperty("attachments")]
[JsonPropertyName("attachments")]
public Optional<Attachment[]> Attachments { get; set; } public Optional<Attachment[]> Attachments { get; set; }
[JsonProperty("embeds")]
[JsonPropertyName("embeds")]
public Optional<Embed[]> Embeds { get; set; } public Optional<Embed[]> Embeds { get; set; }
[JsonProperty("pinned")]
[JsonPropertyName("pinned")]
public Optional<bool> Pinned { get; set; } public Optional<bool> Pinned { get; set; }
[JsonProperty("reactions")]
[JsonPropertyName("reactions")]
public Optional<Reaction[]> Reactions { get; set; } public Optional<Reaction[]> Reactions { get; set; }
// sent with Rich Presence-related chat embeds // sent with Rich Presence-related chat embeds
[JsonProperty("activity")]
[JsonPropertyName("activity")]
public Optional<MessageActivity> Activity { get; set; } public Optional<MessageActivity> Activity { get; set; }
// sent with Rich Presence-related chat embeds // sent with Rich Presence-related chat embeds
[JsonProperty("application")]
[JsonPropertyName("application")]
public Optional<MessageApplication> Application { get; set; } public Optional<MessageApplication> Application { get; set; }
[JsonProperty("message_reference")]
[JsonPropertyName("message_reference")]
public Optional<MessageReference> Reference { get; set; } public Optional<MessageReference> Reference { get; set; }
[JsonProperty("flags")]
[JsonPropertyName("flags")]
public Optional<MessageFlags> Flags { get; set; } public Optional<MessageFlags> Flags { get; set; }
[JsonProperty("allowed_mentions")]
[JsonPropertyName("allowed_mentions")]
public Optional<AllowedMentions> AllowedMentions { get; set; } public Optional<AllowedMentions> AllowedMentions { get; set; }
[JsonProperty("referenced_message")]
[JsonPropertyName("referenced_message")]
public Optional<Message> ReferencedMessage { get; set; } public Optional<Message> ReferencedMessage { get; set; }
[JsonProperty("components")]
[JsonPropertyName("components")]
public Optional<API.ActionRowComponent[]> Components { get; set; } public Optional<API.ActionRowComponent[]> Components { get; set; }
public Optional<MessageInteraction> Interaction { get; set; } public Optional<MessageInteraction> Interaction { get; set; }
[JsonProperty("sticker_items")]
[JsonPropertyName("sticker_items")]
public Optional<StickerItem[]> StickerItems { get; set; } public Optional<StickerItem[]> StickerItems { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/MessageActivity.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,9 +9,9 @@ namespace Discord.API
{ {
public class MessageActivity public class MessageActivity
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public Optional<MessageActivityType> Type { get; set; } public Optional<MessageActivityType> Type { get; set; }
[JsonProperty("party_id")]
[JsonPropertyName("party_id")]
public Optional<string> PartyId { get; set; } public Optional<string> PartyId { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/MessageApplication.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -12,27 +12,27 @@ namespace Discord.API
/// <summary> /// <summary>
/// Gets the snowflake ID of the application. /// Gets the snowflake ID of the application.
/// </summary> /// </summary>
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
/// <summary> /// <summary>
/// Gets the ID of the embed's image asset. /// Gets the ID of the embed's image asset.
/// </summary> /// </summary>
[JsonProperty("cover_image")]
[JsonPropertyName("cover_image")]
public string CoverImage { get; set; } public string CoverImage { get; set; }
/// <summary> /// <summary>
/// Gets the application's description. /// Gets the application's description.
/// </summary> /// </summary>
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
/// <summary> /// <summary>
/// Gets the ID of the application's icon. /// Gets the ID of the application's icon.
/// </summary> /// </summary>
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public string Icon { get; set; } public string Icon { get; set; }
/// <summary> /// <summary>
/// Gets the name of the application. /// Gets the name of the application.
/// </summary> /// </summary>
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class MessageComponentInteractionData : IDiscordInteractionData internal class MessageComponentInteractionData : IDiscordInteractionData
{ {
[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public string CustomId { get; set; } public string CustomId { get; set; }


[JsonProperty("component_type")]
[JsonPropertyName("component_type")]
public ComponentType ComponentType { get; set; } public ComponentType ComponentType { get; set; }


[JsonProperty("values")]
[JsonPropertyName("values")]
public Optional<string[]> Values { get; set; } public Optional<string[]> Values { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public Optional<string> Value { get; set; } public Optional<string> Value { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/MessageInteraction.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,13 +9,13 @@ namespace Discord.API
{ {
internal class MessageInteraction internal class MessageInteraction
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public InteractionType Type { get; set; } public InteractionType Type { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/MessageReference.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class MessageReference internal class MessageReference
{ {
[JsonProperty("message_id")]
[JsonPropertyName("message_id")]
public Optional<ulong> MessageId { get; set; } public Optional<ulong> MessageId { get; set; }


[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public Optional<ulong> ChannelId { get; set; } // Optional when sending, always present when receiving public Optional<ulong> ChannelId { get; set; } // Optional when sending, always present when receiving


[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }


[JsonProperty("fail_if_not_exists")]
[JsonPropertyName("fail_if_not_exists")]
public Optional<bool> FailIfNotExists { get; set; } public Optional<bool> FailIfNotExists { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/ModalInteractionData.cs View File

@@ -1,13 +1,13 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ModalInteractionData : IDiscordInteractionData internal class ModalInteractionData : IDiscordInteractionData
{ {
[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public string CustomId { get; set; } public string CustomId { get; set; }


[JsonProperty("components")]
[JsonPropertyName("components")]
public API.ActionRowComponent[] Components { get; set; } public API.ActionRowComponent[] Components { get; set; }
} }
} }

+ 2
- 2
src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs View File

@@ -1,11 +1,11 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord.API namespace Discord.API
{ {
internal class NitroStickerPacks internal class NitroStickerPacks
{ {
[JsonProperty("sticker_packs")]
[JsonPropertyName("sticker_packs")]
public List<StickerPack> StickerPacks { get; set; } public List<StickerPack> StickerPacks { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/Overwrite.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Overwrite internal class Overwrite
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong TargetId { get; set; } public ulong TargetId { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public PermissionTarget TargetType { get; set; } public PermissionTarget TargetType { get; set; }
[JsonProperty("deny"), Int53]
[JsonPropertyName("deny"), Int53]
public string Deny { get; set; } public string Deny { get; set; }
[JsonProperty("allow"), Int53]
[JsonPropertyName("allow"), Int53]
public string Allow { get; set; } public string Allow { get; set; }
} }
} }

+ 9
- 9
src/Discord.Net.Rest/API/Common/Presence.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;


@@ -6,27 +6,27 @@ namespace Discord.API
{ {
internal class Presence internal class Presence
{ {
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }
[JsonProperty("status")]
[JsonPropertyName("status")]
public UserStatus Status { get; set; } public UserStatus Status { get; set; }


[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<ulong[]> Roles { get; set; } public Optional<ulong[]> Roles { get; set; }
[JsonProperty("nick")]
[JsonPropertyName("nick")]
public Optional<string> Nick { get; set; } public Optional<string> Nick { get; set; }
// This property is a Dictionary where each key is the ClientType // This property is a Dictionary where each key is the ClientType
// and the values are the current client status. // and the values are the current client status.
// The client status values are all the same. // The client status values are all the same.
// Example: // Example:
// "client_status": { "desktop": "dnd", "mobile": "dnd" } // "client_status": { "desktop": "dnd", "mobile": "dnd" }
[JsonProperty("client_status")]
[JsonPropertyName("client_status")]
public Optional<Dictionary<string, string>> ClientStatus { get; set; } public Optional<Dictionary<string, string>> ClientStatus { get; set; }
[JsonProperty("activities")]
[JsonPropertyName("activities")]
public List<Game> Activities { get; set; } public List<Game> Activities { get; set; }
[JsonProperty("premium_since")]
[JsonPropertyName("premium_since")]
public Optional<DateTimeOffset?> PremiumSince { get; set; } public Optional<DateTimeOffset?> PremiumSince { get; set; }
} }
} }

+ 3
- 3
src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,9 +9,9 @@ namespace Discord.API
{ {
internal class ErrorDetails internal class ErrorDetails
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public Optional<string> Name { get; set; } public Optional<string> Name { get; set; }
[JsonProperty("errors")]
[JsonPropertyName("errors")]
public Error[] Errors { get; set; } public Error[] Errors { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/Ratelimit.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,13 +9,13 @@ namespace Discord.API
{ {
internal class Ratelimit internal class Ratelimit
{ {
[JsonProperty("global")]
[JsonPropertyName("global")]
public bool Global { get; set; } public bool Global { get; set; }


[JsonProperty("message")]
[JsonPropertyName("message")]
public string Message { get; set; } public string Message { get; set; }


[JsonProperty("retry_after")]
[JsonPropertyName("retry_after")]
public double RetryAfter { get; set; } public double RetryAfter { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/Reaction.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Reaction internal class Reaction
{ {
[JsonProperty("count")]
[JsonPropertyName("count")]
public int Count { get; set; } public int Count { get; set; }
[JsonProperty("me")]
[JsonPropertyName("me")]
public bool Me { get; set; } public bool Me { get; set; }
[JsonProperty("emoji")]
[JsonPropertyName("emoji")]
public Emoji Emoji { get; set; } public Emoji Emoji { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/ReadState.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class ReadState internal class ReadState
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("mention_count")]
[JsonPropertyName("mention_count")]
public int MentionCount { get; set; } public int MentionCount { get; set; }
[JsonProperty("last_message_id")]
[JsonPropertyName("last_message_id")]
public Optional<ulong> LastMessageId { get; set; } public Optional<ulong> LastMessageId { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/Relationship.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Relationship internal class Relationship
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public RelationshipType Type { get; set; } public RelationshipType Type { get; set; }
} }
} }

+ 12
- 12
src/Discord.Net.Rest/API/Common/Role.cs View File

@@ -1,30 +1,30 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Role internal class Role
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public Optional<string> Icon { get; set; } public Optional<string> Icon { get; set; }
[JsonProperty("unicode_emoji")]
[JsonPropertyName("unicode_emoji")]
public Optional<string> Emoji { get; set; } public Optional<string> Emoji { get; set; }
[JsonProperty("color")]
[JsonPropertyName("color")]
public uint Color { get; set; } public uint Color { get; set; }
[JsonProperty("hoist")]
[JsonPropertyName("hoist")]
public bool Hoist { get; set; } public bool Hoist { get; set; }
[JsonProperty("mentionable")]
[JsonPropertyName("mentionable")]
public bool Mentionable { get; set; } public bool Mentionable { get; set; }
[JsonProperty("position")]
[JsonPropertyName("position")]
public int Position { get; set; } public int Position { get; set; }
[JsonProperty("permissions"), Int53]
[JsonPropertyName("permissions"), Int53]
public string Permissions { get; set; } public string Permissions { get; set; }
[JsonProperty("managed")]
[JsonPropertyName("managed")]
public bool Managed { get; set; } public bool Managed { get; set; }
[JsonProperty("tags")]
[JsonPropertyName("tags")]
public Optional<RoleTags> Tags { get; set; } public Optional<RoleTags> Tags { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/RoleTags.cs View File

@@ -1,14 +1,14 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class RoleTags internal class RoleTags
{ {
[JsonProperty("bot_id")]
[JsonPropertyName("bot_id")]
public Optional<ulong> BotId { get; set; } public Optional<ulong> BotId { get; set; }
[JsonProperty("integration_id")]
[JsonPropertyName("integration_id")]
public Optional<ulong> IntegrationId { get; set; } public Optional<ulong> IntegrationId { get; set; }
[JsonProperty("premium_subscriber")]
[JsonPropertyName("premium_subscriber")]
public Optional<bool?> IsPremiumSubscriber { get; set; } public Optional<bool?> IsPremiumSubscriber { get; set; }
} }
} }

+ 9
- 9
src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs View File

@@ -1,32 +1,32 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Linq; using System.Linq;


namespace Discord.API namespace Discord.API
{ {
internal class SelectMenuComponent : IMessageComponent internal class SelectMenuComponent : IMessageComponent
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ComponentType Type { get; set; } public ComponentType Type { get; set; }


[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public string CustomId { get; set; } public string CustomId { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public SelectMenuOption[] Options { get; set; } public SelectMenuOption[] Options { get; set; }


[JsonProperty("placeholder")]
[JsonPropertyName("placeholder")]
public Optional<string> Placeholder { get; set; } public Optional<string> Placeholder { get; set; }


[JsonProperty("min_values")]
[JsonPropertyName("min_values")]
public int MinValues { get; set; } public int MinValues { get; set; }


[JsonProperty("max_values")]
[JsonPropertyName("max_values")]
public int MaxValues { get; set; } public int MaxValues { get; set; }


[JsonProperty("disabled")]
[JsonPropertyName("disabled")]
public bool Disabled { get; set; } public bool Disabled { get; set; }


[JsonProperty("values")]
[JsonPropertyName("values")]
public Optional<string[]> Values { get; set; } public Optional<string[]> Values { get; set; }
public SelectMenuComponent() { } public SelectMenuComponent() { }




+ 6
- 6
src/Discord.Net.Rest/API/Common/SelectMenuOption.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class SelectMenuOption internal class SelectMenuOption
{ {
[JsonProperty("label")]
[JsonPropertyName("label")]
public string Label { get; set; } public string Label { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public string Value { get; set; } public string Value { get; set; }


[JsonProperty("description")]
[JsonPropertyName("description")]
public Optional<string> Description { get; set; } public Optional<string> Description { get; set; }


[JsonProperty("emoji")]
[JsonPropertyName("emoji")]
public Optional<Emoji> Emoji { get; set; } public Optional<Emoji> Emoji { get; set; }


[JsonProperty("default")]
[JsonPropertyName("default")]
public Optional<bool> Default { get; set; } public Optional<bool> Default { get; set; }


public SelectMenuOption() { } public SelectMenuOption() { }


+ 5
- 5
src/Discord.Net.Rest/API/Common/SessionStartLimit.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
internal class SessionStartLimit internal class SessionStartLimit
{ {
[JsonProperty("total")]
[JsonPropertyName("total")]
public int Total { get; set; } public int Total { get; set; }
[JsonProperty("remaining")]
[JsonPropertyName("remaining")]
public int Remaining { get; set; } public int Remaining { get; set; }
[JsonProperty("reset_after")]
[JsonPropertyName("reset_after")]
public int ResetAfter { get; set; } public int ResetAfter { get; set; }
[JsonProperty("max_concurrency")]
[JsonPropertyName("max_concurrency")]
public int MaxConcurrency { get; set; } public int MaxConcurrency { get; set; }
} }
} }

+ 7
- 7
src/Discord.Net.Rest/API/Common/StageInstance.cs View File

@@ -1,25 +1,25 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class StageInstance internal class StageInstance
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public ulong GuildId { get; set; } public ulong GuildId { get; set; }


[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong ChannelId { get; set; } public ulong ChannelId { get; set; }


[JsonProperty("topic")]
[JsonPropertyName("topic")]
public string Topic { get; set; } public string Topic { get; set; }


[JsonProperty("privacy_level")]
[JsonPropertyName("privacy_level")]
public StagePrivacyLevel PrivacyLevel { get; set; } public StagePrivacyLevel PrivacyLevel { get; set; }


[JsonProperty("discoverable_disabled")]
[JsonPropertyName("discoverable_disabled")]
public bool DiscoverableDisabled { get; set; } public bool DiscoverableDisabled { get; set; }
} }
} }

+ 12
- 12
src/Discord.Net.Rest/API/Common/Sticker.cs View File

@@ -1,30 +1,30 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Sticker internal class Sticker
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("pack_id")]
[JsonPropertyName("pack_id")]
public ulong PackId { get; set; } public ulong PackId { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
[JsonProperty("tags")]
[JsonPropertyName("tags")]
public Optional<string> Tags { get; set; } public Optional<string> Tags { get; set; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public StickerType Type { get; set; } public StickerType Type { get; set; }
[JsonProperty("format_type")]
[JsonPropertyName("format_type")]
public StickerFormatType FormatType { get; set; } public StickerFormatType FormatType { get; set; }
[JsonProperty("available")]
[JsonPropertyName("available")]
public bool? Available { get; set; } public bool? Available { get; set; }
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public Optional<User> User { get; set; } public Optional<User> User { get; set; }
[JsonProperty("sort_value")]
[JsonPropertyName("sort_value")]
public int? SortValue { get; set; } public int? SortValue { get; set; }
} }
} }

+ 4
- 4
src/Discord.Net.Rest/API/Common/StickerItem.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class StickerItem internal class StickerItem
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("format_type")]
[JsonPropertyName("format_type")]
public StickerFormatType FormatType { get; set; } public StickerFormatType FormatType { get; set; }
} }
} }

+ 8
- 8
src/Discord.Net.Rest/API/Common/StickerPack.cs View File

@@ -1,22 +1,22 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class StickerPack internal class StickerPack
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("stickers")]
[JsonPropertyName("stickers")]
public Sticker[] Stickers { get; set; } public Sticker[] Stickers { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("sku_id")]
[JsonPropertyName("sku_id")]
public ulong SkuId { get; set; } public ulong SkuId { get; set; }
[JsonProperty("cover_sticker_id")]
[JsonPropertyName("cover_sticker_id")]
public Optional<ulong> CoverStickerId { get; set; } public Optional<ulong> CoverStickerId { get; set; }
[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }
[JsonProperty("banner_asset_id")]
[JsonPropertyName("banner_asset_id")]
public ulong BannerAssetId { get; set; } public ulong BannerAssetId { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/Team.cs View File

@@ -1,18 +1,18 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Team internal class Team
{ {
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public Optional<string> Icon { get; set; } public Optional<string> Icon { get; set; }
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("members")]
[JsonPropertyName("members")]
public TeamMember[] TeamMembers { get; set; } public TeamMember[] TeamMembers { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("owner_user_id")]
[JsonPropertyName("owner_user_id")]
public ulong OwnerUserId { get; set; } public ulong OwnerUserId { get; set; }
} }
} }

+ 5
- 5
src/Discord.Net.Rest/API/Common/TeamMember.cs View File

@@ -1,16 +1,16 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class TeamMember internal class TeamMember
{ {
[JsonProperty("membership_state")]
[JsonPropertyName("membership_state")]
public MembershipState MembershipState { get; set; } public MembershipState MembershipState { get; set; }
[JsonProperty("permissions")]
[JsonPropertyName("permissions")]
public string[] Permissions { get; set; } public string[] Permissions { get; set; }
[JsonProperty("team_id")]
[JsonPropertyName("team_id")]
public ulong TeamId { get; set; } public ulong TeamId { get; set; }
[JsonProperty("user")]
[JsonPropertyName("user")]
public User User { get; set; } public User User { get; set; }
} }
} }

+ 10
- 10
src/Discord.Net.Rest/API/Common/TextInputComponent.cs View File

@@ -1,34 +1,34 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class TextInputComponent : IMessageComponent internal class TextInputComponent : IMessageComponent
{ {
[JsonProperty("type")]
[JsonPropertyName("type")]
public ComponentType Type { get; set; } public ComponentType Type { get; set; }


[JsonProperty("style")]
[JsonPropertyName("style")]
public TextInputStyle Style { get; set; } public TextInputStyle Style { get; set; }


[JsonProperty("custom_id")]
[JsonPropertyName("custom_id")]
public string CustomId { get; set; } public string CustomId { get; set; }


[JsonProperty("label")]
[JsonPropertyName("label")]
public string Label { get; set; } public string Label { get; set; }


[JsonProperty("placeholder")]
[JsonPropertyName("placeholder")]
public Optional<string> Placeholder { get; set; } public Optional<string> Placeholder { get; set; }


[JsonProperty("min_length")]
[JsonPropertyName("min_length")]
public Optional<int> MinLength { get; set; } public Optional<int> MinLength { get; set; }


[JsonProperty("max_length")]
[JsonPropertyName("max_length")]
public Optional<int> MaxLength { get; set; } public Optional<int> MaxLength { get; set; }


[JsonProperty("value")]
[JsonPropertyName("value")]
public Optional<string> Value { get; set; } public Optional<string> Value { get; set; }


[JsonProperty("required")]
[JsonPropertyName("required")]
public Optional<bool> Required { get; set; } public Optional<bool> Required { get; set; }


public TextInputComponent() { } public TextInputComponent() { }


+ 5
- 5
src/Discord.Net.Rest/API/Common/ThreadMember.cs View File

@@ -1,20 +1,20 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class ThreadMember internal class ThreadMember
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public Optional<ulong> Id { get; set; } public Optional<ulong> Id { get; set; }


[JsonProperty("user_id")]
[JsonPropertyName("user_id")]
public Optional<ulong> UserId { get; set; } public Optional<ulong> UserId { get; set; }


[JsonProperty("join_timestamp")]
[JsonPropertyName("join_timestamp")]
public DateTimeOffset JoinTimestamp { get; set; } public DateTimeOffset JoinTimestamp { get; set; }


[JsonProperty("flags")]
[JsonPropertyName("flags")]
public int Flags { get; set; } // No enum type (yet?) public int Flags { get; set; } // No enum type (yet?)
} }
} }

+ 7
- 7
src/Discord.Net.Rest/API/Common/ThreadMetadata.cs View File

@@ -1,26 +1,26 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class ThreadMetadata internal class ThreadMetadata
{ {
[JsonProperty("archived")]
[JsonPropertyName("archived")]
public bool Archived { get; set; } public bool Archived { get; set; }


[JsonProperty("auto_archive_duration")]
[JsonPropertyName("auto_archive_duration")]
public ThreadArchiveDuration AutoArchiveDuration { get; set; } public ThreadArchiveDuration AutoArchiveDuration { get; set; }


[JsonProperty("archive_timestamp")]
[JsonPropertyName("archive_timestamp")]
public DateTimeOffset ArchiveTimestamp { get; set; } public DateTimeOffset ArchiveTimestamp { get; set; }


[JsonProperty("locked")]
[JsonPropertyName("locked")]
public Optional<bool> Locked { get; set; } public Optional<bool> Locked { get; set; }


[JsonProperty("invitable")]
[JsonPropertyName("invitable")]
public Optional<bool> Invitable { get; set; } public Optional<bool> Invitable { get; set; }


[JsonProperty("create_timestamp")]
[JsonPropertyName("create_timestamp")]
public Optional<DateTimeOffset?> CreatedAt { get; set; } public Optional<DateTimeOffset?> CreatedAt { get; set; }
} }
} }

+ 15
- 15
src/Discord.Net.Rest/API/Common/User.cs View File

@@ -1,38 +1,38 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class User internal class User
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("username")]
[JsonPropertyName("username")]
public Optional<string> Username { get; set; } public Optional<string> Username { get; set; }
[JsonProperty("discriminator")]
[JsonPropertyName("discriminator")]
public Optional<string> Discriminator { get; set; } public Optional<string> Discriminator { get; set; }
[JsonProperty("bot")]
[JsonPropertyName("bot")]
public Optional<bool> Bot { get; set; } public Optional<bool> Bot { get; set; }
[JsonProperty("avatar")]
[JsonPropertyName("avatar")]
public Optional<string> Avatar { get; set; } public Optional<string> Avatar { get; set; }
[JsonProperty("banner")]
[JsonPropertyName("banner")]
public Optional<string> Banner { get; set; } public Optional<string> Banner { get; set; }
[JsonProperty("accent_color")]
[JsonPropertyName("accent_color")]
public Optional<uint?> AccentColor { get; set; } public Optional<uint?> AccentColor { get; set; }


//CurrentUser //CurrentUser
[JsonProperty("verified")]
[JsonPropertyName("verified")]
public Optional<bool> Verified { get; set; } public Optional<bool> Verified { get; set; }
[JsonProperty("email")]
[JsonPropertyName("email")]
public Optional<string> Email { get; set; } public Optional<string> Email { get; set; }
[JsonProperty("mfa_enabled")]
[JsonPropertyName("mfa_enabled")]
public Optional<bool> MfaEnabled { get; set; } public Optional<bool> MfaEnabled { get; set; }
[JsonProperty("flags")]
[JsonPropertyName("flags")]
public Optional<UserProperties> Flags { get; set; } public Optional<UserProperties> Flags { get; set; }
[JsonProperty("premium_type")]
[JsonPropertyName("premium_type")]
public Optional<PremiumType> PremiumType { get; set; } public Optional<PremiumType> PremiumType { get; set; }
[JsonProperty("locale")]
[JsonPropertyName("locale")]
public Optional<string> Locale { get; set; } public Optional<string> Locale { get; set; }
[JsonProperty("public_flags")]
[JsonPropertyName("public_flags")]
public Optional<UserProperties> PublicFlags { get; set; } public Optional<UserProperties> PublicFlags { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Common/UserGuild.cs View File

@@ -1,18 +1,18 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class UserGuild internal class UserGuild
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("icon")]
[JsonPropertyName("icon")]
public string Icon { get; set; } public string Icon { get; set; }
[JsonProperty("owner")]
[JsonPropertyName("owner")]
public bool Owner { get; set; } public bool Owner { get; set; }
[JsonProperty("permissions"), Int53]
[JsonPropertyName("permissions"), Int53]
public string Permissions { get; set; } public string Permissions { get; set; }
} }
} }

+ 7
- 7
src/Discord.Net.Rest/API/Common/VoiceRegion.cs View File

@@ -1,20 +1,20 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class VoiceRegion internal class VoiceRegion
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; } public string Id { get; set; }
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("vip")]
[JsonPropertyName("vip")]
public bool IsVip { get; set; } public bool IsVip { get; set; }
[JsonProperty("optimal")]
[JsonPropertyName("optimal")]
public bool IsOptimal { get; set; } public bool IsOptimal { get; set; }
[JsonProperty("deprecated")]
[JsonPropertyName("deprecated")]
public bool IsDeprecated { get; set; } public bool IsDeprecated { get; set; }
[JsonProperty("custom")]
[JsonPropertyName("custom")]
public bool IsCustom { get; set; } public bool IsCustom { get; set; }
} }
} }

+ 14
- 14
src/Discord.Net.Rest/API/Common/VoiceState.cs View File

@@ -1,36 +1,36 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System; using System;


namespace Discord.API namespace Discord.API
{ {
internal class VoiceState internal class VoiceState
{ {
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public ulong? GuildId { get; set; } public ulong? GuildId { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong? ChannelId { get; set; } public ulong? ChannelId { get; set; }
[JsonProperty("user_id")]
[JsonPropertyName("user_id")]
public ulong UserId { get; set; } public ulong UserId { get; set; }
// ALWAYS sent over WebSocket, never on REST // ALWAYS sent over WebSocket, never on REST
[JsonProperty("member")]
[JsonPropertyName("member")]
public Optional<GuildMember> Member { get; set; } public Optional<GuildMember> Member { get; set; }
[JsonProperty("session_id")]
[JsonPropertyName("session_id")]
public string SessionId { get; set; } public string SessionId { get; set; }
[JsonProperty("deaf")]
[JsonPropertyName("deaf")]
public bool Deaf { get; set; } public bool Deaf { get; set; }
[JsonProperty("mute")]
[JsonPropertyName("mute")]
public bool Mute { get; set; } public bool Mute { get; set; }
[JsonProperty("self_deaf")]
[JsonPropertyName("self_deaf")]
public bool SelfDeaf { get; set; } public bool SelfDeaf { get; set; }
[JsonProperty("self_mute")]
[JsonPropertyName("self_mute")]
public bool SelfMute { get; set; } public bool SelfMute { get; set; }
[JsonProperty("suppress")]
[JsonPropertyName("suppress")]
public bool Suppress { get; set; } public bool Suppress { get; set; }
[JsonProperty("self_stream")]
[JsonPropertyName("self_stream")]
public bool SelfStream { get; set; } public bool SelfStream { get; set; }
[JsonProperty("self_video")]
[JsonPropertyName("self_video")]
public bool SelfVideo { get; set; } public bool SelfVideo { get; set; }
[JsonProperty("request_to_speak_timestamp")]
[JsonPropertyName("request_to_speak_timestamp")]
public Optional<DateTimeOffset?> RequestToSpeakTimestamp { get; set; } public Optional<DateTimeOffset?> RequestToSpeakTimestamp { get; set; }
} }
} }

+ 9
- 9
src/Discord.Net.Rest/API/Common/Webhook.cs View File

@@ -1,26 +1,26 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API namespace Discord.API
{ {
internal class Webhook internal class Webhook
{ {
[JsonProperty("id")]
[JsonPropertyName("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("channel_id")]
[JsonPropertyName("channel_id")]
public ulong ChannelId { get; set; } public ulong ChannelId { get; set; }
[JsonProperty("token")]
[JsonPropertyName("token")]
public string Token { get; set; } public string Token { get; set; }


[JsonProperty("name")]
[JsonPropertyName("name")]
public Optional<string> Name { get; set; } public Optional<string> Name { get; set; }
[JsonProperty("avatar")]
[JsonPropertyName("avatar")]
public Optional<string> Avatar { get; set; } public Optional<string> Avatar { get; set; }
[JsonProperty("guild_id")]
[JsonPropertyName("guild_id")]
public Optional<ulong> GuildId { get; set; } public Optional<ulong> GuildId { get; set; }


[JsonProperty("user")]
[JsonPropertyName("user")]
public Optional<User> Creator { get; set; } public Optional<User> Creator { get; set; }
[JsonProperty("application_id")]
[JsonPropertyName("application_id")]
public ulong? ApplicationId { get; set; } public ulong? ApplicationId { get; set; }
} }
} }

+ 6
- 6
src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs View File

@@ -1,19 +1,19 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
internal class AddGuildMemberParams internal class AddGuildMemberParams
{ {
[JsonProperty("access_token")]
[JsonPropertyName("access_token")]
public string AccessToken { get; set; } public string AccessToken { get; set; }
[JsonProperty("nick")]
[JsonPropertyName("nick")]
public Optional<string> Nickname { get; set; } public Optional<string> Nickname { get; set; }
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<ulong[]> RoleIds { get; set; } public Optional<ulong[]> RoleIds { get; set; }
[JsonProperty("mute")]
[JsonPropertyName("mute")]
public Optional<bool> IsMuted { get; set; } public Optional<bool> IsMuted { get; set; }
[JsonProperty("deaf")]
[JsonPropertyName("deaf")]
public Optional<bool> IsDeafened { get; set; } public Optional<bool> IsDeafened { get; set; }
} }
} }

+ 10
- 10
src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs View File

@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
@@ -8,31 +8,31 @@ namespace Discord.API.Rest
{ {
internal class CreateApplicationCommandParams internal class CreateApplicationCommandParams
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }


[JsonProperty("type")]
[JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; } public ApplicationCommandType Type { get; set; }


[JsonProperty("description")]
[JsonPropertyName("description")]
public string Description { get; set; } public string Description { get; set; }


[JsonProperty("options")]
[JsonPropertyName("options")]
public Optional<ApplicationCommandOption[]> Options { get; set; } public Optional<ApplicationCommandOption[]> Options { get; set; }


[JsonProperty("default_permission")]
[JsonPropertyName("default_permission")]
public Optional<bool> DefaultPermission { get; set; } public Optional<bool> DefaultPermission { get; set; }


[JsonProperty("name_localizations")]
[JsonPropertyName("name_localizations")]
public Optional<Dictionary<string, string>> NameLocalizations { get; set; } public Optional<Dictionary<string, string>> NameLocalizations { get; set; }


[JsonProperty("description_localizations")]
[JsonPropertyName("description_localizations")]
public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; } public Optional<Dictionary<string, string>> DescriptionLocalizations { get; set; }


[JsonProperty("dm_permission")]
[JsonPropertyName("dm_permission")]
public Optional<bool?> DmPermission { get; set; } public Optional<bool?> DmPermission { get; set; }


[JsonProperty("default_member_permissions")]
[JsonPropertyName("default_member_permissions")]
public Optional<GuildPermission?> DefaultMemberPermission { get; set; } public Optional<GuildPermission?> DefaultMemberPermission { get; set; }


public CreateApplicationCommandParams() { } public CreateApplicationCommandParams() { }


+ 8
- 8
src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs View File

@@ -1,23 +1,23 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
internal class CreateChannelInviteParams internal class CreateChannelInviteParams
{ {
[JsonProperty("max_age")]
[JsonPropertyName("max_age")]
public Optional<int> MaxAge { get; set; } public Optional<int> MaxAge { get; set; }
[JsonProperty("max_uses")]
[JsonPropertyName("max_uses")]
public Optional<int> MaxUses { get; set; } public Optional<int> MaxUses { get; set; }
[JsonProperty("temporary")]
[JsonPropertyName("temporary")]
public Optional<bool> IsTemporary { get; set; } public Optional<bool> IsTemporary { get; set; }
[JsonProperty("unique")]
[JsonPropertyName("unique")]
public Optional<bool> IsUnique { get; set; } public Optional<bool> IsUnique { get; set; }
[JsonProperty("target_type")]
[JsonPropertyName("target_type")]
public Optional<TargetUserType> TargetType { get; set; } public Optional<TargetUserType> TargetType { get; set; }
[JsonProperty("target_user_id")]
[JsonPropertyName("target_user_id")]
public Optional<ulong> TargetUserId { get; set; } public Optional<ulong> TargetUserId { get; set; }
[JsonProperty("target_application_id")]
[JsonPropertyName("target_application_id")]
public Optional<ulong> TargetApplicationId { get; set; } public Optional<ulong> TargetApplicationId { get; set; }
} }
} }

+ 2
- 2
src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs View File

@@ -1,11 +1,11 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
internal class CreateDMChannelParams internal class CreateDMChannelParams
{ {
[JsonProperty("recipient_id")]
[JsonPropertyName("recipient_id")]
public ulong RecipientId { get; } public ulong RecipientId { get; }


public CreateDMChannelParams(ulong recipientId) public CreateDMChannelParams(ulong recipientId)


+ 11
- 11
src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs View File

@@ -1,33 +1,33 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
internal class CreateGuildChannelParams internal class CreateGuildChannelParams
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; } public string Name { get; }
[JsonProperty("type")]
[JsonPropertyName("type")]
public ChannelType Type { get; } public ChannelType Type { get; }
[JsonProperty("parent_id")]
[JsonPropertyName("parent_id")]
public Optional<ulong?> CategoryId { get; set; } public Optional<ulong?> CategoryId { get; set; }
[JsonProperty("position")]
[JsonPropertyName("position")]
public Optional<int> Position { get; set; } public Optional<int> Position { get; set; }
[JsonProperty("permission_overwrites")]
[JsonPropertyName("permission_overwrites")]
public Optional<Overwrite[]> Overwrites { get; set; } public Optional<Overwrite[]> Overwrites { get; set; }


//Text channels //Text channels
[JsonProperty("topic")]
[JsonPropertyName("topic")]
public Optional<string> Topic { get; set; } public Optional<string> Topic { get; set; }
[JsonProperty("nsfw")]
[JsonPropertyName("nsfw")]
public Optional<bool> IsNsfw { get; set; } public Optional<bool> IsNsfw { get; set; }
[JsonProperty("rate_limit_per_user")]
[JsonPropertyName("rate_limit_per_user")]
public Optional<int> SlowModeInterval { get; set; } public Optional<int> SlowModeInterval { get; set; }


//Voice channels //Voice channels
[JsonProperty("bitrate")]
[JsonPropertyName("bitrate")]
public Optional<int> Bitrate { get; set; } public Optional<int> Bitrate { get; set; }
[JsonProperty("user_limit")]
[JsonPropertyName("user_limit")]
public Optional<int?> UserLimit { get; set; } public Optional<int?> UserLimit { get; set; }


public CreateGuildChannelParams(string name, ChannelType type) public CreateGuildChannelParams(string name, ChannelType type)


+ 4
- 4
src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs View File

@@ -1,15 +1,15 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
internal class CreateGuildEmoteParams internal class CreateGuildEmoteParams
{ {
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("image")]
[JsonPropertyName("image")]
public Image Image { get; set; } public Image Image { get; set; }
[JsonProperty("roles")]
[JsonPropertyName("roles")]
public Optional<ulong[]> RoleIds { get; set; } public Optional<ulong[]> RoleIds { get; set; }
} }
} }

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save