diff --git a/WotBlitzStatisticsPro.Blazor.Tests/Services/GraphQlBackendServiceTests.cs b/WotBlitzStatisticsPro.Blazor.Tests/Services/GraphQlBackendServiceTests.cs index ffe90bf..c333e43 100644 --- a/WotBlitzStatisticsPro.Blazor.Tests/Services/GraphQlBackendServiceTests.cs +++ b/WotBlitzStatisticsPro.Blazor.Tests/Services/GraphQlBackendServiceTests.cs @@ -14,6 +14,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services { private Mock _findClanQueryMock; private Mock _findPlayersQueryMock; + private Mock _playerQueryMock; private WotBlitzStatisticsProClient _generatedClient; private Mock _notificationServiceMock; private GraphQlBackendService _service; @@ -33,12 +34,13 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services { _findClanQueryMock = new(); _findPlayersQueryMock = new(); + _playerQueryMock = new(); await SetUpFindClans(); await SetUpFindPlayers(); _generatedClient = - new WotBlitzStatisticsProClient(_findClanQueryMock.Object, _findPlayersQueryMock.Object); + new WotBlitzStatisticsProClient(_findClanQueryMock.Object, _findPlayersQueryMock.Object, _playerQueryMock.Object); _notificationServiceMock = new(); diff --git a/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs index 26348c1..133e5b9 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -15,8 +15,9 @@ namespace Microsoft.Extensions.DependencyInjection return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection)); }); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.WotBlitzStatisticsProClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); return new global::StrawberryShake.ClientBuilder("WotBlitzStatisticsProClient", services, serviceCollection); @@ -49,13 +50,6 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindPlayersResultFactory>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindPlayersBuilder>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindClansResultFactory>(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); @@ -63,6 +57,20 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindPlayersResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindPlayersBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..8a95a9b --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,50 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the Player GraphQL operation + /// + /// query Player($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// accountInfo(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) { + /// __typename + /// accountId + /// nickname + /// createdAt + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgTier + /// damageCoefficient + /// survivalRate + /// tanks { + /// __typename + /// tankId + /// name + /// tankNation + /// tankType + /// tier + /// isPremium + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgBattleLifeTimeInMinutes + /// damageCoefficient + /// survivalRate + /// } + /// } + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayerQuery : global::StrawberryShake.IOperationRequestFactory + { + global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::System.Threading.CancellationToken cancellationToken = default); + global::System.IObservable> Watch(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::StrawberryShake.ExecutionStrategy? strategy = null); + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..183fc2c --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,14 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayerResult + { + /// + /// Gathers all account information + /// + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo AccountInfo { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..1b997d6 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,72 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayer_AccountInfo + { + /// + /// Player account identifier + /// + public global::System.Int64 AccountId { get; } + + /// + /// Player's nick + /// + public global::System.String? Nickname { get; } + + /// + /// Account creation date + /// + public global::System.DateTimeOffset CreatedAt { get; } + + /// + /// Last battle time + /// + public global::System.DateTimeOffset LastBattleTime { get; } + + /// + /// Battles count + /// + public global::System.Int64 Battles { get; } + + /// + /// Player's win rate + /// + public global::System.Decimal WinRate { get; } + + /// + /// Player's average damage + /// + public global::System.Decimal AvgDamage { get; } + + /// + /// Player's average XP + /// + public global::System.Decimal AvgXp { get; } + + /// + /// Average tier + /// + public global::System.Double AvgTier { get; } + + /// + /// Damage coefficient + /// + public global::System.Decimal DamageCoefficient { get; } + + /// + /// Rate of survival + /// + public global::System.Decimal SurvivalRate { get; } + + /// + /// All player's tanks + /// + public global::System.Collections.Generic.IReadOnlyList? Tanks { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..0068695 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,13 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayer_AccountInfo_AccountInfoResponse : IPlayer_AccountInfo + { + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..ac1f9d9 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,82 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player's tank + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayer_AccountInfo_Tanks + { + /// + /// Tank identifier + /// + public global::System.Int64 TankId { get; } + + /// + /// Tank name + /// + public global::System.String? Name { get; } + + /// + /// Localized tank nation name + /// + public global::System.String? TankNation { get; } + + /// + /// Localized tank type name + /// + public global::System.String? TankType { get; } + + /// + /// Tank tier + /// + public global::System.Int32 Tier { get; } + + /// + /// Is it premium tank or not + /// + public global::System.Boolean IsPremium { get; } + + /// + /// Last battle + /// + public global::System.DateTimeOffset LastBattleTime { get; } + + /// + /// Battles count + /// + public global::System.Int64 Battles { get; } + + /// + /// Tank's win rate + /// + public global::System.Decimal WinRate { get; } + + /// + /// Average tank's damage + /// + public global::System.Decimal AvgDamage { get; } + + /// + /// Average XP + /// + public global::System.Decimal AvgXp { get; } + + /// + /// Average life time in battle until tank is killed. + /// + public global::System.Decimal AvgBattleLifeTimeInMinutes { get; } + + /// + /// Damage coefficient + /// + public global::System.Decimal DamageCoefficient { get; } + + /// + /// Rate of survival + /// + public global::System.Decimal SurvivalRate { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..fdbe0ee --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IPlayer_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,13 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player's tank + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IPlayer_AccountInfo_Tanks_TankInfoResponse : IPlayer_AccountInfo_Tanks + { + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs index ec5120d..e25ad62 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -9,8 +9,10 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] public interface IWotBlitzStatisticsProClient { + global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery FindClans { get; } + global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery FindPlayers { get; } - global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery FindClans { get; } + global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player { get; } } } diff --git a/WotBlitzStatisticsPro.Blazor/Generated/PlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/PlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..afa23f3 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/PlayerQuery.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,106 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the Player GraphQL operation + /// + /// query Player($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// accountInfo(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) { + /// __typename + /// accountId + /// nickname + /// createdAt + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgTier + /// damageCoefficient + /// survivalRate + /// tanks { + /// __typename + /// tankId + /// name + /// tankNation + /// tankType + /// tier + /// isPremium + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgBattleLifeTimeInMinutes + /// damageCoefficient + /// survivalRate + /// } + /// } + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerQuery : global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery + { + private readonly global::StrawberryShake.IOperationExecutor _operationExecutor; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _longFormatter; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _realmTypeFormatter; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _requestLanguageFormatter; + public PlayerQuery(global::StrawberryShake.IOperationExecutor operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) + { + _operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor)); + _longFormatter = serializerResolver.GetInputValueFormatter("Long"); + _realmTypeFormatter = serializerResolver.GetInputValueFormatter("RealmType"); + _requestLanguageFormatter = serializerResolver.GetInputValueFormatter("RequestLanguage"); + } + + global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IPlayerResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::System.Threading.CancellationToken cancellationToken = default) + { + var request = CreateRequest(accountId, realmType, requestLanguage); + return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + + public global::System.IObservable> Watch(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::StrawberryShake.ExecutionStrategy? strategy = null) + { + var request = CreateRequest(accountId, realmType, requestLanguage); + return _operationExecutor.Watch(request, strategy); + } + + private global::StrawberryShake.OperationRequest CreateRequest(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage) + { + var variables = new global::System.Collections.Generic.Dictionary(); + variables.Add("accountId", FormatAccountId(accountId)); + variables.Add("realmType", FormatRealmType(realmType)); + variables.Add("requestLanguage", FormatRequestLanguage(requestLanguage)); + return CreateRequest(variables); + } + + private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary? variables) + { + return new global::StrawberryShake.OperationRequest(id: PlayerQueryDocument.Instance.Hash.Value, name: "Player", document: PlayerQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, variables: variables); + } + + private global::System.Object? FormatAccountId(global::System.Int64 value) + { + return _longFormatter.Format(value); + } + + private global::System.Object? FormatRealmType(global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType value) + { + return _realmTypeFormatter.Format(value); + } + + private global::System.Object? FormatRequestLanguage(global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage value) + { + return _requestLanguageFormatter.Format(value); + } + + global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary? variables) + { + return CreateRequest(variables!); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/PlayerQueryDocument.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/PlayerQueryDocument.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..2cb3fd0 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/PlayerQueryDocument.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,64 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the Player GraphQL operation + /// + /// query Player($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// accountInfo(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) { + /// __typename + /// accountId + /// nickname + /// createdAt + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgTier + /// damageCoefficient + /// survivalRate + /// tanks { + /// __typename + /// tankId + /// name + /// tankNation + /// tankType + /// tier + /// isPremium + /// lastBattleTime + /// battles + /// winRate + /// avgDamage + /// avgXp + /// avgBattleLifeTimeInMinutes + /// damageCoefficient + /// survivalRate + /// } + /// } + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerQueryDocument : global::StrawberryShake.IDocument + { + private PlayerQueryDocument() + { + } + + public static PlayerQueryDocument Instance { get; } = new PlayerQueryDocument(); + public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; + public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x28, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x20, 0x4c, 0x6f, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x28, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x20, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x20, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x20, 0x61, 0x76, 0x67, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x61, 0x76, 0x67, 0x58, 0x70, 0x20, 0x61, 0x76, 0x67, 0x54, 0x69, 0x65, 0x72, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x49, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x20, 0x74, 0x69, 0x65, 0x72, 0x20, 0x69, 0x73, 0x50, 0x72, 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x20, 0x61, 0x76, 0x67, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x61, 0x76, 0x67, 0x58, 0x70, 0x20, 0x61, 0x76, 0x67, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4c, 0x69, 0x66, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "d87965bc71ef355d4d296088704d4d40"); + public override global::System.String ToString() + { +#if NETSTANDARD2_0 + return global::System.Text.Encoding.UTF8.GetString(Body.ToArray()); +#else + return global::System.Text.Encoding.UTF8.GetString(Body); +#endif + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/PlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/PlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..a68af84 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/PlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,69 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerResult : global::System.IEquatable, IPlayerResult + { + public PlayerResult(global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo accountInfo) + { + AccountInfo = accountInfo; + } + + /// + /// Gathers all account information + /// + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo AccountInfo { get; } + + public virtual global::System.Boolean Equals(PlayerResult? other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + if (ReferenceEquals(this, other)) + { + return true; + } + + if (other.GetType() != GetType()) + { + return false; + } + + return (AccountInfo.Equals(other.AccountInfo)); + } + + public override global::System.Boolean Equals(global::System.Object? obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((PlayerResult)obj); + } + + public override global::System.Int32 GetHashCode() + { + unchecked + { + int hash = 5; + hash ^= 397 * AccountInfo.GetHashCode(); + return hash; + } + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..5ba12a6 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_AccountInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,160 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class Player_AccountInfo_AccountInfoResponse : global::System.IEquatable, IPlayer_AccountInfo_AccountInfoResponse + { + public Player_AccountInfo_AccountInfoResponse(global::System.Int64 accountId, global::System.String? nickname, global::System.DateTimeOffset createdAt, global::System.DateTimeOffset lastBattleTime, global::System.Int64 battles, global::System.Decimal winRate, global::System.Decimal avgDamage, global::System.Decimal avgXp, global::System.Double avgTier, global::System.Decimal damageCoefficient, global::System.Decimal survivalRate, global::System.Collections.Generic.IReadOnlyList? tanks) + { + AccountId = accountId; + Nickname = nickname; + CreatedAt = createdAt; + LastBattleTime = lastBattleTime; + Battles = battles; + WinRate = winRate; + AvgDamage = avgDamage; + AvgXp = avgXp; + AvgTier = avgTier; + DamageCoefficient = damageCoefficient; + SurvivalRate = survivalRate; + Tanks = tanks; + } + + /// + /// Player account identifier + /// + public global::System.Int64 AccountId { get; } + + /// + /// Player's nick + /// + public global::System.String? Nickname { get; } + + /// + /// Account creation date + /// + public global::System.DateTimeOffset CreatedAt { get; } + + /// + /// Last battle time + /// + public global::System.DateTimeOffset LastBattleTime { get; } + + /// + /// Battles count + /// + public global::System.Int64 Battles { get; } + + /// + /// Player's win rate + /// + public global::System.Decimal WinRate { get; } + + /// + /// Player's average damage + /// + public global::System.Decimal AvgDamage { get; } + + /// + /// Player's average XP + /// + public global::System.Decimal AvgXp { get; } + + /// + /// Average tier + /// + public global::System.Double AvgTier { get; } + + /// + /// Damage coefficient + /// + public global::System.Decimal DamageCoefficient { get; } + + /// + /// Rate of survival + /// + public global::System.Decimal SurvivalRate { get; } + + /// + /// All player's tanks + /// + public global::System.Collections.Generic.IReadOnlyList? Tanks { get; } + + public virtual global::System.Boolean Equals(Player_AccountInfo_AccountInfoResponse? other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + if (ReferenceEquals(this, other)) + { + return true; + } + + if (other.GetType() != GetType()) + { + return false; + } + + return (AccountId == other.AccountId) && ((Nickname is null && other.Nickname is null) || Nickname != null && Nickname.Equals(other.Nickname)) && CreatedAt.Equals(other.CreatedAt) && LastBattleTime.Equals(other.LastBattleTime) && Battles == other.Battles && WinRate == other.WinRate && AvgDamage == other.AvgDamage && AvgXp == other.AvgXp && AvgTier == other.AvgTier && DamageCoefficient == other.DamageCoefficient && SurvivalRate == other.SurvivalRate && global::StrawberryShake.Helper.ComparisonHelper.SequenceEqual(Tanks, other.Tanks); + } + + public override global::System.Boolean Equals(global::System.Object? obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((Player_AccountInfo_AccountInfoResponse)obj); + } + + public override global::System.Int32 GetHashCode() + { + unchecked + { + int hash = 5; + hash ^= 397 * AccountId.GetHashCode(); + if (Nickname != null) + { + hash ^= 397 * Nickname.GetHashCode(); + } + + hash ^= 397 * CreatedAt.GetHashCode(); + hash ^= 397 * LastBattleTime.GetHashCode(); + hash ^= 397 * Battles.GetHashCode(); + hash ^= 397 * WinRate.GetHashCode(); + hash ^= 397 * AvgDamage.GetHashCode(); + hash ^= 397 * AvgXp.GetHashCode(); + hash ^= 397 * AvgTier.GetHashCode(); + hash ^= 397 * DamageCoefficient.GetHashCode(); + hash ^= 397 * SurvivalRate.GetHashCode(); + if (Tanks != null) + { + foreach (var Tanks_elm in Tanks) + { + hash ^= 397 * Tanks_elm.GetHashCode(); + } + } + + return hash; + } + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..f1e59fb --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/Player_AccountInfo_Tanks_TankInfoResponse.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,175 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Information about player's tank + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class Player_AccountInfo_Tanks_TankInfoResponse : global::System.IEquatable, IPlayer_AccountInfo_Tanks_TankInfoResponse + { + public Player_AccountInfo_Tanks_TankInfoResponse(global::System.Int64 tankId, global::System.String? name, global::System.String? tankNation, global::System.String? tankType, global::System.Int32 tier, global::System.Boolean isPremium, global::System.DateTimeOffset lastBattleTime, global::System.Int64 battles, global::System.Decimal winRate, global::System.Decimal avgDamage, global::System.Decimal avgXp, global::System.Decimal avgBattleLifeTimeInMinutes, global::System.Decimal damageCoefficient, global::System.Decimal survivalRate) + { + TankId = tankId; + Name = name; + TankNation = tankNation; + TankType = tankType; + Tier = tier; + IsPremium = isPremium; + LastBattleTime = lastBattleTime; + Battles = battles; + WinRate = winRate; + AvgDamage = avgDamage; + AvgXp = avgXp; + AvgBattleLifeTimeInMinutes = avgBattleLifeTimeInMinutes; + DamageCoefficient = damageCoefficient; + SurvivalRate = survivalRate; + } + + /// + /// Tank identifier + /// + public global::System.Int64 TankId { get; } + + /// + /// Tank name + /// + public global::System.String? Name { get; } + + /// + /// Localized tank nation name + /// + public global::System.String? TankNation { get; } + + /// + /// Localized tank type name + /// + public global::System.String? TankType { get; } + + /// + /// Tank tier + /// + public global::System.Int32 Tier { get; } + + /// + /// Is it premium tank or not + /// + public global::System.Boolean IsPremium { get; } + + /// + /// Last battle + /// + public global::System.DateTimeOffset LastBattleTime { get; } + + /// + /// Battles count + /// + public global::System.Int64 Battles { get; } + + /// + /// Tank's win rate + /// + public global::System.Decimal WinRate { get; } + + /// + /// Average tank's damage + /// + public global::System.Decimal AvgDamage { get; } + + /// + /// Average XP + /// + public global::System.Decimal AvgXp { get; } + + /// + /// Average life time in battle until tank is killed. + /// + public global::System.Decimal AvgBattleLifeTimeInMinutes { get; } + + /// + /// Damage coefficient + /// + public global::System.Decimal DamageCoefficient { get; } + + /// + /// Rate of survival + /// + public global::System.Decimal SurvivalRate { get; } + + public virtual global::System.Boolean Equals(Player_AccountInfo_Tanks_TankInfoResponse? other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + if (ReferenceEquals(this, other)) + { + return true; + } + + if (other.GetType() != GetType()) + { + return false; + } + + return (TankId == other.TankId) && ((Name is null && other.Name is null) || Name != null && Name.Equals(other.Name)) && ((TankNation is null && other.TankNation is null) || TankNation != null && TankNation.Equals(other.TankNation)) && ((TankType is null && other.TankType is null) || TankType != null && TankType.Equals(other.TankType)) && Tier == other.Tier && IsPremium == other.IsPremium && LastBattleTime.Equals(other.LastBattleTime) && Battles == other.Battles && WinRate == other.WinRate && AvgDamage == other.AvgDamage && AvgXp == other.AvgXp && AvgBattleLifeTimeInMinutes == other.AvgBattleLifeTimeInMinutes && DamageCoefficient == other.DamageCoefficient && SurvivalRate == other.SurvivalRate; + } + + public override global::System.Boolean Equals(global::System.Object? obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((Player_AccountInfo_Tanks_TankInfoResponse)obj); + } + + public override global::System.Int32 GetHashCode() + { + unchecked + { + int hash = 5; + hash ^= 397 * TankId.GetHashCode(); + if (Name != null) + { + hash ^= 397 * Name.GetHashCode(); + } + + if (TankNation != null) + { + hash ^= 397 * TankNation.GetHashCode(); + } + + if (TankType != null) + { + hash ^= 397 * TankType.GetHashCode(); + } + + hash ^= 397 * Tier.GetHashCode(); + hash ^= 397 * IsPremium.GetHashCode(); + hash ^= 397 * LastBattleTime.GetHashCode(); + hash ^= 397 * Battles.GetHashCode(); + hash ^= 397 * WinRate.GetHashCode(); + hash ^= 397 * AvgDamage.GetHashCode(); + hash ^= 397 * AvgXp.GetHashCode(); + hash ^= 397 * AvgBattleLifeTimeInMinutes.GetHashCode(); + hash ^= 397 * DamageCoefficient.GetHashCode(); + hash ^= 397 * SurvivalRate.GetHashCode(); + return hash; + } + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/AccountInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/AccountInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..aee87b7 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/AccountInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,65 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + ///Information about player + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class AccountInfoResponseData + { + public AccountInfoResponseData(global::System.String __typename, global::System.Int64? accountId = default !, global::System.String? nickname = default !, global::System.DateTimeOffset? createdAt = default !, global::System.DateTimeOffset? lastBattleTime = default !, global::System.Int64? battles = default !, global::System.Decimal? winRate = default !, global::System.Decimal? avgDamage = default !, global::System.Decimal? avgXp = default !, global::System.Double? avgTier = default !, global::System.Decimal? damageCoefficient = default !, global::System.Decimal? survivalRate = default !, global::System.Collections.Generic.IReadOnlyList? tanks = default !) + { + this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename)); + AccountId = accountId; + Nickname = nickname; + CreatedAt = createdAt; + LastBattleTime = lastBattleTime; + Battles = battles; + WinRate = winRate; + AvgDamage = avgDamage; + AvgXp = avgXp; + AvgTier = avgTier; + DamageCoefficient = damageCoefficient; + SurvivalRate = survivalRate; + Tanks = tanks; + } + + public global::System.String __typename { get; } + + ///Player account identifier + public global::System.Int64? AccountId { get; } + + ///Player's nick + public global::System.String? Nickname { get; } + + ///Account creation date + public global::System.DateTimeOffset? CreatedAt { get; } + + ///Last battle time + public global::System.DateTimeOffset? LastBattleTime { get; } + + ///Battles count + public global::System.Int64? Battles { get; } + + ///Player's win rate + public global::System.Decimal? WinRate { get; } + + ///Player's average damage + public global::System.Decimal? AvgDamage { get; } + + ///Player's average XP + public global::System.Decimal? AvgXp { get; } + + ///Average tier + public global::System.Double? AvgTier { get; } + + ///Damage coefficient + public global::System.Decimal? DamageCoefficient { get; } + + ///Rate of survival + public global::System.Decimal? SurvivalRate { get; } + + ///All player's tanks + public global::System.Collections.Generic.IReadOnlyList? Tanks { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..8370a45 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,201 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerBuilder : global::StrawberryShake.IOperationResultBuilder + { + private readonly global::StrawberryShake.IEntityStore _entityStore; + private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer; + private readonly global::StrawberryShake.IOperationResultDataFactory _resultDataFactory; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _realmTypeParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _requestLanguageParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _longParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _stringParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _dateTimeParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _decimalParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _floatParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _intParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _booleanParser; + public PlayerBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) + { + _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); + _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer)); + _resultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory)); + _realmTypeParser = serializerResolver.GetLeafValueParser("RealmType") ?? throw new global::System.ArgumentException("No serializer for type `RealmType` found."); + _requestLanguageParser = serializerResolver.GetLeafValueParser("RequestLanguage") ?? throw new global::System.ArgumentException("No serializer for type `RequestLanguage` found."); + _longParser = serializerResolver.GetLeafValueParser("Long") ?? throw new global::System.ArgumentException("No serializer for type `Long` found."); + _stringParser = serializerResolver.GetLeafValueParser("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found."); + _dateTimeParser = serializerResolver.GetLeafValueParser("DateTime") ?? throw new global::System.ArgumentException("No serializer for type `DateTime` found."); + _decimalParser = serializerResolver.GetLeafValueParser("Decimal") ?? throw new global::System.ArgumentException("No serializer for type `Decimal` found."); + _floatParser = serializerResolver.GetLeafValueParser("Float") ?? throw new global::System.ArgumentException("No serializer for type `Float` found."); + _intParser = serializerResolver.GetLeafValueParser("Int") ?? throw new global::System.ArgumentException("No serializer for type `Int` found."); + _booleanParser = serializerResolver.GetLeafValueParser("Boolean") ?? throw new global::System.ArgumentException("No serializer for type `Boolean` found."); + } + + public global::StrawberryShake.IOperationResult Build(global::StrawberryShake.Response response) + { + (IPlayerResult Result, PlayerResultInfo Info)? data = null; + global::System.Collections.Generic.IReadOnlyList? errors = null; + if (response.Exception is null) + { + try + { + if (response.Body != null) + { + if (response.Body.RootElement.TryGetProperty("data", out global::System.Text.Json.JsonElement dataElement) && dataElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + data = BuildData(dataElement); + } + + if (response.Body.RootElement.TryGetProperty("errors", out global::System.Text.Json.JsonElement errorsElement)) + { + errors = global::StrawberryShake.Json.JsonErrorParser.ParseErrors(errorsElement); + } + } + } + catch (global::System.Exception ex) + { + errors = new global::StrawberryShake.IClientError[]{new global::StrawberryShake.ClientError(ex.Message, exception: ex, extensions: new global::System.Collections.Generic.Dictionary{{"body", response.Body?.RootElement.ToString()}})}; + } + } + else + { + errors = new global::StrawberryShake.IClientError[]{new global::StrawberryShake.ClientError(response.Exception.Message, exception: response.Exception, extensions: new global::System.Collections.Generic.Dictionary{{"body", response.Body?.RootElement.ToString()}})}; + } + + return new global::StrawberryShake.OperationResult(data?.Result, data?.Info, _resultDataFactory, errors); + } + + private (IPlayerResult, PlayerResultInfo) BuildData(global::System.Text.Json.JsonElement obj) + { + var entityIds = new global::System.Collections.Generic.HashSet(); + global::StrawberryShake.IEntityStoreSnapshot snapshot = default !; + _entityStore.Update(session => + { + snapshot = session.CurrentSnapshot; + }); + var resultInfo = new PlayerResultInfo(DeserializeNonNullableIPlayer_AccountInfo(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountInfo")), entityIds, snapshot.Version); + return (_resultDataFactory.Create(resultInfo), resultInfo); + } + + private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData DeserializeNonNullableIPlayer_AccountInfo(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + var typename = obj.Value.GetProperty("__typename").GetString(); + if (typename?.Equals("AccountInfoResponse", global::System.StringComparison.Ordinal) ?? false) + { + return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData(typename, accountId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountId")), nickname: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "nickname")), createdAt: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "createdAt")), lastBattleTime: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastBattleTime")), battles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battles")), winRate: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "winRate")), avgDamage: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgDamage")), avgXp: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgXp")), avgTier: DeserializeNonNullableDouble(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgTier")), damageCoefficient: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageCoefficient")), survivalRate: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "survivalRate")), tanks: DeserializeIPlayer_AccountInfo_TanksNonNullableArray(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tanks"))); + } + + throw new global::System.NotSupportedException(); + } + + private global::System.Int64 DeserializeNonNullableInt64(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _longParser.Parse(obj.Value.GetInt64()!); + } + + private global::System.String? DeserializeString(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + return null; + } + + return _stringParser.Parse(obj.Value.GetString()!); + } + + private global::System.DateTimeOffset DeserializeNonNullableDateTimeOffset(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _dateTimeParser.Parse(obj.Value.GetString()!); + } + + private global::System.Decimal DeserializeNonNullableDecimal(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _decimalParser.Parse(obj.Value.GetDecimal()!); + } + + private global::System.Double DeserializeNonNullableDouble(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _floatParser.Parse(obj.Value.GetDouble()!); + } + + private global::System.Collections.Generic.IReadOnlyList? DeserializeIPlayer_AccountInfo_TanksNonNullableArray(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + return null; + } + + var tankInfoResponses = new global::System.Collections.Generic.List(); + foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray()) + { + tankInfoResponses.Add(DeserializeNonNullableIPlayer_AccountInfo_Tanks(child)); + } + + return tankInfoResponses; + } + + private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData DeserializeNonNullableIPlayer_AccountInfo_Tanks(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + var typename = obj.Value.GetProperty("__typename").GetString(); + if (typename?.Equals("TankInfoResponse", global::System.StringComparison.Ordinal) ?? false) + { + return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData(typename, tankId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankId")), name: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), tankNation: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankNation")), tankType: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankType")), tier: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tier")), isPremium: DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isPremium")), lastBattleTime: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastBattleTime")), battles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battles")), winRate: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "winRate")), avgDamage: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgDamage")), avgXp: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgXp")), avgBattleLifeTimeInMinutes: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgBattleLifeTimeInMinutes")), damageCoefficient: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageCoefficient")), survivalRate: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "survivalRate"))); + } + + throw new global::System.NotSupportedException(); + } + + private global::System.Int32 DeserializeNonNullableInt32(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _intParser.Parse(obj.Value.GetInt32()!); + } + + private global::System.Boolean DeserializeNonNullableBoolean(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _booleanParser.Parse(obj.Value.GetBoolean()!); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..b8e3ebb --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,82 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerResultFactory : global::StrawberryShake.IOperationResultDataFactory + { + private readonly global::StrawberryShake.IEntityStore _entityStore; + public PlayerResultFactory(global::StrawberryShake.IEntityStore entityStore) + { + _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); + } + + global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerResult); + public PlayerResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) + { + if (snapshot is null) + { + snapshot = _entityStore.CurrentSnapshot; + } + + if (dataInfo is PlayerResultInfo info) + { + return new PlayerResult(MapNonNullableIPlayer_AccountInfo(info.AccountInfo, snapshot)); + } + + throw new global::System.ArgumentException("PlayerResultInfo expected."); + } + + private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo MapNonNullableIPlayer_AccountInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) + { + IPlayer_AccountInfo returnValue = default !; + if (data.__typename.Equals("AccountInfoResponse", global::System.StringComparison.Ordinal)) + { + returnValue = new Player_AccountInfo_AccountInfoResponse(data.AccountId ?? throw new global::System.ArgumentNullException(), data.Nickname, data.CreatedAt ?? throw new global::System.ArgumentNullException(), data.LastBattleTime ?? throw new global::System.ArgumentNullException(), data.Battles ?? throw new global::System.ArgumentNullException(), data.WinRate ?? throw new global::System.ArgumentNullException(), data.AvgDamage ?? throw new global::System.ArgumentNullException(), data.AvgXp ?? throw new global::System.ArgumentNullException(), data.AvgTier ?? throw new global::System.ArgumentNullException(), data.DamageCoefficient ?? throw new global::System.ArgumentNullException(), data.SurvivalRate ?? throw new global::System.ArgumentNullException(), MapIPlayer_AccountInfo_TanksNonNullableArray(data.Tanks, snapshot)); + } + else + { + throw new global::System.NotSupportedException(); + } + + return returnValue; + } + + private global::System.Collections.Generic.IReadOnlyList? MapIPlayer_AccountInfo_TanksNonNullableArray(global::System.Collections.Generic.IReadOnlyList? list, global::StrawberryShake.IEntityStoreSnapshot snapshot) + { + if (list is null) + { + return null; + } + + var tankInfoResponses = new global::System.Collections.Generic.List(); + foreach (global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData child in list) + { + tankInfoResponses.Add(MapNonNullableIPlayer_AccountInfo_Tanks(child, snapshot)); + } + + return tankInfoResponses; + } + + private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_Tanks MapNonNullableIPlayer_AccountInfo_Tanks(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) + { + IPlayer_AccountInfo_Tanks returnValue = default !; + if (data.__typename.Equals("TankInfoResponse", global::System.StringComparison.Ordinal)) + { + returnValue = new Player_AccountInfo_Tanks_TankInfoResponse(data.TankId ?? throw new global::System.ArgumentNullException(), data.Name, data.TankNation, data.TankType, data.Tier ?? throw new global::System.ArgumentNullException(), data.IsPremium ?? throw new global::System.ArgumentNullException(), data.LastBattleTime ?? throw new global::System.ArgumentNullException(), data.Battles ?? throw new global::System.ArgumentNullException(), data.WinRate ?? throw new global::System.ArgumentNullException(), data.AvgDamage ?? throw new global::System.ArgumentNullException(), data.AvgXp ?? throw new global::System.ArgumentNullException(), data.AvgBattleLifeTimeInMinutes ?? throw new global::System.ArgumentNullException(), data.DamageCoefficient ?? throw new global::System.ArgumentNullException(), data.SurvivalRate ?? throw new global::System.ArgumentNullException()); + } + else + { + throw new global::System.NotSupportedException(); + } + + return returnValue; + } + + global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot) + { + return Create(dataInfo, snapshot); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..4066081 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/PlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,30 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class PlayerResultInfo : global::StrawberryShake.IOperationResultDataInfo + { + private readonly global::System.Collections.Generic.IReadOnlyCollection _entityIds; + private readonly global::System.UInt64 _version; + public PlayerResultInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData accountInfo, global::System.Collections.Generic.IReadOnlyCollection entityIds, global::System.UInt64 version) + { + AccountInfo = accountInfo; + _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds)); + _version = version; + } + + /// + /// Gathers all account information + /// + public global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData AccountInfo { get; } + + public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; + public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) + { + return new PlayerResultInfo(AccountInfo, _entityIds, version); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/TankInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/TankInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..f979fc6 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/TankInfoResponseData.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,73 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + ///Information about player's tank + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class TankInfoResponseData + { + public TankInfoResponseData(global::System.String __typename, global::System.Int64? tankId = default !, global::System.String? name = default !, global::System.String? tankNation = default !, global::System.String? tankType = default !, global::System.Int32? tier = default !, global::System.Boolean? isPremium = default !, global::System.DateTimeOffset? lastBattleTime = default !, global::System.Int64? battles = default !, global::System.Decimal? winRate = default !, global::System.Decimal? avgDamage = default !, global::System.Decimal? avgXp = default !, global::System.Decimal? avgBattleLifeTimeInMinutes = default !, global::System.Decimal? damageCoefficient = default !, global::System.Decimal? survivalRate = default !) + { + this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename)); + TankId = tankId; + Name = name; + TankNation = tankNation; + TankType = tankType; + Tier = tier; + IsPremium = isPremium; + LastBattleTime = lastBattleTime; + Battles = battles; + WinRate = winRate; + AvgDamage = avgDamage; + AvgXp = avgXp; + AvgBattleLifeTimeInMinutes = avgBattleLifeTimeInMinutes; + DamageCoefficient = damageCoefficient; + SurvivalRate = survivalRate; + } + + public global::System.String __typename { get; } + + ///Tank identifier + public global::System.Int64? TankId { get; } + + ///Tank name + public global::System.String? Name { get; } + + ///Localized tank nation name + public global::System.String? TankNation { get; } + + ///Localized tank type name + public global::System.String? TankType { get; } + + ///Tank tier + public global::System.Int32? Tier { get; } + + ///Is it premium tank or not + public global::System.Boolean? IsPremium { get; } + + ///Last battle + public global::System.DateTimeOffset? LastBattleTime { get; } + + ///Battles count + public global::System.Int64? Battles { get; } + + ///Tank's win rate + public global::System.Decimal? WinRate { get; } + + ///Average tank's damage + public global::System.Decimal? AvgDamage { get; } + + ///Average XP + public global::System.Decimal? AvgXp { get; } + + ///Average life time in battle until tank is killed. + public global::System.Decimal? AvgBattleLifeTimeInMinutes { get; } + + ///Damage coefficient + public global::System.Decimal? DamageCoefficient { get; } + + ///Rate of survival + public global::System.Decimal? SurvivalRate { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs index 462af8b..19c8e45 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -9,16 +9,19 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] public partial class WotBlitzStatisticsProClient : global::WotBlitzStatisticsPro.Blazor.GraphQl.IWotBlitzStatisticsProClient { - private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery _findPlayers; private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery _findClans; - public WotBlitzStatisticsProClient(global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery findPlayers, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery findClans) + private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery _findPlayers; + private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery _player; + public WotBlitzStatisticsProClient(global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery findClans, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery findPlayers, global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery player) { - _findPlayers = findPlayers ?? throw new global::System.ArgumentNullException(nameof(findPlayers)); _findClans = findClans ?? throw new global::System.ArgumentNullException(nameof(findClans)); + _findPlayers = findPlayers ?? throw new global::System.ArgumentNullException(nameof(findPlayers)); + _player = player ?? throw new global::System.ArgumentNullException(nameof(player)); } public static global::System.String ClientName => "WotBlitzStatisticsProClient"; - public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery FindPlayers => _findPlayers; public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery FindClans => _findClans; + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery FindPlayers => _findPlayers; + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player => _player; } } diff --git a/WotBlitzStatisticsPro.Blazor/graphql/PlayerInfo.graphql b/WotBlitzStatisticsPro.Blazor/graphql/PlayerInfo.graphql new file mode 100644 index 0000000..0fe3cdb --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/graphql/PlayerInfo.graphql @@ -0,0 +1,37 @@ +query player( + $accountId: Long!, + $realmType: RealmType!, + $requestLanguage: RequestLanguage! ) { + accountInfo( + accountId: $accountId, + realmType: $realmType, + requestLanguage: $requestLanguage) { + accountId + nickname + createdAt + lastBattleTime + battles + winRate + avgDamage + avgXp + avgTier + damageCoefficient + survivalRate + tanks { + tankId + name + tankNation + tankType + tier + isPremium + lastBattleTime + battles + winRate + avgDamage + avgXp + avgBattleLifeTimeInMinutes + damageCoefficient + survivalRate + } + } +} \ No newline at end of file