mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
STD: Make data field in response optional
Data field is not included in case of non-200 status codes.
This commit is contained in:
@@ -25,8 +25,8 @@ using Newtonsoft.Json;
|
||||
namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
internal sealed class ResponseData {
|
||||
[JsonProperty(PropertyName = "data", Required = Required.Always)]
|
||||
internal readonly InternalData Data = new();
|
||||
[JsonProperty(PropertyName = "data", Required = Required.DisallowNull)]
|
||||
internal readonly InternalData? Data;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
[JsonProperty(PropertyName = "success", Required = Required.Always)]
|
||||
@@ -53,7 +53,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
|
||||
#pragma warning restore CS0649
|
||||
|
||||
[JsonConstructor]
|
||||
internal InternalData() { }
|
||||
private InternalData() { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,6 +488,12 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.Content.Data == null) {
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid), nameof(response.Content.Data));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo($"Data successfully submitted. Newly registered apps/subs/depots: {response.Content.Data.NewAppsCount}/{response.Content.Data.NewSubsCount}/{response.Content.Data.NewDepotsCount}.");
|
||||
|
||||
GlobalCache.UpdateSubmittedData(appTokens, packageTokens, depotKeys);
|
||||
|
||||
Reference in New Issue
Block a user