diff --git a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs index e738916e2..7120434d3 100644 --- a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs +++ b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs @@ -55,7 +55,7 @@ internal static class CatAPI { #pragma warning disable CA1812 // False positive, the class is used during json deserialization [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] private sealed class MeowResponse { - [JsonProperty(PropertyName = "file", Required = Required.Always)] + [JsonProperty("file", Required = Required.Always)] internal readonly string Link = ""; [JsonConstructor] diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/RequestData.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/RequestData.cs index b58341d0e..3a5782284 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/RequestData.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/RequestData.cs @@ -30,27 +30,27 @@ using SteamKit2; namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper; internal sealed class RequestData { - [JsonProperty(PropertyName = "guid", Required = Required.Always)] + [JsonProperty("guid", Required = Required.Always)] private static string Guid => ASF.GlobalDatabase?.Identifier.ToString("N") ?? throw new InvalidOperationException(nameof(ASF.GlobalDatabase.Identifier)); - [JsonProperty(PropertyName = "token", Required = Required.Always)] + [JsonProperty("token", Required = Required.Always)] private static string Token => SharedInfo.Token; - [JsonProperty(PropertyName = "v", Required = Required.Always)] + [JsonProperty("v", Required = Required.Always)] private static byte Version => SharedInfo.ApiVersion; - [JsonProperty(PropertyName = "apps", Required = Required.Always)] + [JsonProperty("apps", Required = Required.Always)] private readonly ImmutableDictionary Apps; - [JsonProperty(PropertyName = "depots", Required = Required.Always)] + [JsonProperty("depots", Required = Required.Always)] private readonly ImmutableDictionary Depots; private readonly ulong SteamID; - [JsonProperty(PropertyName = "subs", Required = Required.Always)] + [JsonProperty("subs", Required = Required.Always)] private readonly ImmutableDictionary Subs; - [JsonProperty(PropertyName = "steamid", Required = Required.Always)] + [JsonProperty("steamid", Required = Required.Always)] private string SteamIDText => new SteamID(SteamID).Render(); internal RequestData(ulong steamID, IReadOnlyCollection> apps, IReadOnlyCollection> accessTokens, IReadOnlyCollection> depots) { diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/ResponseData.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/ResponseData.cs index 24b1c5e55..a7ad80dab 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/ResponseData.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/ResponseData.cs @@ -29,12 +29,12 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class ResponseData { #pragma warning disable CS0649 // False positive, the field is used during json deserialization - [JsonProperty(PropertyName = "data", Required = Required.DisallowNull)] + [JsonProperty("data", Required = Required.DisallowNull)] internal readonly InternalData? Data; #pragma warning restore CS0649 // False positive, the field is used during json deserialization #pragma warning disable CS0649 // False positive, the field is used during json deserialization - [JsonProperty(PropertyName = "success", Required = Required.Always)] + [JsonProperty("success", Required = Required.Always)] internal readonly bool Success; #pragma warning restore CS0649 // False positive, the field is used during json deserialization @@ -42,22 +42,22 @@ internal sealed class ResponseData { private ResponseData() { } internal sealed class InternalData { - [JsonProperty(PropertyName = "new_apps", Required = Required.Always)] + [JsonProperty("new_apps", Required = Required.Always)] internal readonly ImmutableHashSet NewApps = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "new_depots", Required = Required.Always)] + [JsonProperty("new_depots", Required = Required.Always)] internal readonly ImmutableHashSet NewDepots = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "new_subs", Required = Required.Always)] + [JsonProperty("new_subs", Required = Required.Always)] internal readonly ImmutableHashSet NewPackages = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "verified_apps", Required = Required.Always)] + [JsonProperty("verified_apps", Required = Required.Always)] internal readonly ImmutableHashSet VerifiedApps = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "verified_depots", Required = Required.Always)] + [JsonProperty("verified_depots", Required = Required.Always)] internal readonly ImmutableHashSet VerifiedDepots = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "verified_subs", Required = Required.Always)] + [JsonProperty("verified_subs", Required = Required.Always)] internal readonly ImmutableHashSet VerifiedPackages = ImmutableHashSet.Empty; [JsonConstructor] diff --git a/ArchiSteamFarm/Core/ArchiNet.cs b/ArchiSteamFarm/Core/ArchiNet.cs index 97237c44f..a2c30b6f8 100644 --- a/ArchiSteamFarm/Core/ArchiNet.cs +++ b/ArchiSteamFarm/Core/ArchiNet.cs @@ -130,30 +130,30 @@ internal static class ArchiNet { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class ListedUser { #pragma warning disable CS0649 // False positive, it's a field set during json deserialization - [JsonProperty(PropertyName = "items_count", Required = Required.Always)] + [JsonProperty("items_count", Required = Required.Always)] internal readonly ushort ItemsCount; #pragma warning restore CS0649 // False positive, it's a field set during json deserialization internal readonly HashSet MatchableTypes = new(); #pragma warning disable CS0649 // False positive, it's a field set during json deserialization - [JsonProperty(PropertyName = "steam_id", Required = Required.Always)] + [JsonProperty("steam_id", Required = Required.Always)] internal readonly ulong SteamID; #pragma warning restore CS0649 // False positive, it's a field set during json deserialization - [JsonProperty(PropertyName = "trade_token", Required = Required.Always)] + [JsonProperty("trade_token", Required = Required.Always)] internal readonly string TradeToken = ""; internal float Score => GamesCount / (float) ItemsCount; #pragma warning disable CS0649 // False positive, it's a field set during json deserialization - [JsonProperty(PropertyName = "games_count", Required = Required.Always)] + [JsonProperty("games_count", Required = Required.Always)] private readonly ushort GamesCount; #pragma warning restore CS0649 // False positive, it's a field set during json deserialization internal bool MatchEverything { get; private set; } - [JsonProperty(PropertyName = "matchable_backgrounds", Required = Required.Always)] + [JsonProperty("matchable_backgrounds", Required = Required.Always)] private byte MatchableBackgroundsNumber { set { switch (value) { @@ -173,7 +173,7 @@ internal static class ArchiNet { } } - [JsonProperty(PropertyName = "matchable_cards", Required = Required.Always)] + [JsonProperty("matchable_cards", Required = Required.Always)] private byte MatchableCardsNumber { set { switch (value) { @@ -193,7 +193,7 @@ internal static class ArchiNet { } } - [JsonProperty(PropertyName = "matchable_emoticons", Required = Required.Always)] + [JsonProperty("matchable_emoticons", Required = Required.Always)] private byte MatchableEmoticonsNumber { set { switch (value) { @@ -213,7 +213,7 @@ internal static class ArchiNet { } } - [JsonProperty(PropertyName = "matchable_foil_cards", Required = Required.Always)] + [JsonProperty("matchable_foil_cards", Required = Required.Always)] private byte MatchableFoilCardsNumber { set { switch (value) { @@ -233,7 +233,7 @@ internal static class ArchiNet { } } - [JsonProperty(PropertyName = "match_everything", Required = Required.Always)] + [JsonProperty("match_everything", Required = Required.Always)] private byte MatchEverythingNumber { set { switch (value) { diff --git a/ArchiSteamFarm/IPC/Requests/TwoFactorAuthenticationConfirmationsRequest.cs b/ArchiSteamFarm/IPC/Requests/TwoFactorAuthenticationConfirmationsRequest.cs index 2ad1b69a8..727b2aa90 100644 --- a/ArchiSteamFarm/IPC/Requests/TwoFactorAuthenticationConfirmationsRequest.cs +++ b/ArchiSteamFarm/IPC/Requests/TwoFactorAuthenticationConfirmationsRequest.cs @@ -55,7 +55,7 @@ public sealed class TwoFactorAuthenticationConfirmationsRequest { /// /// A helper property which works the same as but with values written as strings - for javascript compatibility purposes. Use either this one, or , not both. /// - [JsonProperty(PropertyName = $"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(AcceptedCreatorIDs)}", Required = Required.DisallowNull)] + [JsonProperty($"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(AcceptedCreatorIDs)}", Required = Required.DisallowNull)] public ImmutableHashSet SAcceptedCreatorIDs { get => AcceptedCreatorIDs.Select(static creatorID => creatorID.ToString(CultureInfo.InvariantCulture)).ToImmutableHashSet(); set { diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index 6732788ce..54d5241c3 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -180,7 +180,7 @@ public sealed class Bot : IAsyncDisposable { /// private bool ShouldUseLoginKeys => BotConfig.UseLoginKeys && (!BotConfig.IsSteamPasswordSet || !HasMobileAuthenticator); - [JsonProperty(PropertyName = $"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamID)}")] + [JsonProperty($"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamID)}")] private string SSteamID => SteamID.ToString(CultureInfo.InvariantCulture); [JsonProperty] diff --git a/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs b/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs index 291487a73..30157d56c 100644 --- a/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs +++ b/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs @@ -58,11 +58,11 @@ public sealed class CardsFarmer : IAsyncDisposable { // Games that were confirmed to show false status on general badges page private static readonly ImmutableHashSet UntrustedAppIDs = ImmutableHashSet.Create(440, 570, 730); - [JsonProperty(PropertyName = nameof(CurrentGamesFarming))] + [JsonProperty(nameof(CurrentGamesFarming))] [PublicAPI] public IReadOnlyCollection CurrentGamesFarmingReadOnly => CurrentGamesFarming; - [JsonProperty(PropertyName = nameof(GamesToFarm))] + [JsonProperty(nameof(GamesToFarm))] [PublicAPI] public IReadOnlyCollection GamesToFarmReadOnly => GamesToFarm; diff --git a/ArchiSteamFarm/Steam/Data/AccessTokenResponse.cs b/ArchiSteamFarm/Steam/Data/AccessTokenResponse.cs index d32539fcf..a18bb2b77 100644 --- a/ArchiSteamFarm/Steam/Data/AccessTokenResponse.cs +++ b/ArchiSteamFarm/Steam/Data/AccessTokenResponse.cs @@ -26,7 +26,7 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class AccessTokenResponse : ResultResponse { - [JsonProperty(PropertyName = "data", Required = Required.Always)] + [JsonProperty("data", Required = Required.Always)] internal readonly AccessTokenData Data = new(); [JsonConstructor] @@ -34,7 +34,7 @@ internal sealed class AccessTokenResponse : ResultResponse { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class AccessTokenData { - [JsonProperty(PropertyName = "webapi_token", Required = Required.Always)] + [JsonProperty("webapi_token", Required = Required.Always)] internal readonly string WebAPIToken = ""; [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/Asset.cs b/ArchiSteamFarm/Steam/Data/Asset.cs index 16fa98ae8..84fe02dba 100644 --- a/ArchiSteamFarm/Steam/Data/Asset.cs +++ b/ArchiSteamFarm/Steam/Data/Asset.cs @@ -46,7 +46,7 @@ public sealed class Asset { [PublicAPI] public uint Amount { get; internal set; } - [JsonProperty(PropertyName = "appid", Required = Required.DisallowNull)] + [JsonProperty("appid", Required = Required.DisallowNull)] public uint AppID { get; private set; } [JsonIgnore] @@ -92,7 +92,7 @@ public sealed class Asset { [JsonExtensionData(WriteData = false)] internal Dictionary? AdditionalProperties { private get; set; } - [JsonProperty(PropertyName = "amount", Required = Required.Always)] + [JsonProperty("amount", Required = Required.Always)] private string AmountText { get => Amount.ToString(CultureInfo.InvariantCulture); @@ -113,7 +113,7 @@ public sealed class Asset { } } - [JsonProperty(PropertyName = "assetid", Required = Required.DisallowNull)] + [JsonProperty("assetid", Required = Required.DisallowNull)] private string AssetIDText { get => AssetID.ToString(CultureInfo.InvariantCulture); @@ -134,7 +134,7 @@ public sealed class Asset { } } - [JsonProperty(PropertyName = "classid", Required = Required.DisallowNull)] + [JsonProperty("classid", Required = Required.DisallowNull)] private string ClassIDText { set { if (string.IsNullOrEmpty(value)) { @@ -151,7 +151,7 @@ public sealed class Asset { } } - [JsonProperty(PropertyName = "contextid", Required = Required.DisallowNull)] + [JsonProperty("contextid", Required = Required.DisallowNull)] private string ContextIDText { get => ContextID.ToString(CultureInfo.InvariantCulture); @@ -172,12 +172,12 @@ public sealed class Asset { } } - [JsonProperty(PropertyName = "id", Required = Required.DisallowNull)] + [JsonProperty("id", Required = Required.DisallowNull)] private string IDText { set => AssetIDText = value; } - [JsonProperty(PropertyName = "instanceid", Required = Required.DisallowNull)] + [JsonProperty("instanceid", Required = Required.DisallowNull)] private string InstanceIDText { set { if (string.IsNullOrEmpty(value)) { diff --git a/ArchiSteamFarm/Steam/Data/BooleanResponse.cs b/ArchiSteamFarm/Steam/Data/BooleanResponse.cs index 9a4598d09..bbce5de86 100644 --- a/ArchiSteamFarm/Steam/Data/BooleanResponse.cs +++ b/ArchiSteamFarm/Steam/Data/BooleanResponse.cs @@ -30,7 +30,7 @@ namespace ArchiSteamFarm.Steam.Data; public class BooleanResponse { // You say it works in a RESTFUL way // Then your errors come back as 200 OK - [JsonProperty(PropertyName = "success", Required = Required.Always)] + [JsonProperty("success", Required = Required.Always)] public bool Success { get; private set; } [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/InventoryResponse.cs b/ArchiSteamFarm/Steam/Data/InventoryResponse.cs index b2b865e03..679c464b0 100644 --- a/ArchiSteamFarm/Steam/Data/InventoryResponse.cs +++ b/ArchiSteamFarm/Steam/Data/InventoryResponse.cs @@ -34,22 +34,22 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class InventoryResponse : OptionalResultResponse { - [JsonProperty(PropertyName = "assets", Required = Required.DisallowNull)] + [JsonProperty("assets", Required = Required.DisallowNull)] internal readonly ImmutableHashSet Assets = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "descriptions", Required = Required.DisallowNull)] + [JsonProperty("descriptions", Required = Required.DisallowNull)] internal readonly ImmutableHashSet Descriptions = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "error", Required = Required.DisallowNull)] + [JsonProperty("error", Required = Required.DisallowNull)] internal readonly string Error = ""; - [JsonProperty(PropertyName = "total_inventory_count", Required = Required.DisallowNull)] + [JsonProperty("total_inventory_count", Required = Required.DisallowNull)] internal readonly uint TotalInventoryCount; internal ulong LastAssetID { get; private set; } internal bool MoreItems { get; private set; } - [JsonProperty(PropertyName = "last_assetid", Required = Required.DisallowNull)] + [JsonProperty("last_assetid", Required = Required.DisallowNull)] private string LastAssetIDText { set { if (string.IsNullOrEmpty(value)) { @@ -68,7 +68,7 @@ internal sealed class InventoryResponse : OptionalResultResponse { } } - [JsonProperty(PropertyName = "more_items", Required = Required.DisallowNull)] + [JsonProperty("more_items", Required = Required.DisallowNull)] private byte MoreItemsNumber { set => MoreItems = value > 0; } @@ -201,19 +201,19 @@ internal sealed class InventoryResponse : OptionalResultResponse { set; } - [JsonProperty(PropertyName = "appid", Required = Required.Always)] + [JsonProperty("appid", Required = Required.Always)] internal uint AppID { get; set; } internal ulong ClassID { get; set; } internal ulong InstanceID { get; set; } internal bool Marketable { get; set; } - [JsonProperty(PropertyName = "tags", Required = Required.DisallowNull)] + [JsonProperty("tags", Required = Required.DisallowNull)] internal ImmutableHashSet Tags { get; set; } = ImmutableHashSet.Empty; internal bool Tradable { get; set; } - [JsonProperty(PropertyName = "classid", Required = Required.Always)] + [JsonProperty("classid", Required = Required.Always)] private string ClassIDText { set { if (string.IsNullOrEmpty(value)) { @@ -232,7 +232,7 @@ internal sealed class InventoryResponse : OptionalResultResponse { } } - [JsonProperty(PropertyName = "instanceid", Required = Required.DisallowNull)] + [JsonProperty("instanceid", Required = Required.DisallowNull)] private string InstanceIDText { set { if (string.IsNullOrEmpty(value)) { @@ -249,12 +249,12 @@ internal sealed class InventoryResponse : OptionalResultResponse { } } - [JsonProperty(PropertyName = "marketable", Required = Required.Always)] + [JsonProperty("marketable", Required = Required.Always)] private byte MarketableNumber { set => Marketable = value > 0; } - [JsonProperty(PropertyName = "tradable", Required = Required.Always)] + [JsonProperty("tradable", Required = Required.Always)] private byte TradableNumber { set => Tradable = value > 0; } diff --git a/ArchiSteamFarm/Steam/Data/NewDiscoveryQueueResponse.cs b/ArchiSteamFarm/Steam/Data/NewDiscoveryQueueResponse.cs index a4849cbb2..a340091c9 100644 --- a/ArchiSteamFarm/Steam/Data/NewDiscoveryQueueResponse.cs +++ b/ArchiSteamFarm/Steam/Data/NewDiscoveryQueueResponse.cs @@ -27,7 +27,7 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class NewDiscoveryQueueResponse { - [JsonProperty(PropertyName = "queue", Required = Required.Always)] + [JsonProperty("queue", Required = Required.Always)] internal readonly ImmutableHashSet Queue = ImmutableHashSet.Empty; [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/OptionalResultResponse.cs b/ArchiSteamFarm/Steam/Data/OptionalResultResponse.cs index 08037b40f..47052942a 100644 --- a/ArchiSteamFarm/Steam/Data/OptionalResultResponse.cs +++ b/ArchiSteamFarm/Steam/Data/OptionalResultResponse.cs @@ -27,7 +27,7 @@ namespace ArchiSteamFarm.Steam.Data; [PublicAPI] public class OptionalResultResponse { - [JsonProperty(PropertyName = "success", Required = Required.DisallowNull)] + [JsonProperty("success", Required = Required.DisallowNull)] public EResult? Result { get; private set; } [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/RedeemWalletResponse.cs b/ArchiSteamFarm/Steam/Data/RedeemWalletResponse.cs index c1c49e999..d90aef1e4 100644 --- a/ArchiSteamFarm/Steam/Data/RedeemWalletResponse.cs +++ b/ArchiSteamFarm/Steam/Data/RedeemWalletResponse.cs @@ -27,7 +27,7 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class RedeemWalletResponse : ResultResponse { - [JsonProperty(PropertyName = "detail", Required = Required.DisallowNull)] + [JsonProperty("detail", Required = Required.DisallowNull)] internal readonly EPurchaseResultDetail PurchaseResultDetail; [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/ResultResponse.cs b/ArchiSteamFarm/Steam/Data/ResultResponse.cs index 67edd56e0..9cf274694 100644 --- a/ArchiSteamFarm/Steam/Data/ResultResponse.cs +++ b/ArchiSteamFarm/Steam/Data/ResultResponse.cs @@ -27,7 +27,7 @@ namespace ArchiSteamFarm.Steam.Data; [PublicAPI] public class ResultResponse { - [JsonProperty(PropertyName = "success", Required = Required.Always)] + [JsonProperty("success", Required = Required.Always)] public EResult Result { get; private set; } [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/Tag.cs b/ArchiSteamFarm/Steam/Data/Tag.cs index 78edecd1f..25dc23c92 100644 --- a/ArchiSteamFarm/Steam/Data/Tag.cs +++ b/ArchiSteamFarm/Steam/Data/Tag.cs @@ -26,11 +26,11 @@ using Newtonsoft.Json; namespace ArchiSteamFarm.Steam.Data; public sealed class Tag { - [JsonProperty(PropertyName = "category", Required = Required.Always)] + [JsonProperty("category", Required = Required.Always)] [PublicAPI] public string Identifier { get; private set; } = ""; - [JsonProperty(PropertyName = "internal_name", Required = Required.Always)] + [JsonProperty("internal_name", Required = Required.Always)] [PublicAPI] public string Value { get; private set; } = ""; diff --git a/ArchiSteamFarm/Steam/Data/TradeOfferAcceptResponse.cs b/ArchiSteamFarm/Steam/Data/TradeOfferAcceptResponse.cs index 7b47c97d1..d2b315b79 100644 --- a/ArchiSteamFarm/Steam/Data/TradeOfferAcceptResponse.cs +++ b/ArchiSteamFarm/Steam/Data/TradeOfferAcceptResponse.cs @@ -26,10 +26,10 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class TradeOfferAcceptResponse { - [JsonProperty(PropertyName = "strError", Required = Required.DisallowNull)] + [JsonProperty("strError", Required = Required.DisallowNull)] internal readonly string ErrorText = ""; - [JsonProperty(PropertyName = "needs_mobile_confirmation", Required = Required.DisallowNull)] + [JsonProperty("needs_mobile_confirmation", Required = Required.DisallowNull)] internal readonly bool RequiresMobileConfirmation; [JsonConstructor] diff --git a/ArchiSteamFarm/Steam/Data/TradeOfferSendRequest.cs b/ArchiSteamFarm/Steam/Data/TradeOfferSendRequest.cs index b9ef71326..2eda5687b 100644 --- a/ArchiSteamFarm/Steam/Data/TradeOfferSendRequest.cs +++ b/ArchiSteamFarm/Steam/Data/TradeOfferSendRequest.cs @@ -25,14 +25,14 @@ using Newtonsoft.Json; namespace ArchiSteamFarm.Steam.Data; internal sealed class TradeOfferSendRequest { - [JsonProperty(PropertyName = "me", Required = Required.Always)] + [JsonProperty("me", Required = Required.Always)] internal readonly ItemList ItemsToGive = new(); - [JsonProperty(PropertyName = "them", Required = Required.Always)] + [JsonProperty("them", Required = Required.Always)] internal readonly ItemList ItemsToReceive = new(); internal sealed class ItemList { - [JsonProperty(PropertyName = "assets", Required = Required.Always)] + [JsonProperty("assets", Required = Required.Always)] internal readonly HashSet Assets = new(); } } diff --git a/ArchiSteamFarm/Steam/Data/TradeOfferSendResponse.cs b/ArchiSteamFarm/Steam/Data/TradeOfferSendResponse.cs index 5199d4892..916f453ed 100644 --- a/ArchiSteamFarm/Steam/Data/TradeOfferSendResponse.cs +++ b/ArchiSteamFarm/Steam/Data/TradeOfferSendResponse.cs @@ -27,15 +27,15 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class TradeOfferSendResponse { - [JsonProperty(PropertyName = "strError", Required = Required.DisallowNull)] + [JsonProperty("strError", Required = Required.DisallowNull)] internal readonly string ErrorText = ""; - [JsonProperty(PropertyName = "needs_mobile_confirmation", Required = Required.DisallowNull)] + [JsonProperty("needs_mobile_confirmation", Required = Required.DisallowNull)] internal readonly bool RequiresMobileConfirmation; internal ulong TradeOfferID { get; private set; } - [JsonProperty(PropertyName = "tradeofferid", Required = Required.DisallowNull)] + [JsonProperty("tradeofferid", Required = Required.DisallowNull)] private string TradeOfferIDText { set { if (string.IsNullOrEmpty(value)) { diff --git a/ArchiSteamFarm/Steam/Data/UserPrivacy.cs b/ArchiSteamFarm/Steam/Data/UserPrivacy.cs index 7af9356e1..bca23ae2b 100644 --- a/ArchiSteamFarm/Steam/Data/UserPrivacy.cs +++ b/ArchiSteamFarm/Steam/Data/UserPrivacy.cs @@ -29,10 +29,10 @@ namespace ArchiSteamFarm.Steam.Data; [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class UserPrivacy { - [JsonProperty(PropertyName = "eCommentPermission", Required = Required.Always)] + [JsonProperty("eCommentPermission", Required = Required.Always)] internal readonly ECommentPermission CommentPermission; - [JsonProperty(PropertyName = "PrivacySettings", Required = Required.Always)] + [JsonProperty("PrivacySettings", Required = Required.Always)] internal readonly PrivacySettings Settings = new(); // Constructed from privacy change request @@ -45,22 +45,22 @@ internal sealed class UserPrivacy { private UserPrivacy() { } internal sealed class PrivacySettings { - [JsonProperty(PropertyName = "PrivacyFriendsList", Required = Required.Always)] + [JsonProperty("PrivacyFriendsList", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting FriendsList; - [JsonProperty(PropertyName = "PrivacyInventory", Required = Required.Always)] + [JsonProperty("PrivacyInventory", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting Inventory; - [JsonProperty(PropertyName = "PrivacyInventoryGifts", Required = Required.Always)] + [JsonProperty("PrivacyInventoryGifts", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting InventoryGifts; - [JsonProperty(PropertyName = "PrivacyOwnedGames", Required = Required.Always)] + [JsonProperty("PrivacyOwnedGames", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting OwnedGames; - [JsonProperty(PropertyName = "PrivacyPlaytime", Required = Required.Always)] + [JsonProperty("PrivacyPlaytime", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting Playtime; - [JsonProperty(PropertyName = "PrivacyProfile", Required = Required.Always)] + [JsonProperty("PrivacyProfile", Required = Required.Always)] internal readonly ArchiHandler.EPrivacySetting Profile; // Constructed from privacy change request diff --git a/ArchiSteamFarm/Steam/Security/MobileAuthenticator.cs b/ArchiSteamFarm/Steam/Security/MobileAuthenticator.cs index 9487a64ce..845cee6e5 100644 --- a/ArchiSteamFarm/Steam/Security/MobileAuthenticator.cs +++ b/ArchiSteamFarm/Steam/Security/MobileAuthenticator.cs @@ -56,10 +56,10 @@ public sealed class MobileAuthenticator : IDisposable { private readonly ArchiCacheable CachedDeviceID; - [JsonProperty(PropertyName = "identity_secret", Required = Required.Always)] + [JsonProperty("identity_secret", Required = Required.Always)] private readonly string IdentitySecret = ""; - [JsonProperty(PropertyName = "shared_secret", Required = Required.Always)] + [JsonProperty("shared_secret", Required = Required.Always)] private readonly string SharedSecret = ""; private Bot? Bot; diff --git a/ArchiSteamFarm/Steam/Storage/BotConfig.cs b/ArchiSteamFarm/Steam/Storage/BotConfig.cs index af8f9759d..6e80da646 100644 --- a/ArchiSteamFarm/Steam/Storage/BotConfig.cs +++ b/ArchiSteamFarm/Steam/Storage/BotConfig.cs @@ -295,7 +295,7 @@ public sealed class BotConfig { private string? BackingSteamParentalCode = DefaultSteamParentalCode; private string? BackingSteamPassword = DefaultSteamPassword; - [JsonProperty(PropertyName = $"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamMasterClanID)}", Required = Required.DisallowNull)] + [JsonProperty($"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamMasterClanID)}", Required = Required.DisallowNull)] private string SSteamMasterClanID { get => SteamMasterClanID.ToString(CultureInfo.InvariantCulture); diff --git a/ArchiSteamFarm/Steam/Storage/BotDatabase.cs b/ArchiSteamFarm/Steam/Storage/BotDatabase.cs index 3b3bcec2e..cbdd5b9c3 100644 --- a/ArchiSteamFarm/Steam/Storage/BotDatabase.cs +++ b/ArchiSteamFarm/Steam/Storage/BotDatabase.cs @@ -88,10 +88,10 @@ internal sealed class BotDatabase : SerializableFile { } } - [JsonProperty(PropertyName = $"_{nameof(LoginKey)}")] + [JsonProperty($"_{nameof(LoginKey)}")] private string? BackingLoginKey; - [JsonProperty(PropertyName = $"_{nameof(MobileAuthenticator)}")] + [JsonProperty($"_{nameof(MobileAuthenticator)}")] private MobileAuthenticator? BackingMobileAuthenticator; private BotDatabase(string filePath) { diff --git a/ArchiSteamFarm/Storage/GlobalConfig.cs b/ArchiSteamFarm/Storage/GlobalConfig.cs index d4d8e7d1a..d2802e509 100644 --- a/ArchiSteamFarm/Storage/GlobalConfig.cs +++ b/ArchiSteamFarm/Storage/GlobalConfig.cs @@ -279,7 +279,7 @@ public sealed class GlobalConfig { [Range(ushort.MinValue, ushort.MaxValue)] public ushort WebLimiterDelay { get; private set; } = DefaultWebLimiterDelay; - [JsonProperty(PropertyName = nameof(WebProxy))] + [JsonProperty(nameof(WebProxy))] public string? WebProxyText { get; private set; } = DefaultWebProxyText; [JsonProperty] @@ -315,7 +315,7 @@ public sealed class GlobalConfig { private WebProxy? BackingWebProxy; private string? BackingWebProxyPassword = DefaultWebProxyPassword; - [JsonProperty(PropertyName = $"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamOwnerID)}", Required = Required.DisallowNull)] + [JsonProperty($"{SharedInfo.UlongCompatibilityStringPrefix}{nameof(SteamOwnerID)}", Required = Required.DisallowNull)] private string SSteamOwnerID { get => SteamOwnerID.ToString(CultureInfo.InvariantCulture); diff --git a/ArchiSteamFarm/Storage/GlobalDatabase.cs b/ArchiSteamFarm/Storage/GlobalDatabase.cs index 835370593..a6e07a128 100644 --- a/ArchiSteamFarm/Storage/GlobalDatabase.cs +++ b/ArchiSteamFarm/Storage/GlobalDatabase.cs @@ -96,10 +96,10 @@ public sealed class GlobalDatabase : SerializableFile { } } - [JsonProperty(PropertyName = $"_{nameof(CellID)}", Required = Required.DisallowNull)] + [JsonProperty($"_{nameof(CellID)}", Required = Required.DisallowNull)] private uint BackingCellID; - [JsonProperty(PropertyName = $"_{nameof(LastChangeNumber)}", Required = Required.DisallowNull)] + [JsonProperty($"_{nameof(LastChangeNumber)}", Required = Required.DisallowNull)] private uint BackingLastChangeNumber; private GlobalDatabase(string filePath) : this() { diff --git a/ArchiSteamFarm/Web/GitHub.cs b/ArchiSteamFarm/Web/GitHub.cs index e89042db4..73afc141d 100644 --- a/ArchiSteamFarm/Web/GitHub.cs +++ b/ArchiSteamFarm/Web/GitHub.cs @@ -204,16 +204,16 @@ internal static class GitHub { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] internal sealed class ReleaseResponse { - [JsonProperty(PropertyName = "assets", Required = Required.Always)] + [JsonProperty("assets", Required = Required.Always)] internal readonly ImmutableHashSet Assets = ImmutableHashSet.Empty; - [JsonProperty(PropertyName = "prerelease", Required = Required.Always)] + [JsonProperty("prerelease", Required = Required.Always)] internal readonly bool IsPreRelease; - [JsonProperty(PropertyName = "published_at", Required = Required.Always)] + [JsonProperty("published_at", Required = Required.Always)] internal readonly DateTime PublishedAt; - [JsonProperty(PropertyName = "tag_name", Required = Required.Always)] + [JsonProperty("tag_name", Required = Required.Always)] internal readonly string Tag = ""; internal string? ChangelogHTML { @@ -266,7 +266,7 @@ internal static class GitHub { } } - [JsonProperty(PropertyName = "body", Required = Required.Always)] + [JsonProperty("body", Required = Required.Always)] private readonly string? MarkdownBody = ""; private MarkdownDocument? Changelog { @@ -293,13 +293,13 @@ internal static class GitHub { private ReleaseResponse() { } internal sealed class Asset { - [JsonProperty(PropertyName = "browser_download_url", Required = Required.Always)] + [JsonProperty("browser_download_url", Required = Required.Always)] internal readonly Uri? DownloadURL; - [JsonProperty(PropertyName = "name", Required = Required.Always)] + [JsonProperty("name", Required = Required.Always)] internal readonly string? Name; - [JsonProperty(PropertyName = "size", Required = Required.Always)] + [JsonProperty("size", Required = Required.Always)] internal readonly uint Size; [JsonConstructor]