Add json constructor attributes

This commit is contained in:
JustArchi
2019-01-11 01:02:58 +01:00
parent 4dca323726
commit b8d000bf13
9 changed files with 23 additions and 22 deletions

View File

@@ -58,6 +58,7 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
internal readonly string Link;
#pragma warning restore 649
[JsonConstructor]
private MeowResponse() { }
}
}

View File

@@ -197,7 +197,7 @@ namespace ArchiSteamFarm {
private string _ChangelogHTML;
private string _ChangelogPlainText;
// Deserialized from JSON
[JsonConstructor]
private ReleaseResponse() { }
internal sealed class Asset {
@@ -210,7 +210,7 @@ namespace ArchiSteamFarm {
[JsonProperty(PropertyName = "size", Required = Required.Always)]
internal readonly uint Size;
// Deserialized from JSON
[JsonConstructor]
private Asset() { }
}
}

View File

@@ -33,7 +33,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[Required]
public readonly GlobalConfig GlobalConfig;
// Deserialized from JSON
[JsonConstructor]
private ASFRequest() { }
}
}

View File

@@ -38,7 +38,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[Required]
public readonly OrderedDictionary GamesToRedeemInBackground;
// Deserialized from JSON
[JsonConstructor]
private BotGamesToRedeemInBackgroundRequest() { }
}
}

View File

@@ -37,7 +37,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[JsonProperty(Required = Required.DisallowNull)]
public readonly ushort ResumeInSeconds;
// Deserialized from JSON
[JsonConstructor]
private BotPauseRequest() { }
}
}

View File

@@ -34,7 +34,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[Required]
public readonly ImmutableHashSet<string> KeysToRedeem;
// Deserialized from JSON
[JsonConstructor]
private BotRedeemRequest() { }
}
}

View File

@@ -33,7 +33,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[Required]
public readonly BotConfig BotConfig;
// Deserialized from JSON
[JsonConstructor]
private BotRequest() { }
}
}

View File

@@ -36,7 +36,7 @@ namespace ArchiSteamFarm.IPC.Requests {
[JsonProperty(Required = Required.Always)]
public readonly string URL;
// Deserialized from JSON
[JsonConstructor]
private WWWSendRequest() { }
}
}

View File

@@ -170,7 +170,7 @@ namespace ArchiSteamFarm.Json {
Type = type;
}
// Deserialized from JSON
[JsonConstructor]
private Asset() { }
public enum EType : byte {
@@ -189,7 +189,7 @@ namespace ArchiSteamFarm.Json {
[JsonProperty(PropertyName = "success", Required = Required.Always)]
public readonly bool Success;
// Deserialized from JSON
[JsonConstructor]
protected BooleanResponse() { }
}
@@ -269,7 +269,7 @@ namespace ArchiSteamFarm.Json {
}
}
// Deserialized from JSON
[JsonConstructor]
private ConfirmationDetails() { }
// REF: Internal documentation
@@ -290,7 +290,7 @@ namespace ArchiSteamFarm.Json {
[JsonProperty(PropertyName = "success", Required = Required.Always)]
public readonly EResult Result;
// Deserialized from JSON
[JsonConstructor]
protected EResultResponse() { }
}
@@ -319,7 +319,7 @@ namespace ArchiSteamFarm.Json {
}
}
// Deserialized from JSON
[JsonConstructor]
protected NumberResponse() { }
}
@@ -422,7 +422,7 @@ namespace ArchiSteamFarm.Json {
set => MoreItems = value > 0;
}
// Deserialized from JSON
[JsonConstructor]
private InventoryResponse() { }
internal sealed class Description {
@@ -462,7 +462,7 @@ namespace ArchiSteamFarm.Json {
set => Tradable = value > 0;
}
// Deserialized from JSON
[JsonConstructor]
private Description() { }
}
}
@@ -472,7 +472,7 @@ namespace ArchiSteamFarm.Json {
[JsonProperty(PropertyName = "queue", Required = Required.Always)]
internal readonly HashSet<uint> Queue;
// Deserialized from JSON
[JsonConstructor]
private NewDiscoveryQueueResponse() { }
}
@@ -487,14 +487,14 @@ namespace ArchiSteamFarm.Json {
[JsonProperty(PropertyName = "currency", Required = Required.DisallowNull)]
internal readonly ECurrencyCode? WalletCurrencyCode;
// Deserialized from JSON
[JsonConstructor]
private RedeemWalletResponse() { }
internal sealed class InternalKeyDetails {
[JsonProperty(PropertyName = "currencycode", Required = Required.Always)]
internal readonly ECurrencyCode CurrencyCode;
// Deserialized from JSON
[JsonConstructor]
private InternalKeyDetails() { }
}
}
@@ -504,7 +504,7 @@ namespace ArchiSteamFarm.Json {
[JsonProperty(PropertyName = "needs_mobile_confirmation", Required = Required.DisallowNull)]
internal readonly bool RequiresMobileConfirmation;
// Deserialized from JSON
[JsonConstructor]
private TradeOfferAcceptResponse() { }
}
@@ -547,7 +547,7 @@ namespace ArchiSteamFarm.Json {
}
}
// Deserialized from JSON
[JsonConstructor]
private TradeOfferSendResponse() { }
}
@@ -565,7 +565,7 @@ namespace ArchiSteamFarm.Json {
CommentPermission = commentPermission;
}
// Deserialized from JSON
[JsonConstructor]
private UserPrivacy() { }
internal sealed class PrivacySettings {
@@ -601,7 +601,7 @@ namespace ArchiSteamFarm.Json {
InventoryGifts = inventoryGifts;
}
// Deserialized from JSON
[JsonConstructor]
private PrivacySettings() { }
internal enum EPrivacySetting : byte {