mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +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:
parent
34fbb9f86d
commit
e836cb66e4
2 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue