Close V5.1.0 release with one more breaking change

Technically I don't agree with R# about EResultResponse, neither the roslyn analyzers, but I also don't see a reason why it couldn't be just ResultResponse as suggested.
This commit is contained in:
Archi
2021-05-30 17:05:43 +02:00
parent ae9f3bd380
commit 299f2ef934
5 changed files with 8 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ using Newtonsoft.Json;
namespace ArchiSteamFarm.Steam.Data {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
internal sealed class AccessTokenResponse : EResultResponse {
internal sealed class AccessTokenResponse : ResultResponse {
[JsonProperty(PropertyName = "data", Required = Required.Always)]
internal readonly AccessTokenData Data = new();

View File

@@ -32,7 +32,7 @@ using Newtonsoft.Json.Linq;
namespace ArchiSteamFarm.Steam.Data {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
internal sealed class InventoryResponse : EResultResponse {
internal sealed class InventoryResponse : ResultResponse {
[JsonProperty(PropertyName = "assets", Required = Required.DisallowNull)]
internal readonly ImmutableHashSet<Asset> Assets = ImmutableHashSet<Asset>.Empty;

View File

@@ -25,7 +25,7 @@ using SteamKit2;
namespace ArchiSteamFarm.Steam.Data {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
internal sealed class RedeemWalletResponse : EResultResponse {
internal sealed class RedeemWalletResponse : ResultResponse {
[JsonProperty(PropertyName = "detail", Required = Required.DisallowNull)]
internal readonly EPurchaseResultDetail PurchaseResultDetail;

View File

@@ -27,12 +27,11 @@ using SteamKit2;
namespace ArchiSteamFarm.Steam.Data {
[PublicAPI]
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class EResultResponse {
public class ResultResponse {
[JsonProperty(PropertyName = "success", Required = Required.Always)]
public EResult Result { get; private set; }
[JsonConstructor]
protected EResultResponse() { }
protected ResultResponse() { }
}
}

View File

@@ -1359,7 +1359,7 @@ namespace ArchiSteamFarm.Steam.Integration {
{ "giftcardid", giftCardID.ToString(CultureInfo.InvariantCulture) }
};
ObjectResponse<EResultResponse>? response = await UrlPostToJsonObjectWithSession<EResultResponse>(request, data: data).ConfigureAwait(false);
ObjectResponse<ResultResponse>? response = await UrlPostToJsonObjectWithSession<ResultResponse>(request, data: data).ConfigureAwait(false);
if (response == null) {
return false;
@@ -1454,7 +1454,7 @@ namespace ArchiSteamFarm.Steam.Integration {
{ "Privacy", JsonConvert.SerializeObject(userPrivacy.Settings) }
};
ObjectResponse<EResultResponse>? response = await UrlPostToJsonObjectWithSession<EResultResponse>(request, data: data).ConfigureAwait(false);
ObjectResponse<ResultResponse>? response = await UrlPostToJsonObjectWithSession<ResultResponse>(request, data: data).ConfigureAwait(false);
if (response == null) {
return false;
@@ -2418,7 +2418,7 @@ namespace ArchiSteamFarm.Steam.Integration {
{ "communityitemid", itemID.ToString(CultureInfo.InvariantCulture) }
};
ObjectResponse<EResultResponse>? response = await UrlPostToJsonObjectWithSession<EResultResponse>(request, data: data).ConfigureAwait(false);
ObjectResponse<ResultResponse>? response = await UrlPostToJsonObjectWithSession<ResultResponse>(request, data: data).ConfigureAwait(false);
return response?.Content.Result == EResult.OK;
}