diff --git a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs index 0e634ad1a..aec894d21 100644 --- a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs +++ b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs @@ -1,4 +1,3 @@ -using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Diagnostics; @@ -19,7 +18,7 @@ namespace Discord /// Gets a that grants all permissions for the given channel. /// /// Unknown channel type. - public static OverwritePermissions AllowAll(IChannel channel) + public static OverwritePermissions AllowAll(IChannel channel) => new OverwritePermissions(ChannelPermissions.All(channel).RawValue, 0); /// /// Gets a that denies all permissions for the given channel. @@ -116,24 +115,24 @@ namespace Discord private OverwritePermissions(ulong allowValue, ulong denyValue, PermValue? createInstantInvite = null, - PermValue? manageChannel = null, + PermValue? manageChannel = null, PermValue? addReactions = null, PermValue? viewChannel = null, PermValue? sendMessages = null, PermValue? sendTTSMessages = null, - PermValue? manageMessages = null, + PermValue? manageMessages = null, PermValue? embedLinks = null, PermValue? attachFiles = null, PermValue? readMessageHistory = null, - PermValue? mentionEveryone = null, + PermValue? mentionEveryone = null, PermValue? useExternalEmojis = null, PermValue? connect = null, PermValue? speak = null, - PermValue? muteMembers = null, + PermValue? muteMembers = null, PermValue? deafenMembers = null, PermValue? moveMembers = null, PermValue? useVoiceActivation = null, - PermValue? manageRoles = null, + PermValue? manageRoles = null, PermValue? manageWebhooks = null, PermValue? prioritySpeaker = null, PermValue? stream = null, @@ -194,7 +193,7 @@ namespace Discord PermValue viewChannel = PermValue.Inherit, PermValue sendMessages = PermValue.Inherit, PermValue sendTTSMessages = PermValue.Inherit, - PermValue manageMessages = PermValue.Inherit, + PermValue manageMessages = PermValue.Inherit, PermValue embedLinks = PermValue.Inherit, PermValue attachFiles = PermValue.Inherit, PermValue readMessageHistory = PermValue.Inherit, @@ -221,8 +220,8 @@ namespace Discord PermValue useExternalStickers = PermValue.Inherit, PermValue sendMessagesInThreads = 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, requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers, sendMessagesInThreads, startEmbeddedActivities) { } @@ -238,11 +237,11 @@ namespace Discord PermValue? viewChannel = null, PermValue? sendMessages = null, PermValue? sendTTSMessages = null, - PermValue? manageMessages = null, + PermValue? manageMessages = null, PermValue? embedLinks = null, PermValue? attachFiles = null, PermValue? readMessageHistory = null, - PermValue? mentionEveryone = null, + PermValue? mentionEveryone = null, PermValue? useExternalEmojis = null, PermValue? connect = null, PermValue? speak = null, @@ -265,8 +264,8 @@ namespace Discord PermValue? useExternalStickers = null, PermValue? sendMessagesInThreads = 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, requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers, sendMessagesInThreads, startEmbeddedActivities); @@ -305,7 +304,7 @@ namespace Discord } public override string ToString() => $"Allow {AllowValue}, Deny {DenyValue}"; - private string DebuggerDisplay => + private string DebuggerDisplay => $"Allow {string.Join(", ", ToAllowList())}, " + $"Deny {string.Join(", ", ToDenyList())}"; } diff --git a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs index 9a7eb80dd..6a42113e1 100644 --- a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Linq; namespace Discord.API { internal class ActionRowComponent : IMessageComponent { - [JsonProperty("type")] + [JsonPropertyName("type")] public ComponentType Type { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public IMessageComponent[] Components { get; set; } internal ActionRowComponent() { } diff --git a/src/Discord.Net.Rest/API/Common/AllowedMentions.cs b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs index 7737a464f..d8825def4 100644 --- a/src/Discord.Net.Rest/API/Common/AllowedMentions.cs +++ b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AllowedMentions { - [JsonProperty("parse")] + [JsonPropertyName("parse")] public Optional Parse { get; set; } // Roles and Users have a max size of 100 - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional Roles { get; set; } - [JsonProperty("users")] + [JsonPropertyName("users")] public Optional Users { get; set; } - [JsonProperty("replied_user")] + [JsonPropertyName("replied_user")] public Optional RepliedUser { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Application.cs b/src/Discord.Net.Rest/API/Common/Application.cs index 62a1d9688..ce36664c3 100644 --- a/src/Discord.Net.Rest/API/Common/Application.cs +++ b/src/Discord.Net.Rest/API/Common/Application.cs @@ -1,36 +1,36 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Application { - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("rpc_origins")] + [JsonPropertyName("rpc_origins")] public Optional RPCOrigins { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public string Icon { get; set; } - [JsonProperty("bot_public")] + [JsonPropertyName("bot_public")] public bool IsBotPublic { get; set; } - [JsonProperty("bot_require_code_grant")] + [JsonPropertyName("bot_require_code_grant")] public bool BotRequiresCodeGrant { get; set; } - [JsonProperty("install_params")] + [JsonPropertyName("install_params")] public Optional InstallParams { get; set; } - [JsonProperty("team")] + [JsonPropertyName("team")] public Team Team { get; set; } - [JsonProperty("flags"), Int53] + [JsonPropertyName("flags"), Int53] public Optional Flags { get; set; } - [JsonProperty("owner")] + [JsonPropertyName("owner")] public Optional Owner { get; set; } - [JsonProperty("tags")] + [JsonPropertyName("tags")] public Optional Tags { get; set; } - [JsonProperty("terms_of_service_url")] + [JsonPropertyName("terms_of_service_url")] public string TermsOfService { get; set; } - [JsonProperty("privacy_policy_url")] + [JsonPropertyName("privacy_policy_url")] public string PrivacyPolicy { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs index e46369277..226deb04b 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs @@ -1,48 +1,48 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API { internal class ApplicationCommand { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandType Type { get; set; } = ApplicationCommandType.Slash; // defaults to 1 which is slash. - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public ulong ApplicationId { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("default_permission")] + [JsonPropertyName("default_permission")] public Optional DefaultPermissions { get; set; } - [JsonProperty("name_localizations")] + [JsonPropertyName("name_localizations")] public Optional> NameLocalizations { get; set; } - [JsonProperty("description_localizations")] + [JsonPropertyName("description_localizations")] public Optional> DescriptionLocalizations { get; set; } - [JsonProperty("name_localized")] + [JsonPropertyName("name_localized")] public Optional NameLocalized { get; set; } - [JsonProperty("description_localized")] + [JsonPropertyName("description_localized")] public Optional DescriptionLocalized { get; set; } - + // V2 Permissions - [JsonProperty("dm_permission")] + [JsonPropertyName("dm_permission")] public Optional DmPermission { get; set; } - [JsonProperty("default_member_permissions")] + [JsonPropertyName("default_member_permissions")] public Optional DefaultMemberPermission { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs index a98ed77d6..ac952f0a4 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ApplicationCommandInteractionData : IResolvable, IDiscordInteractionData { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("resolved")] + [JsonPropertyName("resolved")] public Optional Resolved { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandType Type { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs index 1e488c4e6..b180273c6 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ApplicationCommandInteractionDataOption { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandOptionType Type { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public Optional Value { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs index 690be6cef..06f103a97 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataResolved.cs @@ -1,24 +1,24 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API { internal class ApplicationCommandInteractionDataResolved { - [JsonProperty("users")] + [JsonPropertyName("users")] public Optional> Users { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public Optional> Members { get; set; } - [JsonProperty("channels")] + [JsonPropertyName("channels")] public Optional> Channels { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional> Roles { get; set; } - [JsonProperty("messages")] + [JsonPropertyName("messages")] public Optional> Messages { get; set; } - [JsonProperty("attachments")] + [JsonPropertyName("attachments")] public Optional> Attachments { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs index fb64d5ebe..a42d39fe5 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; using System.Linq; @@ -6,55 +6,55 @@ namespace Discord.API { internal class ApplicationCommandOption { - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandOptionType Type { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("default")] + [JsonPropertyName("default")] public Optional Default { get; set; } - [JsonProperty("required")] + [JsonPropertyName("required")] public Optional Required { get; set; } - [JsonProperty("choices")] + [JsonPropertyName("choices")] public Optional Choices { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("autocomplete")] + [JsonPropertyName("autocomplete")] public Optional Autocomplete { get; set; } - [JsonProperty("min_value")] + [JsonPropertyName("min_value")] public Optional MinValue { get; set; } - [JsonProperty("max_value")] + [JsonPropertyName("max_value")] public Optional MaxValue { get; set; } - [JsonProperty("channel_types")] + [JsonPropertyName("channel_types")] public Optional ChannelTypes { get; set; } - [JsonProperty("name_localizations")] + [JsonPropertyName("name_localizations")] public Optional> NameLocalizations { get; set; } - [JsonProperty("description_localizations")] + [JsonPropertyName("description_localizations")] public Optional> DescriptionLocalizations { get; set; } - [JsonProperty("name_localized")] + [JsonPropertyName("name_localized")] public Optional NameLocalized { get; set; } - [JsonProperty("description_localized")] + [JsonPropertyName("description_localized")] public Optional DescriptionLocalized { get; set; } - [JsonProperty("min_length")] + [JsonPropertyName("min_length")] public Optional MinLength { get; set; } - [JsonProperty("max_length")] + [JsonPropertyName("max_length")] public Optional MaxLength { get; set; } public ApplicationCommandOption() { } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs index 966405cc9..0acc1434d 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandOptionChoice.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API { internal class ApplicationCommandOptionChoice { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public object Value { get; set; } - [JsonProperty("name_localizations")] + [JsonPropertyName("name_localizations")] public Optional> NameLocalizations { get; set; } - [JsonProperty("name_localized")] + [JsonPropertyName("name_localized")] public Optional NameLocalized { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs index 8bde80f50..9c9e9e6c4 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandPermissions.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ApplicationCommandPermissions { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandPermissionTarget Type { get; set; } - [JsonProperty("permission")] + [JsonPropertyName("permission")] public bool Permission { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Attachment.cs b/src/Discord.Net.Rest/API/Common/Attachment.cs index 7970dc9a5..0f0f9c3f2 100644 --- a/src/Discord.Net.Rest/API/Common/Attachment.cs +++ b/src/Discord.Net.Rest/API/Common/Attachment.cs @@ -1,28 +1,28 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Attachment { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("filename")] + [JsonPropertyName("filename")] public string Filename { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("content_type")] + [JsonPropertyName("content_type")] public Optional ContentType { get; set; } - [JsonProperty("size")] + [JsonPropertyName("size")] public int Size { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("proxy_url")] + [JsonPropertyName("proxy_url")] public string ProxyUrl { get; set; } - [JsonProperty("height")] + [JsonPropertyName("height")] public Optional Height { get; set; } - [JsonProperty("width")] + [JsonPropertyName("width")] public Optional Width { get; set; } - [JsonProperty("ephemeral")] + [JsonPropertyName("ephemeral")] public Optional Ephemeral { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AuditLog.cs b/src/Discord.Net.Rest/API/Common/AuditLog.cs index c8bd6d3e2..d2fd673e3 100644 --- a/src/Discord.Net.Rest/API/Common/AuditLog.cs +++ b/src/Discord.Net.Rest/API/Common/AuditLog.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AuditLog { - [JsonProperty("webhooks")] + [JsonPropertyName("webhooks")] public Webhook[] Webhooks { get; set; } - [JsonProperty("threads")] + [JsonPropertyName("threads")] public Channel[] Threads { get; set; } - [JsonProperty("integrations")] + [JsonPropertyName("integrations")] public Integration[] Integrations { get; set; } - [JsonProperty("users")] + [JsonPropertyName("users")] public User[] Users { get; set; } - [JsonProperty("audit_log_entries")] + [JsonPropertyName("audit_log_entries")] public AuditLogEntry[] Entries { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AuditLogChange.cs b/src/Discord.Net.Rest/API/Common/AuditLogChange.cs index 44e585021..dbd9e6e75 100644 --- a/src/Discord.Net.Rest/API/Common/AuditLogChange.cs +++ b/src/Discord.Net.Rest/API/Common/AuditLogChange.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using Newtonsoft.Json.Linq; namespace Discord.API { internal class AuditLogChange { - [JsonProperty("key")] + [JsonPropertyName("key")] public string ChangedProperty { get; set; } - [JsonProperty("new_value")] + [JsonPropertyName("new_value")] public JToken NewValue { get; set; } - [JsonProperty("old_value")] + [JsonPropertyName("old_value")] public JToken OldValue { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AuditLogEntry.cs b/src/Discord.Net.Rest/API/Common/AuditLogEntry.cs index 9626ad67e..6a724cc2b 100644 --- a/src/Discord.Net.Rest/API/Common/AuditLogEntry.cs +++ b/src/Discord.Net.Rest/API/Common/AuditLogEntry.cs @@ -1,26 +1,26 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AuditLogEntry { - [JsonProperty("target_id")] + [JsonPropertyName("target_id")] public ulong? TargetId { get; set; } - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong? UserId { get; set; } - [JsonProperty("changes")] + [JsonPropertyName("changes")] public AuditLogChange[] Changes { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public AuditLogOptions Options { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("action_type")] + [JsonPropertyName("action_type")] public ActionType Action { get; set; } - [JsonProperty("reason")] + [JsonPropertyName("reason")] public string Reason { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AuditLogOptions.cs b/src/Discord.Net.Rest/API/Common/AuditLogOptions.cs index b666215e2..fe9995fa5 100644 --- a/src/Discord.Net.Rest/API/Common/AuditLogOptions.cs +++ b/src/Discord.Net.Rest/API/Common/AuditLogOptions.cs @@ -1,28 +1,28 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AuditLogOptions { - [JsonProperty("count")] + [JsonPropertyName("count")] public int? Count { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong? ChannelId { get; set; } - [JsonProperty("message_id")] + [JsonPropertyName("message_id")] public ulong? MessageId { get; set; } //Prune - [JsonProperty("delete_member_days")] + [JsonPropertyName("delete_member_days")] public int? PruneDeleteMemberDays { get; set; } - [JsonProperty("members_removed")] + [JsonPropertyName("members_removed")] public int? PruneMembersRemoved { get; set; } //Overwrite Update - [JsonProperty("role_name")] + [JsonPropertyName("role_name")] public string OverwriteRoleName { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public PermissionTarget OverwriteType { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong? OverwriteTargetId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs b/src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs index 2184a0e98..37d793d99 100644 --- a/src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/AutocompleteInteractionData.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AutocompleteInteractionData : IDiscordInteractionData { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandType Type { get; set; } - [JsonProperty("version")] + [JsonPropertyName("version")] public ulong Version { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public AutocompleteInteractionDataOption[] Options { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs b/src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs index 1419f93b6..ff8014d86 100644 --- a/src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs +++ b/src/Discord.Net.Rest/API/Common/AutocompleteInteractionDataOption.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class AutocompleteInteractionDataOption { - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandOptionType Type { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public Optional Value { get; set; } - [JsonProperty("focused")] + [JsonPropertyName("focused")] public Optional Focused { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Ban.cs b/src/Discord.Net.Rest/API/Common/Ban.cs index ff47c7904..458d5b705 100644 --- a/src/Discord.Net.Rest/API/Common/Ban.cs +++ b/src/Discord.Net.Rest/API/Common/Ban.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Ban { - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("reason")] + [JsonPropertyName("reason")] public string Reason { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs index 7f737d7ad..c98d0e55a 100644 --- a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs @@ -1,28 +1,28 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ButtonComponent : IMessageComponent { - [JsonProperty("type")] + [JsonPropertyName("type")] public ComponentType Type { get; set; } - [JsonProperty("style")] + [JsonPropertyName("style")] public ButtonStyle Style { get; set; } - [JsonProperty("label")] + [JsonPropertyName("label")] public Optional Label { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Optional Emote { get; set; } - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public Optional CustomId { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public Optional Url { get; set; } - [JsonProperty("disabled")] + [JsonPropertyName("disabled")] public Optional Disabled { get; set; } public ButtonComponent() { } diff --git a/src/Discord.Net.Rest/API/Common/Channel.cs b/src/Discord.Net.Rest/API/Common/Channel.cs index d9d7d469c..e39c56905 100644 --- a/src/Discord.Net.Rest/API/Common/Channel.cs +++ b/src/Discord.Net.Rest/API/Common/Channel.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API @@ -6,72 +6,72 @@ namespace Discord.API internal class Channel { //Shared - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ChannelType Type { get; set; } - [JsonProperty("last_message_id")] + [JsonPropertyName("last_message_id")] public ulong? LastMessageId { get; set; } //GuildChannel - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("position")] + [JsonPropertyName("position")] public Optional Position { get; set; } - [JsonProperty("permission_overwrites")] + [JsonPropertyName("permission_overwrites")] public Optional PermissionOverwrites { get; set; } - [JsonProperty("parent_id")] + [JsonPropertyName("parent_id")] public ulong? CategoryId { get; set; } //TextChannel - [JsonProperty("topic")] + [JsonPropertyName("topic")] public Optional Topic { get; set; } - [JsonProperty("last_pin_timestamp")] + [JsonPropertyName("last_pin_timestamp")] public Optional LastPinTimestamp { get; set; } - [JsonProperty("nsfw")] + [JsonPropertyName("nsfw")] public Optional Nsfw { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional SlowMode { get; set; } //VoiceChannel - [JsonProperty("bitrate")] + [JsonPropertyName("bitrate")] public Optional Bitrate { get; set; } - [JsonProperty("user_limit")] + [JsonPropertyName("user_limit")] public Optional UserLimit { get; set; } - [JsonProperty("rtc_region")] + [JsonPropertyName("rtc_region")] public Optional RTCRegion { get; set; } //PrivateChannel - [JsonProperty("recipients")] + [JsonPropertyName("recipients")] public Optional Recipients { get; set; } //GroupChannel - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } //ThreadChannel - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional ThreadMember { get; set; } - [JsonProperty("thread_metadata")] + [JsonPropertyName("thread_metadata")] public Optional ThreadMetadata { get; set; } - [JsonProperty("owner_id")] + [JsonPropertyName("owner_id")] public Optional OwnerId { get; set; } - [JsonProperty("message_count")] + [JsonPropertyName("message_count")] public Optional MessageCount { get; set; } - [JsonProperty("member_count")] + [JsonPropertyName("member_count")] public Optional MemberCount { get; set; } //ForumChannel - [JsonProperty("available_tags")] + [JsonPropertyName("available_tags")] public Optional ForumTags { get; set; } - - [JsonProperty("default_auto_archive_duration")] + + [JsonPropertyName("default_auto_archive_duration")] public Optional AutoArchiveDuration { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ChannelThreads.cs b/src/Discord.Net.Rest/API/Common/ChannelThreads.cs index 9fa3e38ce..e1abc4ac5 100644 --- a/src/Discord.Net.Rest/API/Common/ChannelThreads.cs +++ b/src/Discord.Net.Rest/API/Common/ChannelThreads.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ChannelThreads { - [JsonProperty("threads")] + [JsonPropertyName("threads")] public Channel[] Threads { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public ThreadMember[] Members { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Connection.cs b/src/Discord.Net.Rest/API/Common/Connection.cs index 0a9940e23..91f08615c 100644 --- a/src/Discord.Net.Rest/API/Common/Connection.cs +++ b/src/Discord.Net.Rest/API/Common/Connection.cs @@ -1,27 +1,27 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API { internal class Connection { - [JsonProperty("id")] + [JsonPropertyName("id")] public string Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public string Type { get; set; } - [JsonProperty("revoked")] + [JsonPropertyName("revoked")] public Optional Revoked { get; set; } - [JsonProperty("integrations")] + [JsonPropertyName("integrations")] public Optional> Integrations { get; set; } - [JsonProperty("verified")] + [JsonPropertyName("verified")] public bool Verified { get; set; } - [JsonProperty("friend_sync")] + [JsonPropertyName("friend_sync")] public bool FriendSync { get; set; } - [JsonProperty("show_activity")] + [JsonPropertyName("show_activity")] public bool ShowActivity { get; set; } - [JsonProperty("visibility")] + [JsonPropertyName("visibility")] public ConnectionVisibility Visibility { get; set; } } diff --git a/src/Discord.Net.Rest/API/Common/DiscordError.cs b/src/Discord.Net.Rest/API/Common/DiscordError.cs index ac1e5e13d..83cf1ff04 100644 --- a/src/Discord.Net.Rest/API/Common/DiscordError.cs +++ b/src/Discord.Net.Rest/API/Common/DiscordError.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -10,11 +10,11 @@ namespace Discord.API [JsonConverter(typeof(Discord.Net.Converters.DiscordErrorConverter))] internal class DiscordError { - [JsonProperty("message")] + [JsonPropertyName("message")] public string Message { get; set; } - [JsonProperty("code")] + [JsonPropertyName("code")] public DiscordErrorCode Code { get; set; } - [JsonProperty("errors")] + [JsonPropertyName("errors")] public Optional Errors { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Embed.cs b/src/Discord.Net.Rest/API/Common/Embed.cs index 77efa12aa..49417334b 100644 --- a/src/Discord.Net.Rest/API/Common/Embed.cs +++ b/src/Discord.Net.Rest/API/Common/Embed.cs @@ -1,36 +1,36 @@ using System; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using Discord.Net.Converters; namespace Discord.API { internal class Embed { - [JsonProperty("title")] + [JsonPropertyName("title")] public string Title { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("color")] + [JsonPropertyName("color")] public uint? Color { get; set; } - [JsonProperty("type"), JsonConverter(typeof(EmbedTypeConverter))] + [JsonPropertyName("type"), JsonConverter(typeof(EmbedTypeConverter))] public EmbedType Type { get; set; } - [JsonProperty("timestamp")] + [JsonPropertyName("timestamp")] public DateTimeOffset? Timestamp { get; set; } - [JsonProperty("author")] + [JsonPropertyName("author")] public Optional Author { get; set; } - [JsonProperty("footer")] + [JsonPropertyName("footer")] public Optional Footer { get; set; } - [JsonProperty("video")] + [JsonPropertyName("video")] public Optional Video { get; set; } - [JsonProperty("thumbnail")] + [JsonPropertyName("thumbnail")] public Optional Thumbnail { get; set; } - [JsonProperty("image")] + [JsonPropertyName("image")] public Optional Image { get; set; } - [JsonProperty("provider")] + [JsonPropertyName("provider")] public Optional Provider { get; set; } - [JsonProperty("fields")] + [JsonPropertyName("fields")] public Optional Fields { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedAuthor.cs b/src/Discord.Net.Rest/API/Common/EmbedAuthor.cs index d7f3ae68d..ce7cde390 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedAuthor.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedAuthor.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedAuthor { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("icon_url")] + [JsonPropertyName("icon_url")] public string IconUrl { get; set; } - [JsonProperty("proxy_icon_url")] + [JsonPropertyName("proxy_icon_url")] public string ProxyIconUrl { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedField.cs b/src/Discord.Net.Rest/API/Common/EmbedField.cs index 6ce810f1a..5a58e39ba 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedField.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedField.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedField { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public string Value { get; set; } - [JsonProperty("inline")] + [JsonPropertyName("inline")] public bool Inline { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedFooter.cs b/src/Discord.Net.Rest/API/Common/EmbedFooter.cs index cd08e7e26..11e944eb9 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedFooter.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedFooter.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedFooter { - [JsonProperty("text")] + [JsonPropertyName("text")] public string Text { get; set; } - [JsonProperty("icon_url")] + [JsonPropertyName("icon_url")] public string IconUrl { get; set; } - [JsonProperty("proxy_icon_url")] + [JsonPropertyName("proxy_icon_url")] public string ProxyIconUrl { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedImage.cs b/src/Discord.Net.Rest/API/Common/EmbedImage.cs index 6b5db0681..90da1a974 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedImage.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedImage.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedImage { - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("proxy_url")] + [JsonPropertyName("proxy_url")] public string ProxyUrl { get; set; } - [JsonProperty("height")] + [JsonPropertyName("height")] public Optional Height { get; set; } - [JsonProperty("width")] + [JsonPropertyName("width")] public Optional Width { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedProvider.cs b/src/Discord.Net.Rest/API/Common/EmbedProvider.cs index ed0f7c3c8..526974a90 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedProvider.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedProvider.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedProvider { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs b/src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs index dd25a1a26..488b1bfa9 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedThumbnail { - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("proxy_url")] + [JsonPropertyName("proxy_url")] public string ProxyUrl { get; set; } - [JsonProperty("height")] + [JsonPropertyName("height")] public Optional Height { get; set; } - [JsonProperty("width")] + [JsonPropertyName("width")] public Optional Width { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/EmbedVideo.cs b/src/Discord.Net.Rest/API/Common/EmbedVideo.cs index f668217f0..96e465964 100644 --- a/src/Discord.Net.Rest/API/Common/EmbedVideo.cs +++ b/src/Discord.Net.Rest/API/Common/EmbedVideo.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class EmbedVideo { - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("height")] + [JsonPropertyName("height")] public Optional Height { get; set; } - [JsonProperty("width")] + [JsonPropertyName("width")] public Optional Width { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Emoji.cs b/src/Discord.Net.Rest/API/Common/Emoji.cs index ff0baa73e..16ba0cff1 100644 --- a/src/Discord.Net.Rest/API/Common/Emoji.cs +++ b/src/Discord.Net.Rest/API/Common/Emoji.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Emoji { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong? Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("animated")] + [JsonPropertyName("animated")] public bool? Animated { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public ulong[] Roles { get; set; } - [JsonProperty("require_colons")] + [JsonPropertyName("require_colons")] public bool RequireColons { get; set; } - [JsonProperty("managed")] + [JsonPropertyName("managed")] public bool Managed { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public Optional User { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Error.cs b/src/Discord.Net.Rest/API/Common/Error.cs index a2b1777a3..73460f73e 100644 --- a/src/Discord.Net.Rest/API/Common/Error.cs +++ b/src/Discord.Net.Rest/API/Common/Error.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Error { - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } - [JsonProperty("message")] + [JsonPropertyName("message")] public string Message { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ForumTags.cs b/src/Discord.Net.Rest/API/Common/ForumTags.cs index 18354e7b2..6eda9ef6f 100644 --- a/src/Discord.Net.Rest/API/Common/ForumTags.cs +++ b/src/Discord.Net.Rest/API/Common/ForumTags.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,13 +9,13 @@ namespace Discord.API { internal class ForumTags { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("emoji_id")] + [JsonPropertyName("emoji_id")] public Optional EmojiId { get; set; } - [JsonProperty("emoji_name")] + [JsonPropertyName("emoji_name")] public Optional EmojiName { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs b/src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs index 132e38e5f..aaf9fc7ad 100644 --- a/src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs +++ b/src/Discord.Net.Rest/API/Common/ForumThreadMessage.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,25 +9,25 @@ namespace Discord.API { internal class ForumThreadMessage { - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("nonce")] + [JsonPropertyName("nonce")] public Optional Nonce { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("sticker_ids")] + [JsonPropertyName("sticker_ids")] public Optional Stickers { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Game.cs b/src/Discord.Net.Rest/API/Common/Game.cs index 105ce0d73..52564d9a4 100644 --- a/src/Discord.Net.Rest/API/Common/Game.cs +++ b/src/Discord.Net.Rest/API/Common/Game.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using Newtonsoft.Json.Serialization; using System.Runtime.Serialization; @@ -6,41 +6,41 @@ namespace Discord.API { internal class Game { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("url")] + [JsonPropertyName("url")] public Optional StreamUrl { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public Optional Type { get; set; } - [JsonProperty("details")] + [JsonPropertyName("details")] public Optional Details { get; set; } - [JsonProperty("state")] + [JsonPropertyName("state")] public Optional State { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public Optional ApplicationId { get; set; } - [JsonProperty("assets")] + [JsonPropertyName("assets")] public Optional Assets { get; set; } - [JsonProperty("party")] + [JsonPropertyName("party")] public Optional Party { get; set; } - [JsonProperty("secrets")] + [JsonPropertyName("secrets")] public Optional Secrets { get; set; } - [JsonProperty("timestamps")] + [JsonPropertyName("timestamps")] public Optional Timestamps { get; set; } - [JsonProperty("instance")] + [JsonPropertyName("instance")] public Optional Instance { get; set; } - [JsonProperty("sync_id")] + [JsonPropertyName("sync_id")] public Optional SyncId { get; set; } - [JsonProperty("session_id")] + [JsonPropertyName("session_id")] public Optional SessionId { get; set; } - [JsonProperty("Flags")] + [JsonPropertyName("Flags")] public Optional Flags { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public Optional Id { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Optional Emoji { get; set; } - [JsonProperty("created_at")] + [JsonPropertyName("created_at")] public Optional CreatedAt { get; set; } - //[JsonProperty("buttons")] + //[JsonPropertyName("buttons")] //public Optional Buttons { get; set; } [OnError] diff --git a/src/Discord.Net.Rest/API/Common/GameAssets.cs b/src/Discord.Net.Rest/API/Common/GameAssets.cs index 94a540769..5e0a9d99f 100644 --- a/src/Discord.Net.Rest/API/Common/GameAssets.cs +++ b/src/Discord.Net.Rest/API/Common/GameAssets.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GameAssets { - [JsonProperty("small_text")] + [JsonPropertyName("small_text")] public Optional SmallText { get; set; } - [JsonProperty("small_image")] + [JsonPropertyName("small_image")] public Optional SmallImage { get; set; } - [JsonProperty("large_text")] + [JsonPropertyName("large_text")] public Optional LargeText { get; set; } - [JsonProperty("large_image")] + [JsonPropertyName("large_image")] public Optional LargeImage { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GameParty.cs b/src/Discord.Net.Rest/API/Common/GameParty.cs index 4f8ce2654..182d90457 100644 --- a/src/Discord.Net.Rest/API/Common/GameParty.cs +++ b/src/Discord.Net.Rest/API/Common/GameParty.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GameParty { - [JsonProperty("id")] + [JsonPropertyName("id")] public string Id { get; set; } - [JsonProperty("size")] + [JsonPropertyName("size")] public long[] Size { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GameSecrets.cs b/src/Discord.Net.Rest/API/Common/GameSecrets.cs index e70b48ff0..eb0721c16 100644 --- a/src/Discord.Net.Rest/API/Common/GameSecrets.cs +++ b/src/Discord.Net.Rest/API/Common/GameSecrets.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GameSecrets { - [JsonProperty("match")] + [JsonPropertyName("match")] public string Match { get; set; } - [JsonProperty("join")] + [JsonPropertyName("join")] public string Join { get; set; } - [JsonProperty("spectate")] + [JsonPropertyName("spectate")] public string Spectate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Discord.Net.Rest/API/Common/GameTimestamps.cs b/src/Discord.Net.Rest/API/Common/GameTimestamps.cs index 5c6f10b86..9f996fce1 100644 --- a/src/Discord.Net.Rest/API/Common/GameTimestamps.cs +++ b/src/Discord.Net.Rest/API/Common/GameTimestamps.cs @@ -1,15 +1,15 @@ using System; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GameTimestamps { - [JsonProperty("start")] + [JsonPropertyName("start")] [UnixTimestamp] public Optional Start { get; set; } - [JsonProperty("end")] + [JsonPropertyName("end")] [UnixTimestamp] public Optional End { get; set; } } -} \ No newline at end of file +} diff --git a/src/Discord.Net.Rest/API/Common/Guild.cs b/src/Discord.Net.Rest/API/Common/Guild.cs index d550c54a0..33bf8b3f4 100644 --- a/src/Discord.Net.Rest/API/Common/Guild.cs +++ b/src/Discord.Net.Rest/API/Common/Guild.cs @@ -1,87 +1,87 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Guild { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public string Icon { get; set; } - [JsonProperty("splash")] + [JsonPropertyName("splash")] public string Splash { get; set; } - [JsonProperty("discovery_splash")] + [JsonPropertyName("discovery_splash")] public string DiscoverySplash { get; set; } - [JsonProperty("owner_id")] + [JsonPropertyName("owner_id")] public ulong OwnerId { get; set; } - [JsonProperty("region")] + [JsonPropertyName("region")] public string Region { get; set; } - [JsonProperty("afk_channel_id")] + [JsonPropertyName("afk_channel_id")] public ulong? AFKChannelId { get; set; } - [JsonProperty("afk_timeout")] + [JsonPropertyName("afk_timeout")] public int AFKTimeout { get; set; } - [JsonProperty("verification_level")] + [JsonPropertyName("verification_level")] public VerificationLevel VerificationLevel { get; set; } - [JsonProperty("default_message_notifications")] + [JsonPropertyName("default_message_notifications")] public DefaultMessageNotifications DefaultMessageNotifications { get; set; } - [JsonProperty("explicit_content_filter")] + [JsonPropertyName("explicit_content_filter")] public ExplicitContentFilterLevel ExplicitContentFilter { get; set; } - [JsonProperty("voice_states")] + [JsonPropertyName("voice_states")] public VoiceState[] VoiceStates { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Role[] Roles { get; set; } - [JsonProperty("emojis")] + [JsonPropertyName("emojis")] public Emoji[] Emojis { get; set; } - [JsonProperty("features")] + [JsonPropertyName("features")] public GuildFeatures Features { get; set; } - [JsonProperty("mfa_level")] + [JsonPropertyName("mfa_level")] public MfaLevel MfaLevel { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public ulong? ApplicationId { get; set; } - [JsonProperty("widget_enabled")] + [JsonPropertyName("widget_enabled")] public Optional WidgetEnabled { get; set; } - [JsonProperty("widget_channel_id")] + [JsonPropertyName("widget_channel_id")] public Optional WidgetChannelId { get; set; } - [JsonProperty("system_channel_id")] + [JsonPropertyName("system_channel_id")] public ulong? SystemChannelId { get; set; } - [JsonProperty("premium_tier")] + [JsonPropertyName("premium_tier")] public PremiumTier PremiumTier { get; set; } - [JsonProperty("vanity_url_code")] + [JsonPropertyName("vanity_url_code")] public string VanityURLCode { get; set; } - [JsonProperty("banner")] + [JsonPropertyName("banner")] public string Banner { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } // this value is inverted, flags set will turn OFF features - [JsonProperty("system_channel_flags")] + [JsonPropertyName("system_channel_flags")] public SystemChannelMessageDeny SystemChannelFlags { get; set; } - [JsonProperty("rules_channel_id")] + [JsonPropertyName("rules_channel_id")] public ulong? RulesChannelId { get; set; } - [JsonProperty("max_presences")] + [JsonPropertyName("max_presences")] public Optional MaxPresences { get; set; } - [JsonProperty("max_members")] + [JsonPropertyName("max_members")] public Optional MaxMembers { get; set; } - [JsonProperty("premium_subscription_count")] + [JsonPropertyName("premium_subscription_count")] public int? PremiumSubscriptionCount { get; set; } - [JsonProperty("preferred_locale")] + [JsonPropertyName("preferred_locale")] public string PreferredLocale { get; set; } - [JsonProperty("public_updates_channel_id")] + [JsonPropertyName("public_updates_channel_id")] public ulong? PublicUpdatesChannelId { get; set; } - [JsonProperty("max_video_channel_users")] + [JsonPropertyName("max_video_channel_users")] public Optional MaxVideoChannelUsers { get; set; } - [JsonProperty("approximate_member_count")] + [JsonPropertyName("approximate_member_count")] public Optional ApproximateMemberCount { get; set; } - [JsonProperty("approximate_presence_count")] + [JsonPropertyName("approximate_presence_count")] public Optional ApproximatePresenceCount { get; set; } - [JsonProperty("threads")] + [JsonPropertyName("threads")] public Optional Threads { get; set; } - [JsonProperty("nsfw_level")] + [JsonPropertyName("nsfw_level")] public NsfwLevel NsfwLevel { get; set; } - [JsonProperty("stickers")] + [JsonPropertyName("stickers")] public Sticker[] Stickers { get; set; } - [JsonProperty("premium_progress_bar_enabled")] + [JsonPropertyName("premium_progress_bar_enabled")] public Optional IsBoostProgressBarEnabled { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs b/src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs index cc74299f7..ba56de54d 100644 --- a/src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs +++ b/src/Discord.Net.Rest/API/Common/GuildApplicationCommandPermissions.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GuildApplicationCommandPermission { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public ulong ApplicationId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public ApplicationCommandPermissions[] Permissions { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildMember.cs b/src/Discord.Net.Rest/API/Common/GuildMember.cs index cd3101224..3e9c203c1 100644 --- a/src/Discord.Net.Rest/API/Common/GuildMember.cs +++ b/src/Discord.Net.Rest/API/Common/GuildMember.cs @@ -1,29 +1,29 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class GuildMember { - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("nick")] + [JsonPropertyName("nick")] public Optional Nick { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional Roles { get; set; } - [JsonProperty("joined_at")] + [JsonPropertyName("joined_at")] public Optional JoinedAt { get; set; } - [JsonProperty("deaf")] + [JsonPropertyName("deaf")] public Optional Deaf { get; set; } - [JsonProperty("mute")] + [JsonPropertyName("mute")] public Optional Mute { get; set; } - [JsonProperty("pending")] + [JsonPropertyName("pending")] public Optional Pending { get; set; } - [JsonProperty("premium_since")] + [JsonPropertyName("premium_since")] public Optional PremiumSince { get; set; } - [JsonProperty("communication_disabled_until")] + [JsonPropertyName("communication_disabled_until")] public Optional TimedOutUntil { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs b/src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs index 94c53e779..18815d3ba 100644 --- a/src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs +++ b/src/Discord.Net.Rest/API/Common/GuildScheduledEvent.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,37 +9,37 @@ namespace Discord.API { internal class GuildScheduledEvent { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } - [JsonProperty("creator_id")] + [JsonPropertyName("creator_id")] public Optional CreatorId { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("scheduled_start_time")] + [JsonPropertyName("scheduled_start_time")] public DateTimeOffset ScheduledStartTime { get; set; } - [JsonProperty("scheduled_end_time")] + [JsonPropertyName("scheduled_end_time")] public DateTimeOffset? ScheduledEndTime { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public GuildScheduledEventPrivacyLevel PrivacyLevel { get; set; } - [JsonProperty("status")] + [JsonPropertyName("status")] public GuildScheduledEventStatus Status { get; set; } - [JsonProperty("entity_type")] + [JsonPropertyName("entity_type")] public GuildScheduledEventType EntityType { get; set; } - [JsonProperty("entity_id")] + [JsonPropertyName("entity_id")] public ulong? EntityId { get; set; } - [JsonProperty("entity_metadata")] + [JsonPropertyName("entity_metadata")] public GuildScheduledEventEntityMetadata EntityMetadata { get; set; } - [JsonProperty("creator")] + [JsonPropertyName("creator")] public Optional Creator { get; set; } - [JsonProperty("user_count")] + [JsonPropertyName("user_count")] public Optional UserCount { get; set; } - [JsonProperty("image")] + [JsonPropertyName("image")] public string Image { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs b/src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs index 1db38c0ae..0efd216cf 100644 --- a/src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs +++ b/src/Discord.Net.Rest/API/Common/GuildScheduledEventEntityMetadata.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,7 +9,7 @@ namespace Discord.API { internal class GuildScheduledEventEntityMetadata { - [JsonProperty("location")] + [JsonPropertyName("location")] public Optional Location { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs b/src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs index 1b0b93763..ef66b237f 100644 --- a/src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs +++ b/src/Discord.Net.Rest/API/Common/GuildScheduledEventUser.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,11 +9,11 @@ namespace Discord.API { internal class GuildScheduledEventUser { - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional Member { get; set; } - [JsonProperty("guild_scheduled_event_id")] + [JsonPropertyName("guild_scheduled_event_id")] public ulong GuildScheduledEventId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/GuildWidget.cs b/src/Discord.Net.Rest/API/Common/GuildWidget.cs index 6b1d29cce..393f33b5d 100644 --- a/src/Discord.Net.Rest/API/Common/GuildWidget.cs +++ b/src/Discord.Net.Rest/API/Common/GuildWidget.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class GuildWidget { - [JsonProperty("enabled")] + [JsonPropertyName("enabled")] public bool Enabled { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong? ChannelId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InstallParams.cs b/src/Discord.Net.Rest/API/Common/InstallParams.cs index 1fb987f30..c2f96e3f7 100644 --- a/src/Discord.Net.Rest/API/Common/InstallParams.cs +++ b/src/Discord.Net.Rest/API/Common/InstallParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,9 +9,9 @@ namespace Discord.API { internal class InstallParams { - [JsonProperty("scopes")] + [JsonPropertyName("scopes")] public string[] Scopes { get; set; } - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public ulong Permission { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Integration.cs b/src/Discord.Net.Rest/API/Common/Integration.cs index 5a2b00001..ff5c2f61d 100644 --- a/src/Discord.Net.Rest/API/Common/Integration.cs +++ b/src/Discord.Net.Rest/API/Common/Integration.cs @@ -1,42 +1,42 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class Integration { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public string Type { get; set; } - [JsonProperty("enabled")] + [JsonPropertyName("enabled")] public bool Enabled { get; set; } - [JsonProperty("syncing")] + [JsonPropertyName("syncing")] public Optional Syncing { get; set; } - [JsonProperty("role_id")] + [JsonPropertyName("role_id")] public Optional RoleId { get; set; } - [JsonProperty("enable_emoticons")] + [JsonPropertyName("enable_emoticons")] public Optional EnableEmoticons { get; set; } - [JsonProperty("expire_behavior")] + [JsonPropertyName("expire_behavior")] public Optional ExpireBehavior { get; set; } - [JsonProperty("expire_grace_period")] + [JsonPropertyName("expire_grace_period")] public Optional ExpireGracePeriod { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public Optional User { get; set; } - [JsonProperty("account")] + [JsonPropertyName("account")] public Optional Account { get; set; } - [JsonProperty("synced_at")] + [JsonPropertyName("synced_at")] public Optional SyncedAt { get; set; } - [JsonProperty("subscriber_count")] + [JsonPropertyName("subscriber_count")] public Optional SubscriberAccount { get; set; } - [JsonProperty("revoked")] + [JsonPropertyName("revoked")] public Optional Revoked { get; set; } - [JsonProperty("application")] + [JsonPropertyName("application")] public Optional Application { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/IntegrationAccount.cs b/src/Discord.Net.Rest/API/Common/IntegrationAccount.cs index 6b8328074..b61cffb66 100644 --- a/src/Discord.Net.Rest/API/Common/IntegrationAccount.cs +++ b/src/Discord.Net.Rest/API/Common/IntegrationAccount.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class IntegrationAccount { - [JsonProperty("id")] + [JsonPropertyName("id")] public string Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/IntegrationApplication.cs b/src/Discord.Net.Rest/API/Common/IntegrationApplication.cs index 4e07398b8..7f3dcd4c0 100644 --- a/src/Discord.Net.Rest/API/Common/IntegrationApplication.cs +++ b/src/Discord.Net.Rest/API/Common/IntegrationApplication.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class IntegrationApplication { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("summary")] + [JsonPropertyName("summary")] public string Summary { get; set; } - [JsonProperty("bot")] + [JsonPropertyName("bot")] public Optional Bot { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Interaction.cs b/src/Discord.Net.Rest/API/Common/Interaction.cs index 1ca08a0f7..6e2ebaf5b 100644 --- a/src/Discord.Net.Rest/API/Common/Interaction.cs +++ b/src/Discord.Net.Rest/API/Common/Interaction.cs @@ -1,47 +1,47 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { [JsonConverter(typeof(Net.Converters.InteractionConverter))] internal class Interaction { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public ulong ApplicationId { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public InteractionType Type { get; set; } - [JsonProperty("data")] + [JsonPropertyName("data")] public Optional Data { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional Member { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public Optional User { get; set; } - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } - [JsonProperty("version")] + [JsonPropertyName("version")] public int Version { get; set; } - [JsonProperty("message")] + [JsonPropertyName("message")] public Optional Message { get; set; } - [JsonProperty("locale")] + [JsonPropertyName("locale")] public Optional UserLocale { get; set; } - [JsonProperty("guild_locale")] + [JsonPropertyName("guild_locale")] public Optional GuildLocale { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs b/src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs index 3685d7a99..b12ffb9e7 100644 --- a/src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs +++ b/src/Discord.Net.Rest/API/Common/InteractionCallbackData.cs @@ -1,34 +1,34 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class InteractionCallbackData { - [JsonProperty("tts")] + [JsonPropertyName("tts")] public Optional TTS { get; set; } - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("choices")] + [JsonPropertyName("choices")] public Optional Choices { get; set; } - [JsonProperty("title")] + [JsonPropertyName("title")] public Optional Title { get; set; } - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public Optional CustomId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InteractionResponse.cs b/src/Discord.Net.Rest/API/Common/InteractionResponse.cs index 93d4cd307..cc3d6c51e 100644 --- a/src/Discord.Net.Rest/API/Common/InteractionResponse.cs +++ b/src/Discord.Net.Rest/API/Common/InteractionResponse.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class InteractionResponse { - [JsonProperty("type")] + [JsonPropertyName("type")] public InteractionResponseType Type { get; set; } - [JsonProperty("data")] + [JsonPropertyName("data")] public Optional Data { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Invite.cs b/src/Discord.Net.Rest/API/Common/Invite.cs index f9d53bad6..18f22f442 100644 --- a/src/Discord.Net.Rest/API/Common/Invite.cs +++ b/src/Discord.Net.Rest/API/Common/Invite.cs @@ -1,24 +1,24 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Invite { - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } - [JsonProperty("guild")] + [JsonPropertyName("guild")] public Optional Guild { get; set; } - [JsonProperty("channel")] + [JsonPropertyName("channel")] public InviteChannel Channel { get; set; } - [JsonProperty("inviter")] + [JsonPropertyName("inviter")] public Optional Inviter { get; set; } - [JsonProperty("approximate_presence_count")] + [JsonPropertyName("approximate_presence_count")] public Optional PresenceCount { get; set; } - [JsonProperty("approximate_member_count")] + [JsonPropertyName("approximate_member_count")] public Optional MemberCount { get; set; } - [JsonProperty("target_user")] + [JsonPropertyName("target_user")] public Optional TargetUser { get; set; } - [JsonProperty("target_user_type")] + [JsonPropertyName("target_user_type")] public Optional TargetUserType { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InviteChannel.cs b/src/Discord.Net.Rest/API/Common/InviteChannel.cs index d601e65fe..85743b847 100644 --- a/src/Discord.Net.Rest/API/Common/InviteChannel.cs +++ b/src/Discord.Net.Rest/API/Common/InviteChannel.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class InviteChannel { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public int Type { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InviteGuild.cs b/src/Discord.Net.Rest/API/Common/InviteGuild.cs index f5c634e4e..84b81a64b 100644 --- a/src/Discord.Net.Rest/API/Common/InviteGuild.cs +++ b/src/Discord.Net.Rest/API/Common/InviteGuild.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class InviteGuild { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("splash_hash")] + [JsonPropertyName("splash_hash")] public string SplashHash { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InviteMetadata.cs b/src/Discord.Net.Rest/API/Common/InviteMetadata.cs index a06d06969..64b62cb59 100644 --- a/src/Discord.Net.Rest/API/Common/InviteMetadata.cs +++ b/src/Discord.Net.Rest/API/Common/InviteMetadata.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class InviteMetadata : Invite { - [JsonProperty("uses")] + [JsonPropertyName("uses")] public int Uses { get; set; } - [JsonProperty("max_uses")] + [JsonPropertyName("max_uses")] public int MaxUses { get; set; } - [JsonProperty("max_age")] + [JsonPropertyName("max_age")] public int MaxAge { get; set; } - [JsonProperty("temporary")] + [JsonPropertyName("temporary")] public bool Temporary { get; set; } - [JsonProperty("created_at")] + [JsonPropertyName("created_at")] public DateTimeOffset CreatedAt { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/InviteVanity.cs b/src/Discord.Net.Rest/API/Common/InviteVanity.cs index 412795aa6..33d03b659 100644 --- a/src/Discord.Net.Rest/API/Common/InviteVanity.cs +++ b/src/Discord.Net.Rest/API/Common/InviteVanity.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { @@ -10,13 +10,13 @@ namespace Discord.API /// /// The unique code for the invite link. /// - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } /// /// The total amount of vanity invite uses. /// - [JsonProperty("uses")] + [JsonPropertyName("uses")] public int Uses { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Message.cs b/src/Discord.Net.Rest/API/Common/Message.cs index d33a03fe5..c5a634683 100644 --- a/src/Discord.Net.Rest/API/Common/Message.cs +++ b/src/Discord.Net.Rest/API/Common/Message.cs @@ -1,66 +1,66 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class Message { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public MessageType Type { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } // ALWAYS sent on WebSocket messages - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("webhook_id")] + [JsonPropertyName("webhook_id")] public Optional WebhookId { get; set; } - [JsonProperty("author")] + [JsonPropertyName("author")] public Optional Author { get; set; } // ALWAYS sent on WebSocket messages - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional Member { get; set; } - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("timestamp")] + [JsonPropertyName("timestamp")] public Optional Timestamp { get; set; } - [JsonProperty("edited_timestamp")] + [JsonPropertyName("edited_timestamp")] public Optional EditedTimestamp { get; set; } - [JsonProperty("tts")] + [JsonPropertyName("tts")] public Optional IsTextToSpeech { get; set; } - [JsonProperty("mention_everyone")] + [JsonPropertyName("mention_everyone")] public Optional MentionEveryone { get; set; } - [JsonProperty("mentions")] + [JsonPropertyName("mentions")] public Optional UserMentions { get; set; } - [JsonProperty("mention_roles")] + [JsonPropertyName("mention_roles")] public Optional RoleMentions { get; set; } - [JsonProperty("attachments")] + [JsonPropertyName("attachments")] public Optional Attachments { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("pinned")] + [JsonPropertyName("pinned")] public Optional Pinned { get; set; } - [JsonProperty("reactions")] + [JsonPropertyName("reactions")] public Optional Reactions { get; set; } // sent with Rich Presence-related chat embeds - [JsonProperty("activity")] + [JsonPropertyName("activity")] public Optional Activity { get; set; } // sent with Rich Presence-related chat embeds - [JsonProperty("application")] + [JsonPropertyName("application")] public Optional Application { get; set; } - [JsonProperty("message_reference")] + [JsonPropertyName("message_reference")] public Optional Reference { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("referenced_message")] + [JsonPropertyName("referenced_message")] public Optional ReferencedMessage { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } public Optional Interaction { get; set; } - [JsonProperty("sticker_items")] + [JsonPropertyName("sticker_items")] public Optional StickerItems { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/MessageActivity.cs b/src/Discord.Net.Rest/API/Common/MessageActivity.cs index 701f6fc03..deb30818f 100644 --- a/src/Discord.Net.Rest/API/Common/MessageActivity.cs +++ b/src/Discord.Net.Rest/API/Common/MessageActivity.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,9 +9,9 @@ namespace Discord.API { public class MessageActivity { - [JsonProperty("type")] + [JsonPropertyName("type")] public Optional Type { get; set; } - [JsonProperty("party_id")] + [JsonPropertyName("party_id")] public Optional PartyId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/MessageApplication.cs b/src/Discord.Net.Rest/API/Common/MessageApplication.cs index 7302185ad..a0bfa5801 100644 --- a/src/Discord.Net.Rest/API/Common/MessageApplication.cs +++ b/src/Discord.Net.Rest/API/Common/MessageApplication.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -12,27 +12,27 @@ namespace Discord.API /// /// Gets the snowflake ID of the application. /// - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } /// /// Gets the ID of the embed's image asset. /// - [JsonProperty("cover_image")] + [JsonPropertyName("cover_image")] public string CoverImage { get; set; } /// /// Gets the application's description. /// - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } /// /// Gets the ID of the application's icon. /// - [JsonProperty("icon")] + [JsonPropertyName("icon")] public string Icon { get; set; } /// /// Gets the name of the application. /// - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs b/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs index 4633fc25a..e5c1d4a23 100644 --- a/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class MessageComponentInteractionData : IDiscordInteractionData { - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public string CustomId { get; set; } - [JsonProperty("component_type")] + [JsonPropertyName("component_type")] public ComponentType ComponentType { get; set; } - [JsonProperty("values")] + [JsonPropertyName("values")] public Optional Values { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public Optional Value { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/MessageInteraction.cs b/src/Discord.Net.Rest/API/Common/MessageInteraction.cs index 48f278396..500c0b2da 100644 --- a/src/Discord.Net.Rest/API/Common/MessageInteraction.cs +++ b/src/Discord.Net.Rest/API/Common/MessageInteraction.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,13 +9,13 @@ namespace Discord.API { internal class MessageInteraction { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public InteractionType Type { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/MessageReference.cs b/src/Discord.Net.Rest/API/Common/MessageReference.cs index 70ef4e678..d16b06e4a 100644 --- a/src/Discord.Net.Rest/API/Common/MessageReference.cs +++ b/src/Discord.Net.Rest/API/Common/MessageReference.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class MessageReference { - [JsonProperty("message_id")] + [JsonPropertyName("message_id")] public Optional MessageId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } // Optional when sending, always present when receiving - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("fail_if_not_exists")] + [JsonPropertyName("fail_if_not_exists")] public Optional FailIfNotExists { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ModalInteractionData.cs b/src/Discord.Net.Rest/API/Common/ModalInteractionData.cs index 182fa53b2..9b11498f9 100644 --- a/src/Discord.Net.Rest/API/Common/ModalInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/ModalInteractionData.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ModalInteractionData : IDiscordInteractionData { - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public string CustomId { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public API.ActionRowComponent[] Components { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs b/src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs index cc2f0d963..5c8f7ba79 100644 --- a/src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs +++ b/src/Discord.Net.Rest/API/Common/NitroStickerPacks.cs @@ -1,11 +1,11 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API { internal class NitroStickerPacks { - [JsonProperty("sticker_packs")] + [JsonPropertyName("sticker_packs")] public List StickerPacks { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Overwrite.cs b/src/Discord.Net.Rest/API/Common/Overwrite.cs index a1fb534d8..da2c737cb 100644 --- a/src/Discord.Net.Rest/API/Common/Overwrite.cs +++ b/src/Discord.Net.Rest/API/Common/Overwrite.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Overwrite { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong TargetId { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public PermissionTarget TargetType { get; set; } - [JsonProperty("deny"), Int53] + [JsonPropertyName("deny"), Int53] public string Deny { get; set; } - [JsonProperty("allow"), Int53] + [JsonPropertyName("allow"), Int53] public string Allow { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Presence.cs b/src/Discord.Net.Rest/API/Common/Presence.cs index 23f871ae6..a12d9c8c6 100644 --- a/src/Discord.Net.Rest/API/Common/Presence.cs +++ b/src/Discord.Net.Rest/API/Common/Presence.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; @@ -6,27 +6,27 @@ namespace Discord.API { internal class Presence { - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("status")] + [JsonPropertyName("status")] public UserStatus Status { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional Roles { get; set; } - [JsonProperty("nick")] + [JsonPropertyName("nick")] public Optional Nick { get; set; } // This property is a Dictionary where each key is the ClientType // and the values are the current client status. // The client status values are all the same. // Example: // "client_status": { "desktop": "dnd", "mobile": "dnd" } - [JsonProperty("client_status")] + [JsonPropertyName("client_status")] public Optional> ClientStatus { get; set; } - [JsonProperty("activities")] + [JsonPropertyName("activities")] public List Activities { get; set; } - [JsonProperty("premium_since")] + [JsonPropertyName("premium_since")] public Optional PremiumSince { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs b/src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs index 145288e5d..89ff63552 100644 --- a/src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs +++ b/src/Discord.Net.Rest/API/Common/PropertyErrorDescription.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,9 +9,9 @@ namespace Discord.API { internal class ErrorDetails { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("errors")] + [JsonPropertyName("errors")] public Error[] Errors { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Ratelimit.cs b/src/Discord.Net.Rest/API/Common/Ratelimit.cs index a7320cbe1..22de2ddfe 100644 --- a/src/Discord.Net.Rest/API/Common/Ratelimit.cs +++ b/src/Discord.Net.Rest/API/Common/Ratelimit.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,13 +9,13 @@ namespace Discord.API { internal class Ratelimit { - [JsonProperty("global")] + [JsonPropertyName("global")] public bool Global { get; set; } - [JsonProperty("message")] + [JsonPropertyName("message")] public string Message { get; set; } - [JsonProperty("retry_after")] + [JsonPropertyName("retry_after")] public double RetryAfter { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Reaction.cs b/src/Discord.Net.Rest/API/Common/Reaction.cs index 4d368ab2d..ea66008ac 100644 --- a/src/Discord.Net.Rest/API/Common/Reaction.cs +++ b/src/Discord.Net.Rest/API/Common/Reaction.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Reaction { - [JsonProperty("count")] + [JsonPropertyName("count")] public int Count { get; set; } - [JsonProperty("me")] + [JsonPropertyName("me")] public bool Me { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Emoji Emoji { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/ReadState.cs b/src/Discord.Net.Rest/API/Common/ReadState.cs index 9a66880c6..1342a02b8 100644 --- a/src/Discord.Net.Rest/API/Common/ReadState.cs +++ b/src/Discord.Net.Rest/API/Common/ReadState.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class ReadState { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("mention_count")] + [JsonPropertyName("mention_count")] public int MentionCount { get; set; } - [JsonProperty("last_message_id")] + [JsonPropertyName("last_message_id")] public Optional LastMessageId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Relationship.cs b/src/Discord.Net.Rest/API/Common/Relationship.cs index d17f766af..fccb37438 100644 --- a/src/Discord.Net.Rest/API/Common/Relationship.cs +++ b/src/Discord.Net.Rest/API/Common/Relationship.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Relationship { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public RelationshipType Type { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Role.cs b/src/Discord.Net.Rest/API/Common/Role.cs index 81f54ccc0..560f3bbeb 100644 --- a/src/Discord.Net.Rest/API/Common/Role.cs +++ b/src/Discord.Net.Rest/API/Common/Role.cs @@ -1,30 +1,30 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Role { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } - [JsonProperty("unicode_emoji")] + [JsonPropertyName("unicode_emoji")] public Optional Emoji { get; set; } - [JsonProperty("color")] + [JsonPropertyName("color")] public uint Color { get; set; } - [JsonProperty("hoist")] + [JsonPropertyName("hoist")] public bool Hoist { get; set; } - [JsonProperty("mentionable")] + [JsonPropertyName("mentionable")] public bool Mentionable { get; set; } - [JsonProperty("position")] + [JsonPropertyName("position")] public int Position { get; set; } - [JsonProperty("permissions"), Int53] + [JsonPropertyName("permissions"), Int53] public string Permissions { get; set; } - [JsonProperty("managed")] + [JsonPropertyName("managed")] public bool Managed { get; set; } - [JsonProperty("tags")] + [JsonPropertyName("tags")] public Optional Tags { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/RoleTags.cs b/src/Discord.Net.Rest/API/Common/RoleTags.cs index 9ddd39a64..18d67659f 100644 --- a/src/Discord.Net.Rest/API/Common/RoleTags.cs +++ b/src/Discord.Net.Rest/API/Common/RoleTags.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class RoleTags { - [JsonProperty("bot_id")] + [JsonPropertyName("bot_id")] public Optional BotId { get; set; } - [JsonProperty("integration_id")] + [JsonPropertyName("integration_id")] public Optional IntegrationId { get; set; } - [JsonProperty("premium_subscriber")] + [JsonPropertyName("premium_subscriber")] public Optional IsPremiumSubscriber { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs index 25ac476c5..ab83fbd29 100644 --- a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs @@ -1,32 +1,32 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Linq; namespace Discord.API { internal class SelectMenuComponent : IMessageComponent { - [JsonProperty("type")] + [JsonPropertyName("type")] public ComponentType Type { get; set; } - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public string CustomId { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public SelectMenuOption[] Options { get; set; } - [JsonProperty("placeholder")] + [JsonPropertyName("placeholder")] public Optional Placeholder { get; set; } - [JsonProperty("min_values")] + [JsonPropertyName("min_values")] public int MinValues { get; set; } - [JsonProperty("max_values")] + [JsonPropertyName("max_values")] public int MaxValues { get; set; } - [JsonProperty("disabled")] + [JsonPropertyName("disabled")] public bool Disabled { get; set; } - [JsonProperty("values")] + [JsonPropertyName("values")] public Optional Values { get; set; } public SelectMenuComponent() { } diff --git a/src/Discord.Net.Rest/API/Common/SelectMenuOption.cs b/src/Discord.Net.Rest/API/Common/SelectMenuOption.cs index d0a25a829..78b5ccbf4 100644 --- a/src/Discord.Net.Rest/API/Common/SelectMenuOption.cs +++ b/src/Discord.Net.Rest/API/Common/SelectMenuOption.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class SelectMenuOption { - [JsonProperty("label")] + [JsonPropertyName("label")] public string Label { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public string Value { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Optional Emoji { get; set; } - [JsonProperty("default")] + [JsonPropertyName("default")] public Optional Default { get; set; } public SelectMenuOption() { } diff --git a/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs b/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs index 29d5ddf85..09bc21664 100644 --- a/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs +++ b/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class SessionStartLimit { - [JsonProperty("total")] + [JsonPropertyName("total")] public int Total { get; set; } - [JsonProperty("remaining")] + [JsonPropertyName("remaining")] public int Remaining { get; set; } - [JsonProperty("reset_after")] + [JsonPropertyName("reset_after")] public int ResetAfter { get; set; } - [JsonProperty("max_concurrency")] + [JsonPropertyName("max_concurrency")] public int MaxConcurrency { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/StageInstance.cs b/src/Discord.Net.Rest/API/Common/StageInstance.cs index 3ec623949..c25689fe3 100644 --- a/src/Discord.Net.Rest/API/Common/StageInstance.cs +++ b/src/Discord.Net.Rest/API/Common/StageInstance.cs @@ -1,25 +1,25 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class StageInstance { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("topic")] + [JsonPropertyName("topic")] public string Topic { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public StagePrivacyLevel PrivacyLevel { get; set; } - [JsonProperty("discoverable_disabled")] + [JsonPropertyName("discoverable_disabled")] public bool DiscoverableDisabled { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Sticker.cs b/src/Discord.Net.Rest/API/Common/Sticker.cs index b2c58d57c..0f1adb299 100644 --- a/src/Discord.Net.Rest/API/Common/Sticker.cs +++ b/src/Discord.Net.Rest/API/Common/Sticker.cs @@ -1,30 +1,30 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Sticker { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("pack_id")] + [JsonPropertyName("pack_id")] public ulong PackId { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("tags")] + [JsonPropertyName("tags")] public Optional Tags { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public StickerType Type { get; set; } - [JsonProperty("format_type")] + [JsonPropertyName("format_type")] public StickerFormatType FormatType { get; set; } - [JsonProperty("available")] + [JsonPropertyName("available")] public bool? Available { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public Optional User { get; set; } - [JsonProperty("sort_value")] + [JsonPropertyName("sort_value")] public int? SortValue { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/StickerItem.cs b/src/Discord.Net.Rest/API/Common/StickerItem.cs index 4b24f711b..0a64153b2 100644 --- a/src/Discord.Net.Rest/API/Common/StickerItem.cs +++ b/src/Discord.Net.Rest/API/Common/StickerItem.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class StickerItem { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("format_type")] + [JsonPropertyName("format_type")] public StickerFormatType FormatType { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/StickerPack.cs b/src/Discord.Net.Rest/API/Common/StickerPack.cs index 3daaac5bf..82f1ef036 100644 --- a/src/Discord.Net.Rest/API/Common/StickerPack.cs +++ b/src/Discord.Net.Rest/API/Common/StickerPack.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class StickerPack { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("stickers")] + [JsonPropertyName("stickers")] public Sticker[] Stickers { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("sku_id")] + [JsonPropertyName("sku_id")] public ulong SkuId { get; set; } - [JsonProperty("cover_sticker_id")] + [JsonPropertyName("cover_sticker_id")] public Optional CoverStickerId { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("banner_asset_id")] + [JsonPropertyName("banner_asset_id")] public ulong BannerAssetId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Team.cs b/src/Discord.Net.Rest/API/Common/Team.cs index b421dc18c..a55ebc369 100644 --- a/src/Discord.Net.Rest/API/Common/Team.cs +++ b/src/Discord.Net.Rest/API/Common/Team.cs @@ -1,18 +1,18 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Team { - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public TeamMember[] TeamMembers { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("owner_user_id")] + [JsonPropertyName("owner_user_id")] public ulong OwnerUserId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/TeamMember.cs b/src/Discord.Net.Rest/API/Common/TeamMember.cs index f3cba608e..9b3a4e499 100644 --- a/src/Discord.Net.Rest/API/Common/TeamMember.cs +++ b/src/Discord.Net.Rest/API/Common/TeamMember.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class TeamMember { - [JsonProperty("membership_state")] + [JsonPropertyName("membership_state")] public MembershipState MembershipState { get; set; } - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public string[] Permissions { get; set; } - [JsonProperty("team_id")] + [JsonPropertyName("team_id")] public ulong TeamId { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/TextInputComponent.cs b/src/Discord.Net.Rest/API/Common/TextInputComponent.cs index a475345fc..1d04fd500 100644 --- a/src/Discord.Net.Rest/API/Common/TextInputComponent.cs +++ b/src/Discord.Net.Rest/API/Common/TextInputComponent.cs @@ -1,34 +1,34 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class TextInputComponent : IMessageComponent { - [JsonProperty("type")] + [JsonPropertyName("type")] public ComponentType Type { get; set; } - [JsonProperty("style")] + [JsonPropertyName("style")] public TextInputStyle Style { get; set; } - [JsonProperty("custom_id")] + [JsonPropertyName("custom_id")] public string CustomId { get; set; } - [JsonProperty("label")] + [JsonPropertyName("label")] public string Label { get; set; } - [JsonProperty("placeholder")] + [JsonPropertyName("placeholder")] public Optional Placeholder { get; set; } - [JsonProperty("min_length")] + [JsonPropertyName("min_length")] public Optional MinLength { get; set; } - [JsonProperty("max_length")] + [JsonPropertyName("max_length")] public Optional MaxLength { get; set; } - [JsonProperty("value")] + [JsonPropertyName("value")] public Optional Value { get; set; } - [JsonProperty("required")] + [JsonPropertyName("required")] public Optional Required { get; set; } public TextInputComponent() { } diff --git a/src/Discord.Net.Rest/API/Common/ThreadMember.cs b/src/Discord.Net.Rest/API/Common/ThreadMember.cs index 30249ee44..456757fc2 100644 --- a/src/Discord.Net.Rest/API/Common/ThreadMember.cs +++ b/src/Discord.Net.Rest/API/Common/ThreadMember.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class ThreadMember { - [JsonProperty("id")] + [JsonPropertyName("id")] public Optional Id { get; set; } - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public Optional UserId { get; set; } - [JsonProperty("join_timestamp")] + [JsonPropertyName("join_timestamp")] public DateTimeOffset JoinTimestamp { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public int Flags { get; set; } // No enum type (yet?) } } diff --git a/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs b/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs index 6735504c8..627f7b39e 100644 --- a/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs +++ b/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs @@ -1,26 +1,26 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class ThreadMetadata { - [JsonProperty("archived")] + [JsonPropertyName("archived")] public bool Archived { get; set; } - [JsonProperty("auto_archive_duration")] + [JsonPropertyName("auto_archive_duration")] public ThreadArchiveDuration AutoArchiveDuration { get; set; } - [JsonProperty("archive_timestamp")] + [JsonPropertyName("archive_timestamp")] public DateTimeOffset ArchiveTimestamp { get; set; } - [JsonProperty("locked")] + [JsonPropertyName("locked")] public Optional Locked { get; set; } - [JsonProperty("invitable")] + [JsonPropertyName("invitable")] public Optional Invitable { get; set; } - [JsonProperty("create_timestamp")] + [JsonPropertyName("create_timestamp")] public Optional CreatedAt { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/User.cs b/src/Discord.Net.Rest/API/Common/User.cs index 08fe88cb0..7bdb5e736 100644 --- a/src/Discord.Net.Rest/API/Common/User.cs +++ b/src/Discord.Net.Rest/API/Common/User.cs @@ -1,38 +1,38 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class User { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("username")] + [JsonPropertyName("username")] public Optional Username { get; set; } - [JsonProperty("discriminator")] + [JsonPropertyName("discriminator")] public Optional Discriminator { get; set; } - [JsonProperty("bot")] + [JsonPropertyName("bot")] public Optional Bot { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } - [JsonProperty("banner")] + [JsonPropertyName("banner")] public Optional Banner { get; set; } - [JsonProperty("accent_color")] + [JsonPropertyName("accent_color")] public Optional AccentColor { get; set; } //CurrentUser - [JsonProperty("verified")] + [JsonPropertyName("verified")] public Optional Verified { get; set; } - [JsonProperty("email")] + [JsonPropertyName("email")] public Optional Email { get; set; } - [JsonProperty("mfa_enabled")] + [JsonPropertyName("mfa_enabled")] public Optional MfaEnabled { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } - [JsonProperty("premium_type")] + [JsonPropertyName("premium_type")] public Optional PremiumType { get; set; } - [JsonProperty("locale")] + [JsonPropertyName("locale")] public Optional Locale { get; set; } - [JsonProperty("public_flags")] + [JsonPropertyName("public_flags")] public Optional PublicFlags { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/UserGuild.cs b/src/Discord.Net.Rest/API/Common/UserGuild.cs index fc1fe833d..89d60b163 100644 --- a/src/Discord.Net.Rest/API/Common/UserGuild.cs +++ b/src/Discord.Net.Rest/API/Common/UserGuild.cs @@ -1,18 +1,18 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class UserGuild { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public string Icon { get; set; } - [JsonProperty("owner")] + [JsonPropertyName("owner")] public bool Owner { get; set; } - [JsonProperty("permissions"), Int53] + [JsonPropertyName("permissions"), Int53] public string Permissions { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/VoiceRegion.cs b/src/Discord.Net.Rest/API/Common/VoiceRegion.cs index 3cc66a0ef..24e6323c8 100644 --- a/src/Discord.Net.Rest/API/Common/VoiceRegion.cs +++ b/src/Discord.Net.Rest/API/Common/VoiceRegion.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class VoiceRegion { - [JsonProperty("id")] + [JsonPropertyName("id")] public string Id { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("vip")] + [JsonPropertyName("vip")] public bool IsVip { get; set; } - [JsonProperty("optimal")] + [JsonPropertyName("optimal")] public bool IsOptimal { get; set; } - [JsonProperty("deprecated")] + [JsonPropertyName("deprecated")] public bool IsDeprecated { get; set; } - [JsonProperty("custom")] + [JsonPropertyName("custom")] public bool IsCustom { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/VoiceState.cs b/src/Discord.Net.Rest/API/Common/VoiceState.cs index adfa7f20e..6435800f0 100644 --- a/src/Discord.Net.Rest/API/Common/VoiceState.cs +++ b/src/Discord.Net.Rest/API/Common/VoiceState.cs @@ -1,36 +1,36 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API { internal class VoiceState { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong? GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong? ChannelId { get; set; } - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } // ALWAYS sent over WebSocket, never on REST - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional Member { get; set; } - [JsonProperty("session_id")] + [JsonPropertyName("session_id")] public string SessionId { get; set; } - [JsonProperty("deaf")] + [JsonPropertyName("deaf")] public bool Deaf { get; set; } - [JsonProperty("mute")] + [JsonPropertyName("mute")] public bool Mute { get; set; } - [JsonProperty("self_deaf")] + [JsonPropertyName("self_deaf")] public bool SelfDeaf { get; set; } - [JsonProperty("self_mute")] + [JsonPropertyName("self_mute")] public bool SelfMute { get; set; } - [JsonProperty("suppress")] + [JsonPropertyName("suppress")] public bool Suppress { get; set; } - [JsonProperty("self_stream")] + [JsonPropertyName("self_stream")] public bool SelfStream { get; set; } - [JsonProperty("self_video")] + [JsonPropertyName("self_video")] public bool SelfVideo { get; set; } - [JsonProperty("request_to_speak_timestamp")] + [JsonPropertyName("request_to_speak_timestamp")] public Optional RequestToSpeakTimestamp { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Common/Webhook.cs b/src/Discord.Net.Rest/API/Common/Webhook.cs index 23b682bd3..386cc0110 100644 --- a/src/Discord.Net.Rest/API/Common/Webhook.cs +++ b/src/Discord.Net.Rest/API/Common/Webhook.cs @@ -1,26 +1,26 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class Webhook { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public Optional Creator { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public ulong? ApplicationId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs b/src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs index ef6229edb..6e3e41b09 100644 --- a/src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs +++ b/src/Discord.Net.Rest/API/Rest/AddGuildMemberParams.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class AddGuildMemberParams { - [JsonProperty("access_token")] + [JsonPropertyName("access_token")] public string AccessToken { get; set; } - [JsonProperty("nick")] + [JsonPropertyName("nick")] public Optional Nickname { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional RoleIds { get; set; } - [JsonProperty("mute")] + [JsonPropertyName("mute")] public Optional IsMuted { get; set; } - [JsonProperty("deaf")] + [JsonPropertyName("deaf")] public Optional IsDeafened { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs b/src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs index 2257d4b97..4abd8c350 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateApplicationCommandParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; @@ -8,31 +8,31 @@ namespace Discord.API.Rest { internal class CreateApplicationCommandParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ApplicationCommandType Type { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public string Description { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("default_permission")] + [JsonPropertyName("default_permission")] public Optional DefaultPermission { get; set; } - [JsonProperty("name_localizations")] + [JsonPropertyName("name_localizations")] public Optional> NameLocalizations { get; set; } - [JsonProperty("description_localizations")] + [JsonPropertyName("description_localizations")] public Optional> DescriptionLocalizations { get; set; } - [JsonProperty("dm_permission")] + [JsonPropertyName("dm_permission")] public Optional DmPermission { get; set; } - [JsonProperty("default_member_permissions")] + [JsonPropertyName("default_member_permissions")] public Optional DefaultMemberPermission { get; set; } public CreateApplicationCommandParams() { } diff --git a/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs b/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs index 852abe301..3524f7919 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs @@ -1,23 +1,23 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateChannelInviteParams { - [JsonProperty("max_age")] + [JsonPropertyName("max_age")] public Optional MaxAge { get; set; } - [JsonProperty("max_uses")] + [JsonPropertyName("max_uses")] public Optional MaxUses { get; set; } - [JsonProperty("temporary")] + [JsonPropertyName("temporary")] public Optional IsTemporary { get; set; } - [JsonProperty("unique")] + [JsonPropertyName("unique")] public Optional IsUnique { get; set; } - [JsonProperty("target_type")] + [JsonPropertyName("target_type")] public Optional TargetType { get; set; } - [JsonProperty("target_user_id")] + [JsonPropertyName("target_user_id")] public Optional TargetUserId { get; set; } - [JsonProperty("target_application_id")] + [JsonPropertyName("target_application_id")] public Optional TargetApplicationId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs b/src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs index 0a710dd1b..5b6a141ca 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs @@ -1,11 +1,11 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateDMChannelParams { - [JsonProperty("recipient_id")] + [JsonPropertyName("recipient_id")] public ulong RecipientId { get; } public CreateDMChannelParams(ulong recipientId) diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs index 57816e448..21b25f7c8 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs @@ -1,33 +1,33 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateGuildChannelParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ChannelType Type { get; } - [JsonProperty("parent_id")] + [JsonPropertyName("parent_id")] public Optional CategoryId { get; set; } - [JsonProperty("position")] + [JsonPropertyName("position")] public Optional Position { get; set; } - [JsonProperty("permission_overwrites")] + [JsonPropertyName("permission_overwrites")] public Optional Overwrites { get; set; } //Text channels - [JsonProperty("topic")] + [JsonPropertyName("topic")] public Optional Topic { get; set; } - [JsonProperty("nsfw")] + [JsonPropertyName("nsfw")] public Optional IsNsfw { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional SlowModeInterval { get; set; } //Voice channels - [JsonProperty("bitrate")] + [JsonPropertyName("bitrate")] public Optional Bitrate { get; set; } - [JsonProperty("user_limit")] + [JsonPropertyName("user_limit")] public Optional UserLimit { get; set; } public CreateGuildChannelParams(string name, ChannelType type) diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs index c81f62f4c..9582895c4 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildEmoteParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateGuildEmoteParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("image")] + [JsonPropertyName("image")] public Image Image { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional RoleIds { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildIntegrationParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildIntegrationParams.cs index 7358e5201..22aff5b25 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildIntegrationParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildIntegrationParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateGuildIntegrationParams { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; } - [JsonProperty("type")] + [JsonPropertyName("type")] public string Type { get; } public CreateGuildIntegrationParams(ulong id, string type) diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs index e89c2b119..1b261785f 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateGuildParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; } - [JsonProperty("region")] + [JsonPropertyName("region")] public string RegionId { get; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } public CreateGuildParams(string name, string regionId) diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildScheduledEventParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildScheduledEventParams.cs index 2ccd06fe6..6f87f9b91 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildScheduledEventParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildScheduledEventParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,23 +9,23 @@ namespace Discord.API.Rest { internal class CreateGuildScheduledEventParams { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } - [JsonProperty("entity_metadata")] + [JsonPropertyName("entity_metadata")] public Optional EntityMetadata { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public GuildScheduledEventPrivacyLevel PrivacyLevel { get; set; } - [JsonProperty("scheduled_start_time")] + [JsonPropertyName("scheduled_start_time")] public DateTimeOffset StartTime { get; set; } - [JsonProperty("scheduled_end_time")] + [JsonPropertyName("scheduled_end_time")] public Optional EndTime { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("entity_type")] + [JsonPropertyName("entity_type")] public GuildScheduledEventType Type { get; set; } - [JsonProperty("image")] + [JsonPropertyName("image")] public Optional Image { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs index 466ad41e3..5bac170c1 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs @@ -1,35 +1,35 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateMessageParams { - [JsonProperty("content")] + [JsonPropertyName("content")] public string Content { get; } - [JsonProperty("nonce")] + [JsonPropertyName("nonce")] public Optional Nonce { get; set; } - [JsonProperty("tts")] + [JsonPropertyName("tts")] public Optional IsTTS { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("message_reference")] + [JsonPropertyName("message_reference")] public Optional MessageReference { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("sticker_ids")] + [JsonPropertyName("sticker_ids")] public Optional Stickers { get; set; } - - [JsonProperty("flags")] + + [JsonPropertyName("flags")] public Optional Flags { get; set; } public CreateMessageParams(string content) diff --git a/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs b/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs index 0c8bc5494..7c34fd9fd 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateMultipartPostAsync.cs @@ -1,6 +1,6 @@ using Discord.Net.Converters; using Discord.Net.Rest; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.IO; diff --git a/src/Discord.Net.Rest/API/Rest/CreatePostParams.cs b/src/Discord.Net.Rest/API/Rest/CreatePostParams.cs index 974e07c0a..702183fdd 100644 --- a/src/Discord.Net.Rest/API/Rest/CreatePostParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreatePostParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -10,16 +10,16 @@ namespace Discord.API.Rest internal class CreatePostParams { // thread - [JsonProperty("name")] + [JsonPropertyName("name")] public string Title { get; set; } - [JsonProperty("auto_archive_duration")] + [JsonPropertyName("auto_archive_duration")] public ThreadArchiveDuration ArchiveDuration { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional Slowmode { get; set; } - [JsonProperty("message")] + [JsonPropertyName("message")] public ForumThreadMessage Message { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateStageInstanceParams.cs b/src/Discord.Net.Rest/API/Rest/CreateStageInstanceParams.cs index a1d59bb51..eda263ffd 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateStageInstanceParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateStageInstanceParams.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class CreateStageInstanceParams { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("topic")] + [JsonPropertyName("topic")] public string Topic { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public Optional PrivacyLevel { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs b/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs index ef0e0dd1d..cb648b50e 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs @@ -1,6 +1,6 @@ using Discord.Net.Converters; using Discord.Net.Rest; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; using System.IO; using System.Text; @@ -12,34 +12,34 @@ namespace Discord.API.Rest { private static JsonSerializer _serializer = new JsonSerializer { ContractResolver = new DiscordContractResolver() }; - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("nonce")] + [JsonPropertyName("nonce")] public Optional Nonce { get; set; } - [JsonProperty("tts")] + [JsonPropertyName("tts")] public Optional IsTTS { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("username")] + [JsonPropertyName("username")] public Optional Username { get; set; } - [JsonProperty("avatar_url")] + [JsonPropertyName("avatar_url")] public Optional AvatarUrl { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("file")] + [JsonPropertyName("file")] public Optional File { get; set; } public IReadOnlyDictionary ToDictionary() diff --git a/src/Discord.Net.Rest/API/Rest/CreateWebhookParams.cs b/src/Discord.Net.Rest/API/Rest/CreateWebhookParams.cs index 242f451cb..57212b314 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateWebhookParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateWebhookParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class CreateWebhookParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs b/src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs index ca6b78406..86bf11b28 100644 --- a/src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs +++ b/src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs @@ -1,11 +1,11 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class DeleteMessagesParams { - [JsonProperty("messages")] + [JsonPropertyName("messages")] public ulong[] MessageIds { get; } public DeleteMessagesParams(ulong[] messageIds) diff --git a/src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs b/src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs index 3f8318cd1..16a8bfe66 100644 --- a/src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs +++ b/src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class GetBotGatewayResponse { - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } - [JsonProperty("shards")] + [JsonPropertyName("shards")] public int Shards { get; set; } - [JsonProperty("session_start_limit")] + [JsonPropertyName("session_start_limit")] public SessionStartLimit SessionStartLimit { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs b/src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs index 11207633d..046740ff5 100644 --- a/src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs +++ b/src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class GetGatewayResponse { - [JsonProperty("url")] + [JsonPropertyName("url")] public string Url { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs b/src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs index 1e7fc8c7b..9ac6cda7e 100644 --- a/src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs +++ b/src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class GetGuildPruneCountResponse { - [JsonProperty("pruned")] + [JsonPropertyName("pruned")] public int Pruned { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs b/src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs index c6caa1eb1..5ad58b009 100644 --- a/src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs +++ b/src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class GuildPruneParams { - [JsonProperty("days")] + [JsonPropertyName("days")] public int Days { get; } - [JsonProperty("include_roles")] + [JsonPropertyName("include_roles")] public ulong[] IncludeRoleIds { get; } public GuildPruneParams(int days, ulong[] includeRoleIds) diff --git a/src/Discord.Net.Rest/API/Rest/ModifyApplicationCommandParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyApplicationCommandParams.cs index f49a3f33d..68ad16250 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyApplicationCommandParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyApplicationCommandParams.cs @@ -1,26 +1,26 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API.Rest { internal class ModifyApplicationCommandParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("options")] + [JsonPropertyName("options")] public Optional Options { get; set; } - [JsonProperty("default_permission")] + [JsonPropertyName("default_permission")] public Optional DefaultPermission { get; set; } - [JsonProperty("name_localizations")] + [JsonPropertyName("name_localizations")] public Optional> NameLocalizations { get; set; } - [JsonProperty("description_localizations")] + [JsonPropertyName("description_localizations")] public Optional> DescriptionLocalizations { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyChannelPermissionsParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyChannelPermissionsParams.cs index acb81034a..98933a480 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyChannelPermissionsParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyChannelPermissionsParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyChannelPermissionsParams { - [JsonProperty("type")] + [JsonPropertyName("type")] public int Type { get; } - [JsonProperty("allow")] + [JsonPropertyName("allow")] public string Allow { get; } - [JsonProperty("deny")] + [JsonPropertyName("deny")] public string Deny { get; } public ModifyChannelPermissionsParams(int type, string allow, string deny) diff --git a/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs index c10f2e4ec..07b7921e5 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs @@ -1,11 +1,11 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyCurrentUserNickParams { - [JsonProperty("nick")] + [JsonPropertyName("nick")] public string Nickname { get; } public ModifyCurrentUserNickParams(string nickname) diff --git a/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs index e28deb32b..5d61e885f 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyCurrentUserParams { - [JsonProperty("username")] + [JsonPropertyName("username")] public Optional Username { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissions.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissions.cs index a557061f3..d82873a04 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissions.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissions.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyGuildApplicationCommandPermissions { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public ApplicationCommandPermissions[] Permissions { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissionsParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissionsParams.cs index 322875b8e..ed34aea3b 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissionsParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildApplicationCommandPermissionsParams.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyGuildApplicationCommandPermissionsParams { - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public ApplicationCommandPermissions[] Permissions { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs index dfe9cd980..94666ea36 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildChannelParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("position")] + [JsonPropertyName("position")] public Optional Position { get; set; } - [JsonProperty("parent_id")] + [JsonPropertyName("parent_id")] public Optional CategoryId { get; set; } - [JsonProperty("permission_overwrites")] + [JsonPropertyName("permission_overwrites")] public Optional Overwrites { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs index 91567be3d..9d37d1285 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildChannelsParams { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; } - [JsonProperty("position")] + [JsonPropertyName("position")] public int Position { get; } public ModifyGuildChannelsParams(ulong id, int position) diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs index 420bdbeaf..a9a2b6ca2 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildEmbedParams - { - [JsonProperty("enabled")] + { + [JsonPropertyName("enabled")] public Optional Enabled { get; set; } - [JsonProperty("channel")] + [JsonPropertyName("channel")] public Optional ChannelId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildEmoteParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildEmoteParams.cs index 08b196daa..fa1e05146 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildEmoteParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildEmoteParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildEmoteParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional RoleIds { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildIntegrationParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildIntegrationParams.cs index cf869c838..3af0f25f8 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildIntegrationParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildIntegrationParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildIntegrationParams { - [JsonProperty("expire_behavior")] + [JsonPropertyName("expire_behavior")] public Optional ExpireBehavior { get; set; } - [JsonProperty("expire_grace_period")] + [JsonPropertyName("expire_grace_period")] public Optional ExpireGracePeriod { get; set; } - [JsonProperty("enable_emoticons")] + [JsonPropertyName("enable_emoticons")] public Optional EnableEmoticons { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs index eb7c944d1..91b3f1aac 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Rest @@ -6,17 +6,17 @@ namespace Discord.API.Rest [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildMemberParams { - [JsonProperty("mute")] + [JsonPropertyName("mute")] public Optional Mute { get; set; } - [JsonProperty("deaf")] + [JsonPropertyName("deaf")] public Optional Deaf { get; set; } - [JsonProperty("nick")] + [JsonPropertyName("nick")] public Optional Nickname { get; set; } - [JsonProperty("roles")] + [JsonPropertyName("roles")] public Optional RoleIds { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } - [JsonProperty("communication_disabled_until")] + [JsonPropertyName("communication_disabled_until")] public Optional TimedOutUntil { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs index c1a20cb83..1fb1eb0e3 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs @@ -1,41 +1,41 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildParams { - [JsonProperty("username")] + [JsonPropertyName("username")] public Optional Username { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("region")] + [JsonPropertyName("region")] public Optional RegionId { get; set; } - [JsonProperty("verification_level")] + [JsonPropertyName("verification_level")] public Optional VerificationLevel { get; set; } - [JsonProperty("default_message_notifications")] + [JsonPropertyName("default_message_notifications")] public Optional DefaultMessageNotifications { get; set; } - [JsonProperty("afk_timeout")] + [JsonPropertyName("afk_timeout")] public Optional AfkTimeout { get; set; } - [JsonProperty("system_channel_id")] + [JsonPropertyName("system_channel_id")] public Optional SystemChannelId { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } - [JsonProperty("banner")] + [JsonPropertyName("banner")] public Optional Banner { get; set; } - [JsonProperty("splash")] + [JsonPropertyName("splash")] public Optional Splash { get; set; } - [JsonProperty("afk_channel_id")] + [JsonPropertyName("afk_channel_id")] public Optional AfkChannelId { get; set; } - [JsonProperty("owner_id")] + [JsonPropertyName("owner_id")] public Optional OwnerId { get; set; } - [JsonProperty("explicit_content_filter")] + [JsonPropertyName("explicit_content_filter")] public Optional ExplicitContentFilter { get; set; } - [JsonProperty("system_channel_flags")] + [JsonPropertyName("system_channel_flags")] public Optional SystemChannelFlags { get; set; } - [JsonProperty("preferred_locale")] + [JsonPropertyName("preferred_locale")] public string PreferredLocale { get; set; } - [JsonProperty("premium_progress_bar_enabled")] + [JsonPropertyName("premium_progress_bar_enabled")] public Optional IsBoostProgressBarEnabled { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs index 8aa92d40d..2240ecbcf 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs @@ -1,23 +1,23 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildRoleParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("permissions")] + [JsonPropertyName("permissions")] public Optional Permissions { get; set; } - [JsonProperty("color")] + [JsonPropertyName("color")] public Optional Color { get; set; } - [JsonProperty("hoist")] + [JsonPropertyName("hoist")] public Optional Hoist { get; set; } - [JsonProperty("icon")] + [JsonPropertyName("icon")] public Optional Icon { get; set; } - [JsonProperty("unicode_emoji")] + [JsonPropertyName("unicode_emoji")] public Optional Emoji { get; set; } - [JsonProperty("mentionable")] + [JsonPropertyName("mentionable")] public Optional Mentionable { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs index eeb724523..ac6067212 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildRolesParams : ModifyGuildRoleParams { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; } - [JsonProperty("position")] + [JsonPropertyName("position")] public int Position { get; } public ModifyGuildRolesParams(ulong id, int position) diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildScheduledEventParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildScheduledEventParams.cs index 1179ddcbe..694838ea6 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildScheduledEventParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildScheduledEventParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,25 +9,25 @@ namespace Discord.API.Rest { internal class ModifyGuildScheduledEventParams { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } - [JsonProperty("entity_metadata")] + [JsonPropertyName("entity_metadata")] public Optional EntityMetadata { get; set; } - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public Optional PrivacyLevel { get; set; } - [JsonProperty("scheduled_start_time")] + [JsonPropertyName("scheduled_start_time")] public Optional StartTime { get; set; } - [JsonProperty("scheduled_end_time")] + [JsonPropertyName("scheduled_end_time")] public Optional EndTime { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("entity_type")] + [JsonPropertyName("entity_type")] public Optional Type { get; set; } - [JsonProperty("status")] + [JsonPropertyName("status")] public Optional Status { get; set; } - [JsonProperty("image")] + [JsonPropertyName("image")] public Optional Image { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyGuildWidgetParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyGuildWidgetParams.cs index 2e5658d51..b31059e71 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyGuildWidgetParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyGuildWidgetParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyGuildWidgetParams - { - [JsonProperty("enabled")] + { + [JsonPropertyName("enabled")] public Optional Enabled { get; set; } - [JsonProperty("channel")] + [JsonPropertyName("channel")] public Optional ChannelId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyInteractionResponseParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyInteractionResponseParams.cs index a2c7cbee6..b3e289888 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyInteractionResponseParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyInteractionResponseParams.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyInteractionResponseParams { - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs index 3dba45a5b..15ae769d5 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyMessageParams { - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public Optional Flags { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyStageInstanceParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyStageInstanceParams.cs index c09d8f216..e6f21add2 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyStageInstanceParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyStageInstanceParams.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyStageInstanceParams { - [JsonProperty("topic")] + [JsonPropertyName("topic")] public Optional Topic { get; set; } - [JsonProperty("privacy_level")] + [JsonPropertyName("privacy_level")] public Optional PrivacyLevel { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyStickerParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyStickerParams.cs index bd538c72e..d53bd254d 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyStickerParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyStickerParams.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyStickerParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("description")] + [JsonPropertyName("description")] public Optional Description { get; set; } - [JsonProperty("tags")] + [JsonPropertyName("tags")] public Optional Tags { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs index 409d90c3f..27b9ffac4 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyTextChannelParams : ModifyGuildChannelParams { - [JsonProperty("topic")] + [JsonPropertyName("topic")] public Optional Topic { get; set; } - [JsonProperty("nsfw")] + [JsonPropertyName("nsfw")] public Optional IsNsfw { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional SlowModeInterval { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs index 8c9216c3f..36d409ada 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyThreadParams.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class ModifyThreadParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("archived")] + [JsonPropertyName("archived")] public Optional Archived { get; set; } - [JsonProperty("auto_archive_duration")] + [JsonPropertyName("auto_archive_duration")] public Optional AutoArchiveDuration { get; set; } - [JsonProperty("locked")] + [JsonPropertyName("locked")] public Optional Locked { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional Slowmode { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs index 2f8cacc69..ed7bfeea4 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyVoiceChannelParams : ModifyGuildChannelParams { - [JsonProperty("bitrate")] + [JsonPropertyName("bitrate")] public Optional Bitrate { get; set; } - [JsonProperty("user_limit")] + [JsonPropertyName("user_limit")] public Optional UserLimit { get; set; } - [JsonProperty("rtc_region")] + [JsonPropertyName("rtc_region")] public Optional RTCRegion { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyVoiceStateParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyVoiceStateParams.cs index 1ff0f3e08..248f78cf8 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyVoiceStateParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyVoiceStateParams.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Rest { internal class ModifyVoiceStateParams { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("suppress")] + [JsonPropertyName("suppress")] public Optional Suppressed { get; set; } - [JsonProperty("request_to_speak_timestamp")] + [JsonPropertyName("request_to_speak_timestamp")] public Optional RequestToSpeakTimestamp { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyWebhookMessageParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyWebhookMessageParams.cs index e73efaf36..4e11dce15 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyWebhookMessageParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyWebhookMessageParams.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyWebhookMessageParams { - [JsonProperty("content")] + [JsonPropertyName("content")] public Optional Content { get; set; } - [JsonProperty("embeds")] + [JsonPropertyName("embeds")] public Optional Embeds { get; set; } - [JsonProperty("allowed_mentions")] + [JsonPropertyName("allowed_mentions")] public Optional AllowedMentions { get; set; } - [JsonProperty("components")] + [JsonPropertyName("components")] public Optional Components { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyWebhookParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyWebhookParams.cs index 2e4e6a4c4..223cd0a8f 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyWebhookParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyWebhookParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ModifyWebhookParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public Optional Name { get; set; } - [JsonProperty("avatar")] + [JsonPropertyName("avatar")] public Optional Avatar { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public Optional ChannelId { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/StartThreadParams.cs b/src/Discord.Net.Rest/API/Rest/StartThreadParams.cs index a13161cd4..2386d7a41 100644 --- a/src/Discord.Net.Rest/API/Rest/StartThreadParams.cs +++ b/src/Discord.Net.Rest/API/Rest/StartThreadParams.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { internal class StartThreadParams { - [JsonProperty("name")] + [JsonPropertyName("name")] public string Name { get; set; } - [JsonProperty("auto_archive_duration")] + [JsonPropertyName("auto_archive_duration")] public ThreadArchiveDuration Duration { get; set; } - [JsonProperty("type")] + [JsonPropertyName("type")] public ThreadType Type { get; set; } - [JsonProperty("invitable")] + [JsonPropertyName("invitable")] public Optional Invitable { get; set; } - [JsonProperty("rate_limit_per_user")] + [JsonPropertyName("rate_limit_per_user")] public Optional Ratelimit { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/UploadFileParams.cs b/src/Discord.Net.Rest/API/Rest/UploadFileParams.cs index b85ff646e..9d004bcc2 100644 --- a/src/Discord.Net.Rest/API/Rest/UploadFileParams.cs +++ b/src/Discord.Net.Rest/API/Rest/UploadFileParams.cs @@ -1,6 +1,6 @@ using Discord.Net.Converters; using Discord.Net.Rest; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; using System.IO; using System.Linq; @@ -32,7 +32,7 @@ namespace Discord.API.Rest public IReadOnlyDictionary ToDictionary() { var d = new Dictionary(); - + var payload = new Dictionary(); if (Content.IsSpecified) payload["content"] = Content.Value; diff --git a/src/Discord.Net.Rest/API/Rest/UploadInteractionFileParams.cs b/src/Discord.Net.Rest/API/Rest/UploadInteractionFileParams.cs index ca0f49ccb..999b02ffd 100644 --- a/src/Discord.Net.Rest/API/Rest/UploadInteractionFileParams.cs +++ b/src/Discord.Net.Rest/API/Rest/UploadInteractionFileParams.cs @@ -1,6 +1,6 @@ using Discord.Net.Converters; using Discord.Net.Rest; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.IO; @@ -41,7 +41,7 @@ namespace Discord.API.Rest public IReadOnlyDictionary ToDictionary() { var d = new Dictionary(); - + var payload = new Dictionary(); payload["type"] = Type; diff --git a/src/Discord.Net.Rest/API/Rest/UploadWebhookFileParams.cs b/src/Discord.Net.Rest/API/Rest/UploadWebhookFileParams.cs index d945d149b..abd321cf8 100644 --- a/src/Discord.Net.Rest/API/Rest/UploadWebhookFileParams.cs +++ b/src/Discord.Net.Rest/API/Rest/UploadWebhookFileParams.cs @@ -3,7 +3,7 @@ using System.IO; using System.Text; using Discord.Net.Converters; using Discord.Net.Rest; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Rest { diff --git a/src/Discord.Net.Rest/Entities/Interactions/RestInteraction.cs b/src/Discord.Net.Rest/Entities/Interactions/RestInteraction.cs index ba2de12a9..273ff6c67 100644 --- a/src/Discord.Net.Rest/Entities/Interactions/RestInteraction.cs +++ b/src/Discord.Net.Rest/Entities/Interactions/RestInteraction.cs @@ -142,13 +142,13 @@ namespace Discord.Rest GuildId = model.GuildId.IsSpecified ? model.GuildId.Value : null; - + IsDMInteraction = GuildId is null; Data = model.Data.IsSpecified ? model.Data.Value : null; - + Token = model.Token; Version = model.Version; Type = model.Type; @@ -176,7 +176,7 @@ namespace Discord.Rest User = RestUser.Create(Discord, model.User.Value); } } - + if (Channel is null && ChannelId is not null) { @@ -294,7 +294,7 @@ namespace Discord.Rest } /// public abstract string RespondWithModal(Modal modal, RequestOptions options = null); - + /// public abstract string Respond(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null); diff --git a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs index 69e038fd2..6f772cfa2 100644 --- a/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs +++ b/src/Discord.Net.Rest/Entities/Messages/RestMessage.cs @@ -1,4 +1,3 @@ -using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/Discord.Net.Rest/Net/Converters/DiscordContractResolver.cs b/src/Discord.Net.Rest/Net/Converters/DiscordContractResolver.cs index 91ba22460..0b8a8f0fc 100644 --- a/src/Discord.Net.Rest/Net/Converters/DiscordContractResolver.cs +++ b/src/Discord.Net.Rest/Net/Converters/DiscordContractResolver.cs @@ -14,7 +14,7 @@ namespace Discord.Net.Converters private static readonly TypeInfo _ienumerable = typeof(IEnumerable).GetTypeInfo(); private static readonly MethodInfo _shouldSerialize = typeof(DiscordContractResolver).GetTypeInfo().GetDeclaredMethod("ShouldSerialize"); - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + protected override JsonPropertyName CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { var property = base.CreateProperty(member, memberSerialization); if (property.Ignored) @@ -33,7 +33,7 @@ namespace Discord.Net.Converters return property; } - private static JsonConverter GetConverter(JsonProperty property, PropertyInfo propInfo, Type type, int depth) + private static JsonConverter GetConverter(JsonPropertyName property, PropertyInfo propInfo, Type type, int depth) { if (type.IsArray) return MakeGenericConverter(property, propInfo, typeof(ArrayConverter<>), type.GetElementType(), depth); @@ -107,7 +107,7 @@ namespace Discord.Net.Converters return (getter as Func>)((TOwner)owner).IsSpecified; } - private static JsonConverter MakeGenericConverter(JsonProperty property, PropertyInfo propInfo, Type converterType, Type innerType, int depth) + private static JsonConverter MakeGenericConverter(JsonPropertyName property, PropertyInfo propInfo, Type converterType, Type innerType, int depth) { var genericType = converterType.MakeGenericType(innerType).GetTypeInfo(); var innerConverter = GetConverter(property, propInfo, innerType, depth + 1); diff --git a/src/Discord.Net.WebSocket/API/Gateway/ApplicationCommandCreatedUpdatedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/ApplicationCommandCreatedUpdatedEvent.cs index 91dcbde11..85bd1daa3 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ApplicationCommandCreatedUpdatedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ApplicationCommandCreatedUpdatedEvent.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class ApplicationCommandCreatedUpdatedEvent : ApplicationCommand { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs b/src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs index 04ee38c0b..05e38d72f 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs @@ -1,35 +1,35 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Gateway { internal class ExtendedGuild : Guild { - [JsonProperty("unavailable")] + [JsonPropertyName("unavailable")] public bool? Unavailable { get; set; } - [JsonProperty("member_count")] + [JsonPropertyName("member_count")] public int MemberCount { get; set; } - [JsonProperty("large")] + [JsonPropertyName("large")] public bool Large { get; set; } - [JsonProperty("presences")] + [JsonPropertyName("presences")] public Presence[] Presences { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public GuildMember[] Members { get; set; } - [JsonProperty("channels")] + [JsonPropertyName("channels")] public Channel[] Channels { get; set; } - [JsonProperty("joined_at")] + [JsonPropertyName("joined_at")] public DateTimeOffset JoinedAt { get; set; } - [JsonProperty("threads")] + [JsonPropertyName("threads")] public new Channel[] Threads { get; set; } - [JsonProperty("guild_scheduled_events")] + [JsonPropertyName("guild_scheduled_events")] public GuildScheduledEvent[] GuildScheduledEvents { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildBanEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildBanEvent.cs index a8a72e791..c06dd5b4b 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildBanEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildBanEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildBanEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildEmojiUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildEmojiUpdateEvent.cs index 33c10e648..481b826e6 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildEmojiUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildEmojiUpdateEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildEmojiUpdateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("emojis")] + [JsonPropertyName("emojis")] public Emoji[] Emojis { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildJoinRequestDeleteEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildJoinRequestDeleteEvent.cs index cb6fc5f40..5539b36f0 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildJoinRequestDeleteEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildJoinRequestDeleteEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildJoinRequestDeleteEvent { - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberAddEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberAddEvent.cs index dd42978fc..bde86954b 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberAddEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberAddEvent.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildMemberAddEvent : GuildMember { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberRemoveEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberRemoveEvent.cs index ec7df8fd3..1107e4485 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberRemoveEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberRemoveEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildMemberRemoveEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberUpdateEvent.cs index 0f6fa6f37..46f11892f 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildMemberUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildMemberUpdateEvent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Gateway { internal class GuildMemberUpdateEvent : GuildMember { - [JsonProperty("joined_at")] + [JsonPropertyName("joined_at")] public new DateTimeOffset? JoinedAt { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildMembersChunkEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildMembersChunkEvent.cs index 26114bf54..d52a9ebbc 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildMembersChunkEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildMembersChunkEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildMembersChunkEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public GuildMember[] Members { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleCreateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleCreateEvent.cs index 3b02164d5..f08107c0e 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleCreateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleCreateEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildRoleCreateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("role")] + [JsonPropertyName("role")] public Role Role { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleDeleteEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleDeleteEvent.cs index d9bdb9892..a0aa93049 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleDeleteEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleDeleteEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildRoleDeleteEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("role_id")] + [JsonPropertyName("role_id")] public ulong RoleId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleUpdateEvent.cs index bb6a39620..f9dcd760e 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildRoleUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildRoleUpdateEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildRoleUpdateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("role")] + [JsonPropertyName("role")] public Role Role { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildScheduledEventUserAddRemoveEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildScheduledEventUserAddRemoveEvent.cs index 3fc959125..a74a5d1a7 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildScheduledEventUserAddRemoveEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildScheduledEventUserAddRemoveEvent.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,11 +9,11 @@ namespace Discord.API.Gateway { internal class GuildScheduledEventUserAddRemoveEvent { - [JsonProperty("guild_scheduled_event_id")] + [JsonPropertyName("guild_scheduled_event_id")] public ulong EventId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildStickerUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildStickerUpdateEvent.cs index f0ecd3a4f..7b9786477 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildStickerUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildStickerUpdateEvent.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildStickerUpdateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("stickers")] + [JsonPropertyName("stickers")] public Sticker[] Stickers { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/GuildSyncEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/GuildSyncEvent.cs index ba4c1ca60..0c03dd591 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/GuildSyncEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/GuildSyncEvent.cs @@ -1,17 +1,17 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class GuildSyncEvent { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("large")] + [JsonPropertyName("large")] public bool Large { get; set; } - [JsonProperty("presences")] + [JsonPropertyName("presences")] public Presence[] Presences { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public GuildMember[] Members { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/HelloEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/HelloEvent.cs index a53a96fd8..36c3338e4 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/HelloEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/HelloEvent.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class HelloEvent { - [JsonProperty("heartbeat_interval")] + [JsonPropertyName("heartbeat_interval")] public int HeartbeatInterval { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/IdentifyParams.cs b/src/Discord.Net.WebSocket/API/Gateway/IdentifyParams.cs index 96c7cb32f..59b0724c7 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/IdentifyParams.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/IdentifyParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API.Gateway @@ -6,17 +6,17 @@ namespace Discord.API.Gateway [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class IdentifyParams { - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } - [JsonProperty("properties")] + [JsonPropertyName("properties")] public IDictionary Properties { get; set; } - [JsonProperty("large_threshold")] + [JsonPropertyName("large_threshold")] public int LargeThreshold { get; set; } - [JsonProperty("shard")] + [JsonPropertyName("shard")] public Optional ShardingParams { get; set; } - [JsonProperty("presence")] + [JsonPropertyName("presence")] public Optional Presence { get; set; } - [JsonProperty("intents")] + [JsonPropertyName("intents")] public Optional Intents { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/IntegrationDeletedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/IntegrationDeletedEvent.cs index cf6e70ca6..3b50ec42a 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/IntegrationDeletedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/IntegrationDeletedEvent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class IntegrationDeletedEvent { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("application_id")] + [JsonPropertyName("application_id")] public Optional ApplicationID { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs index e2ddd8816..832748fc9 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs @@ -1,31 +1,31 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Gateway { internal class InviteCreateEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } - [JsonProperty("created_at")] + [JsonPropertyName("created_at")] public DateTimeOffset CreatedAt { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("inviter")] + [JsonPropertyName("inviter")] public Optional Inviter { get; set; } - [JsonProperty("max_age")] + [JsonPropertyName("max_age")] public int MaxAge { get; set; } - [JsonProperty("max_uses")] + [JsonPropertyName("max_uses")] public int MaxUses { get; set; } - [JsonProperty("target_user")] + [JsonPropertyName("target_user")] public Optional TargetUser { get; set; } - [JsonProperty("target_user_type")] + [JsonPropertyName("target_user_type")] public Optional TargetUserType { get; set; } - [JsonProperty("temporary")] + [JsonPropertyName("temporary")] public bool Temporary { get; set; } - [JsonProperty("uses")] + [JsonPropertyName("uses")] public int Uses { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/InviteCreatedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/InviteCreatedEvent.cs index 1613cdfa6..d40c0a56b 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/InviteCreatedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/InviteCreatedEvent.cs @@ -1,5 +1,5 @@ using Discord.API; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -10,23 +10,23 @@ namespace Discord.API.Gateway { internal class InviteCreatedEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelID { get; set; } - [JsonProperty("code")] + [JsonPropertyName("code")] public string InviteCode { get; set; } - [JsonProperty("timestamp")] + [JsonPropertyName("timestamp")] public Optional RawTimestamp { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong? GuildID { get; set; } - [JsonProperty("inviter")] + [JsonPropertyName("inviter")] public Optional Inviter { get; set; } - [JsonProperty("max_age")] + [JsonPropertyName("max_age")] public int RawAge { get; set; } - [JsonProperty("max_uses")] + [JsonPropertyName("max_uses")] public int MaxUsers { get; set; } - [JsonProperty("temporary")] + [JsonPropertyName("temporary")] public bool TempInvite { get; set; } - [JsonProperty("uses")] + [JsonPropertyName("uses")] public int Uses { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs index 54bc75595..261569e29 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class InviteDeleteEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/InviteDeletedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/InviteDeletedEvent.cs index 6bdd337f5..5f4efee9c 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/InviteDeletedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/InviteDeletedEvent.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,11 +9,11 @@ namespace Discord.WebSocket { internal class InviteDeletedEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelID { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildID { get; set; } - [JsonProperty("code")] + [JsonPropertyName("code")] public string Code { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs index c503e636d..4f8527e60 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API.Gateway { internal class MessageDeleteBulkEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("ids")] + [JsonPropertyName("ids")] public ulong[] Ids { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/PartialApplication.cs b/src/Discord.Net.WebSocket/API/Gateway/PartialApplication.cs index ae645e490..04bf18ebc 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/PartialApplication.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/PartialApplication.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; @@ -9,10 +9,10 @@ namespace Discord.API.Gateway { internal class PartialApplication { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("flags")] + [JsonPropertyName("flags")] public ApplicationFlags Flags { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/Reaction.cs b/src/Discord.Net.WebSocket/API/Gateway/Reaction.cs index 0d17cbff8..1359a5ec2 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/Reaction.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/Reaction.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class Reaction { - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - [JsonProperty("message_id")] + [JsonPropertyName("message_id")] public ulong MessageId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Emoji Emoji { get; set; } - [JsonProperty("member")] + [JsonPropertyName("member")] public Optional Member { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ReadyEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/ReadyEvent.cs index fb6670a90..595b3a680 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ReadyEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ReadyEvent.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { @@ -6,36 +6,36 @@ namespace Discord.API.Gateway { public class ReadState { - [JsonProperty("id")] + [JsonPropertyName("id")] public string ChannelId { get; set; } - [JsonProperty("mention_count")] + [JsonPropertyName("mention_count")] public int MentionCount { get; set; } - [JsonProperty("last_message_id")] + [JsonPropertyName("last_message_id")] public string LastMessageId { get; set; } } - [JsonProperty("v")] + [JsonPropertyName("v")] public int Version { get; set; } - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("session_id")] + [JsonPropertyName("session_id")] public string SessionId { get; set; } - [JsonProperty("resume_gateway_url")] + [JsonPropertyName("resume_gateway_url")] public string ResumeGatewayUrl { get; set; } - [JsonProperty("read_state")] + [JsonPropertyName("read_state")] public ReadState[] ReadStates { get; set; } - [JsonProperty("guilds")] + [JsonPropertyName("guilds")] public ExtendedGuild[] Guilds { get; set; } - [JsonProperty("private_channels")] + [JsonPropertyName("private_channels")] public Channel[] PrivateChannels { get; set; } - [JsonProperty("relationships")] + [JsonPropertyName("relationships")] public Relationship[] Relationships { get; set; } - [JsonProperty("application")] + [JsonPropertyName("application")] public PartialApplication Application { get; set; } //Ignored - /*[JsonProperty("user_settings")] - [JsonProperty("user_guild_settings")] - [JsonProperty("tutorial")]*/ + /*[JsonPropertyName("user_settings")] + [JsonPropertyName("user_guild_settings")] + [JsonPropertyName("tutorial")]*/ } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/RecipientEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/RecipientEvent.cs index 778b5708c..911c8f3d6 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/RecipientEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/RecipientEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class RecipientEvent { - [JsonProperty("user")] + [JsonPropertyName("user")] public User User { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsEvent.cs index 4833c5123..f790e8fd0 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class RemoveAllReactionsEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("message_id")] + [JsonPropertyName("message_id")] public ulong MessageId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsForEmoteEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsForEmoteEvent.cs index 7f804d3f5..f755c61ca 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsForEmoteEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/RemoveAllReactionsForEmoteEvent.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class RemoveAllReactionsForEmoteEvent { - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public Optional GuildId { get; set; } - [JsonProperty("message_id")] + [JsonPropertyName("message_id")] public ulong MessageId { get; set; } - [JsonProperty("emoji")] + [JsonPropertyName("emoji")] public Emoji Emoji { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/RequestMembersParams.cs b/src/Discord.Net.WebSocket/API/Gateway/RequestMembersParams.cs index f7a63e330..240c206e1 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/RequestMembersParams.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/RequestMembersParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System.Collections.Generic; namespace Discord.API.Gateway @@ -6,12 +6,12 @@ namespace Discord.API.Gateway [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class RequestMembersParams { - [JsonProperty("query")] + [JsonPropertyName("query")] public string Query { get; set; } - [JsonProperty("limit")] + [JsonPropertyName("limit")] public int Limit { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public IEnumerable GuildIds { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ResumeParams.cs b/src/Discord.Net.WebSocket/API/Gateway/ResumeParams.cs index 826e8fadd..7df646c38 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ResumeParams.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ResumeParams.cs @@ -1,15 +1,15 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class ResumeParams { - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } - [JsonProperty("session_id")] + [JsonPropertyName("session_id")] public string SessionId { get; set; } - [JsonProperty("seq")] + [JsonPropertyName("seq")] public int Sequence { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ResumedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/ResumedEvent.cs index 870ae7366..7cc491a09 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ResumedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ResumedEvent.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { - internal class ResumedEvent - { - [JsonProperty("heartbeat_interval")] + internal class ResumedEvent + { + [JsonPropertyName("heartbeat_interval")] public int HeartbeatInterval { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/StatusUpdateParams.cs b/src/Discord.Net.WebSocket/API/Gateway/StatusUpdateParams.cs index cbde225d2..576612286 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/StatusUpdateParams.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/StatusUpdateParams.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { @@ -6,13 +6,13 @@ namespace Discord.API.Gateway internal class PresenceUpdateParams { - [JsonProperty("status")] + [JsonPropertyName("status")] public UserStatus Status { get; set; } - [JsonProperty("since", NullValueHandling = NullValueHandling.Include), Int53] + [JsonPropertyName("since", NullValueHandling = NullValueHandling.Include), Int53] public long? IdleSince { get; set; } - [JsonProperty("afk")] + [JsonPropertyName("afk")] public bool IsAFK { get; set; } - [JsonProperty("activities")] + [JsonPropertyName("activities")] public object[] Activities { get; set; } // TODO, change to interface later } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ThreadListSyncEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/ThreadListSyncEvent.cs index 5084f6c95..663bcfb47 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ThreadListSyncEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ThreadListSyncEvent.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class ThreadListSyncEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("channel_ids")] + [JsonPropertyName("channel_ids")] public Optional ChannelIds { get; set; } - [JsonProperty("threads")] + [JsonPropertyName("threads")] public Channel[] Threads { get; set; } - [JsonProperty("members")] + [JsonPropertyName("members")] public ThreadMember[] Members { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/ThreadMembersUpdate.cs b/src/Discord.Net.WebSocket/API/Gateway/ThreadMembersUpdate.cs index 83d2c0edd..333508916 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/ThreadMembersUpdate.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/ThreadMembersUpdate.cs @@ -1,22 +1,22 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class ThreadMembersUpdated { - [JsonProperty("id")] + [JsonPropertyName("id")] public ulong Id { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("member_count")] + [JsonPropertyName("member_count")] public int MemberCount { get; set; } - [JsonProperty("added_members")] + [JsonPropertyName("added_members")] public Optional AddedMembers { get; set; } - [JsonProperty("removed_member_ids")] + [JsonPropertyName("removed_member_ids")] public Optional RemovedMemberIds { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/TypingStartEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/TypingStartEvent.cs index 729ea176f..98987b897 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/TypingStartEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/TypingStartEvent.cs @@ -1,18 +1,18 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class TypingStartEvent { - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("member")] + [JsonPropertyName("member")] public GuildMember Member { get; set; } - [JsonProperty("timestamp")] + [JsonPropertyName("timestamp")] public int Timestamp { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/VoiceServerUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/VoiceServerUpdateEvent.cs index 8df3f0108..f805f3b9d 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/VoiceServerUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/VoiceServerUpdateEvent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class VoiceServerUpdateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("endpoint")] + [JsonPropertyName("endpoint")] public string Endpoint { get; set; } - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/VoiceStateUpdateParams.cs b/src/Discord.Net.WebSocket/API/Gateway/VoiceStateUpdateParams.cs index ad21b14f1..3f6fa76a7 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/VoiceStateUpdateParams.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/VoiceStateUpdateParams.cs @@ -1,18 +1,18 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] internal class VoiceStateUpdateParams { - [JsonProperty("self_mute")] + [JsonPropertyName("self_mute")] public bool SelfMute { get; set; } - [JsonProperty("self_deaf")] + [JsonPropertyName("self_deaf")] public bool SelfDeaf { get; set; } - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong? GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong? ChannelId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/WebhookUpdateEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/WebhookUpdateEvent.cs index c1e6d5385..4be5e8081 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/WebhookUpdateEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/WebhookUpdateEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class WebhookUpdateEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Gateway/WebhooksUpdatedEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/WebhooksUpdatedEvent.cs index 5555dc842..5feac329d 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/WebhooksUpdatedEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/WebhooksUpdatedEvent.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Gateway { internal class WebhooksUpdatedEvent { - [JsonProperty("guild_id")] + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } - [JsonProperty("channel_id")] + [JsonPropertyName("channel_id")] public ulong ChannelId { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/SocketFrame.cs b/src/Discord.Net.WebSocket/API/SocketFrame.cs index 11c82ec44..cef87d95e 100644 --- a/src/Discord.Net.WebSocket/API/SocketFrame.cs +++ b/src/Discord.Net.WebSocket/API/SocketFrame.cs @@ -1,16 +1,18 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API { internal class SocketFrame { - [JsonProperty("op")] + [JsonPropertyName("op")] public int Operation { get; set; } - [JsonProperty("t", NullValueHandling = NullValueHandling.Ignore)] + [JsonPropertyName("t")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string Type { get; set; } - [JsonProperty("s", NullValueHandling = NullValueHandling.Ignore)] + [JsonPropertyName("s")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Sequence { get; set; } - [JsonProperty("d")] + [JsonPropertyName("d")] public object Payload { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/HelloEvent.cs b/src/Discord.Net.WebSocket/API/Voice/HelloEvent.cs index 8fdb0808f..dab9b6d5c 100644 --- a/src/Discord.Net.WebSocket/API/Voice/HelloEvent.cs +++ b/src/Discord.Net.WebSocket/API/Voice/HelloEvent.cs @@ -1,10 +1,10 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class HelloEvent { - [JsonProperty("heartbeat_interval")] + [JsonPropertyName("heartbeat_interval")] public int HeartbeatInterval { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/IdentifyParams.cs b/src/Discord.Net.WebSocket/API/Voice/IdentifyParams.cs index 508b70d70..686f853e2 100644 --- a/src/Discord.Net.WebSocket/API/Voice/IdentifyParams.cs +++ b/src/Discord.Net.WebSocket/API/Voice/IdentifyParams.cs @@ -1,16 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class IdentifyParams { - [JsonProperty("server_id")] + [JsonPropertyName("server_id")] public ulong GuildId { get; set; } - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - [JsonProperty("session_id")] + [JsonPropertyName("session_id")] public string SessionId { get; set; } - [JsonProperty("token")] + [JsonPropertyName("token")] public string Token { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/ReadyEvent.cs b/src/Discord.Net.WebSocket/API/Voice/ReadyEvent.cs index fb910573a..b2d109d0e 100644 --- a/src/Discord.Net.WebSocket/API/Voice/ReadyEvent.cs +++ b/src/Discord.Net.WebSocket/API/Voice/ReadyEvent.cs @@ -1,19 +1,19 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; using System; namespace Discord.API.Voice { internal class ReadyEvent { - [JsonProperty("ssrc")] + [JsonPropertyName("ssrc")] public uint SSRC { get; set; } - [JsonProperty("ip")] + [JsonPropertyName("ip")] public string Ip { get; set; } - [JsonProperty("port")] + [JsonPropertyName("port")] public ushort Port { get; set; } - [JsonProperty("modes")] + [JsonPropertyName("modes")] public string[] Modes { get; set; } - [JsonProperty("heartbeat_interval")] + [JsonPropertyName("heartbeat_interval")] [Obsolete("This field is erroneous and should not be used", true)] public int HeartbeatInterval { get; set; } } diff --git a/src/Discord.Net.WebSocket/API/Voice/SelectProtocolParams.cs b/src/Discord.Net.WebSocket/API/Voice/SelectProtocolParams.cs index 2e9bd157a..f36000a50 100644 --- a/src/Discord.Net.WebSocket/API/Voice/SelectProtocolParams.cs +++ b/src/Discord.Net.WebSocket/API/Voice/SelectProtocolParams.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class SelectProtocolParams { - [JsonProperty("protocol")] + [JsonPropertyName("protocol")] public string Protocol { get; set; } - [JsonProperty("data")] + [JsonPropertyName("data")] public UdpProtocolInfo Data { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/SessionDescriptionEvent.cs b/src/Discord.Net.WebSocket/API/Voice/SessionDescriptionEvent.cs index 043b9fe86..d46f4b8d6 100644 --- a/src/Discord.Net.WebSocket/API/Voice/SessionDescriptionEvent.cs +++ b/src/Discord.Net.WebSocket/API/Voice/SessionDescriptionEvent.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class SessionDescriptionEvent { - [JsonProperty("secret_key")] + [JsonPropertyName("secret_key")] public byte[] SecretKey { get; set; } - [JsonProperty("mode")] + [JsonPropertyName("mode")] public string Mode { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/SpeakingEvent.cs b/src/Discord.Net.WebSocket/API/Voice/SpeakingEvent.cs index c1746e9ce..15b83fdb6 100644 --- a/src/Discord.Net.WebSocket/API/Voice/SpeakingEvent.cs +++ b/src/Discord.Net.WebSocket/API/Voice/SpeakingEvent.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class SpeakingEvent { - [JsonProperty("user_id")] + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - [JsonProperty("ssrc")] + [JsonPropertyName("ssrc")] public uint Ssrc { get; set; } - [JsonProperty("speaking")] + [JsonPropertyName("speaking")] public bool Speaking { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/SpeakingParams.cs b/src/Discord.Net.WebSocket/API/Voice/SpeakingParams.cs index e03bfc751..8ebb3e18d 100644 --- a/src/Discord.Net.WebSocket/API/Voice/SpeakingParams.cs +++ b/src/Discord.Net.WebSocket/API/Voice/SpeakingParams.cs @@ -1,12 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class SpeakingParams { - [JsonProperty("speaking")] + [JsonPropertyName("speaking")] public bool IsSpeaking { get; set; } - [JsonProperty("delay")] + [JsonPropertyName("delay")] public int Delay { get; set; } } } diff --git a/src/Discord.Net.WebSocket/API/Voice/UdpProtocolInfo.cs b/src/Discord.Net.WebSocket/API/Voice/UdpProtocolInfo.cs index 5e69a0370..2bff23e2b 100644 --- a/src/Discord.Net.WebSocket/API/Voice/UdpProtocolInfo.cs +++ b/src/Discord.Net.WebSocket/API/Voice/UdpProtocolInfo.cs @@ -1,14 +1,14 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Discord.API.Voice { internal class UdpProtocolInfo { - [JsonProperty("address")] + [JsonPropertyName("address")] public string Address { get; set; } - [JsonProperty("port")] + [JsonPropertyName("port")] public int Port { get; set; } - [JsonProperty("mode")] + [JsonPropertyName("mode")] public string Mode { get; set; } } } diff --git a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs index 3cd67beb5..56f37c6b5 100644 --- a/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs +++ b/src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs @@ -1,5 +1,4 @@ using Discord.Rest; -using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -118,7 +117,7 @@ namespace Discord.WebSocket /// /// Collection of WebSocket-based users. /// - public IReadOnlyCollection MentionedUsers => _userMentions; + public IReadOnlyCollection MentionedUsers => _userMentions; /// public DateTimeOffset Timestamp => DateTimeUtils.FromTicks(_timestampTicks);