Files
WotBlitzStatisticsBlazor/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.StrawberryShake.cs
T

1043 lines
60 KiB
C#

// <auto-generated/>
#nullable enable
namespace Microsoft.Extensions.DependencyInjection
{
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public static partial class WotBlitzStatisticsProClientServiceCollectionExtensions
{
public static global::StrawberryShake.IClientBuilder<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.WotBlitzStatisticsProClientStoreAccessor> AddWotBlitzStatisticsProClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
{
var serviceCollection = new global::Microsoft.Extensions.DependencyInjection.ServiceCollection();
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp =>
{
ConfigureClientDefault(sp, serviceCollection, strategy);
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::StrawberryShake.IOperationStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityIdSerializer>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp))));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.FindAccountsQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.WotBlitzStatisticsProClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.IWotBlitzStatisticsProClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
return new global::StrawberryShake.ClientBuilder<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.WotBlitzStatisticsProClientStoreAccessor>("WotBlitzStatisticsProClient", services, serviceCollection);
}
private static global::Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureClientDefault(global::System.IServiceProvider parentServices, global::Microsoft.Extensions.DependencyInjection.ServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
{
global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IEntityStore, global::StrawberryShake.EntityStore>(services);
global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IOperationStore>(services, sp => new global::StrawberryShake.OperationStore(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(sp)));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Transport.Http.IHttpConnection>(services, sp =>
{
var clientFactory = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Net.Http.IHttpClientFactory>(parentServices);
return new global::StrawberryShake.Transport.Http.HttpConnection(() => clientFactory.CreateClient("WotBlitzStatisticsProClient"));
});
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmTypeSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguageSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.StringSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.BooleanSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ShortSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IntSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LongSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.FloatSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DecimalSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UrlSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UuidSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IdSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateTimeSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteArraySerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.TimeSpanSerializer>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializerResolver>(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(sp))));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindAccountsResultFactory>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>>(sp));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationRequestFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery>(sp));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindAccountsBuilder>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationExecutor<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>>(services, sp => new global::StrawberryShake.OperationExecutor<global::System.Text.Json.JsonDocument, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.Transport.Http.IHttpConnection>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(sp), strategy));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::WotBlitzStatisticsPro.Blazor.GraphQl.FindAccountsQuery>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.FindAccountsQuery>(sp));
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityIdSerializer, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.WotBlitzStatisticsProClientEntityIdFactory>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::WotBlitzStatisticsPro.Blazor.GraphQl.WotBlitzStatisticsProClient>(services);
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::WotBlitzStatisticsPro.Blazor.GraphQl.IWotBlitzStatisticsProClient>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::WotBlitzStatisticsPro.Blazor.GraphQl.WotBlitzStatisticsProClient>(sp));
return services;
}
private class ClientServiceProvider : System.IServiceProvider, System.IDisposable
{
private readonly System.IServiceProvider _provider;
public ClientServiceProvider(System.IServiceProvider provider)
{
_provider = provider;
}
public object? GetService(System.Type serviceType)
{
return _provider.GetService(serviceType);
}
public void Dispose()
{
if (_provider is System.IDisposable d)
{
d.Dispose();
}
}
}
}
}
namespace WotBlitzStatisticsPro.Blazor.GraphQl
{
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsResult : global::System.IEquatable<FindAccountsResult>, IFindAccountsResult
{
public FindAccountsResult(global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts findAccounts)
{
FindAccounts = findAccounts;
}
/// <summary>
/// Finds Wargaming accounts by nick
/// </summary>
public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts FindAccounts { get; }
public virtual global::System.Boolean Equals(FindAccountsResult? other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (other.GetType() != GetType())
{
return false;
}
return (FindAccounts.Equals(other.FindAccounts));
}
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((FindAccountsResult)obj);
}
public override global::System.Int32 GetHashCode()
{
unchecked
{
int hash = 5;
hash ^= 397 * FindAccounts.GetHashCode();
return hash;
}
}
}
/// <summary>
/// Response contains a list of found accounts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccounts_FindAccounts_AccountsSearchResponse : global::System.IEquatable<FindAccounts_FindAccounts_AccountsSearchResponse>, IFindAccounts_FindAccounts_AccountsSearchResponse
{
public FindAccounts_FindAccounts_AccountsSearchResponse(global::System.Int32 accountsCount, global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts>? accounts)
{
AccountsCount = accountsCount;
Accounts = accounts;
}
/// <summary>
/// Count of found accounts
/// </summary>
public global::System.Int32 AccountsCount { get; }
/// <summary>
/// Found accounts list
/// </summary>
public global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts>? Accounts { get; }
public virtual global::System.Boolean Equals(FindAccounts_FindAccounts_AccountsSearchResponse? other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (other.GetType() != GetType())
{
return false;
}
return (AccountsCount == other.AccountsCount) && global::StrawberryShake.Helper.ComparisonHelper.SequenceEqual(Accounts, other.Accounts);
}
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((FindAccounts_FindAccounts_AccountsSearchResponse)obj);
}
public override global::System.Int32 GetHashCode()
{
unchecked
{
int hash = 5;
hash ^= 397 * AccountsCount.GetHashCode();
if (Accounts != null)
{
foreach (var Accounts_elm in Accounts)
{
hash ^= 397 * Accounts_elm.GetHashCode();
}
}
return hash;
}
}
}
/// <summary>
/// Account search result item
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem : global::System.IEquatable<FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem>, IFindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem
{
public FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem(global::System.Int64 accountId, global::System.String? nickname, global::System.String? clanTag, global::System.DateTimeOffset lastBattle, global::System.Int64 battlesCount, global::System.Int32 winRate)
{
AccountId = accountId;
Nickname = nickname;
ClanTag = clanTag;
LastBattle = lastBattle;
BattlesCount = battlesCount;
WinRate = winRate;
}
/// <summary>
/// Player accountId
/// </summary>
public global::System.Int64 AccountId { get; }
/// <summary>
/// Player nick
/// </summary>
public global::System.String? Nickname { get; }
/// <summary>
/// Clan tag. Null if player doesn't have clan membership
/// </summary>
public global::System.String? ClanTag { get; }
/// <summary>
/// Last battle time
/// </summary>
public global::System.DateTimeOffset LastBattle { get; }
/// <summary>
/// Player's battles count
/// </summary>
public global::System.Int64 BattlesCount { get; }
/// <summary>
/// Win rate from 0 to 100
/// </summary>
public global::System.Int32 WinRate { get; }
public virtual global::System.Boolean Equals(FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem? 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)) && ((ClanTag is null && other.ClanTag is null) || ClanTag != null && ClanTag.Equals(other.ClanTag)) && LastBattle.Equals(other.LastBattle) && BattlesCount == other.BattlesCount && WinRate == other.WinRate;
}
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((FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem)obj);
}
public override global::System.Int32 GetHashCode()
{
unchecked
{
int hash = 5;
hash ^= 397 * AccountId.GetHashCode();
if (Nickname != null)
{
hash ^= 397 * Nickname.GetHashCode();
}
if (ClanTag != null)
{
hash ^= 397 * ClanTag.GetHashCode();
}
hash ^= 397 * LastBattle.GetHashCode();
hash ^= 397 * BattlesCount.GetHashCode();
hash ^= 397 * WinRate.GetHashCode();
return hash;
}
}
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccountsResult
{
/// <summary>
/// Finds Wargaming accounts by nick
/// </summary>
public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts FindAccounts { get; }
}
/// <summary>
/// Response contains a list of found accounts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccounts_FindAccounts
{
/// <summary>
/// Count of found accounts
/// </summary>
public global::System.Int32 AccountsCount { get; }
/// <summary>
/// Found accounts list
/// </summary>
public global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts>? Accounts { get; }
}
/// <summary>
/// Response contains a list of found accounts
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccounts_FindAccounts_AccountsSearchResponse : IFindAccounts_FindAccounts
{
}
/// <summary>
/// Account search result item
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccounts_FindAccounts_Accounts
{
/// <summary>
/// Player accountId
/// </summary>
public global::System.Int64 AccountId { get; }
/// <summary>
/// Player nick
/// </summary>
public global::System.String? Nickname { get; }
/// <summary>
/// Clan tag. Null if player doesn't have clan membership
/// </summary>
public global::System.String? ClanTag { get; }
/// <summary>
/// Last battle time
/// </summary>
public global::System.DateTimeOffset LastBattle { get; }
/// <summary>
/// Player's battles count
/// </summary>
public global::System.Int64 BattlesCount { get; }
/// <summary>
/// Win rate from 0 to 100
/// </summary>
public global::System.Int32 WinRate { get; }
}
/// <summary>
/// Account search result item
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem : IFindAccounts_FindAccounts_Accounts
{
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public enum RealmType
{
/// <summary>
/// Russian region
/// </summary>
Ru,
/// <summary>
/// European region
/// </summary>
Eu,
/// <summary>
/// North America
/// </summary>
Na,
/// <summary>
/// Asian region
/// </summary>
Asia
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class RealmTypeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, RealmType>
{
public global::System.String TypeName => "RealmType";
public RealmType Parse(global::System.String serializedValue)
{
return serializedValue switch
{
"RU" => RealmType.Ru, "EU" => RealmType.Eu, "NA" => RealmType.Na, "ASIA" => RealmType.Asia, _ => throw new global::StrawberryShake.GraphQLClientException()}
;
}
public global::System.Object Format(global::System.Object? runtimeValue)
{
return runtimeValue switch
{
RealmType.Ru => "RU", RealmType.Eu => "EU", RealmType.Na => "NA", RealmType.Asia => "ASIA", _ => throw new global::StrawberryShake.GraphQLClientException()}
;
}
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public enum RequestLanguage
{
/// <summary>
/// Русский
/// </summary>
Ru,
/// <summary>
/// English
/// </summary>
En,
/// <summary>
/// Deutsch
/// </summary>
De
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class RequestLanguageSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, RequestLanguage>
{
public global::System.String TypeName => "RequestLanguage";
public RequestLanguage Parse(global::System.String serializedValue)
{
return serializedValue switch
{
"RU" => RequestLanguage.Ru, "EN" => RequestLanguage.En, "DE" => RequestLanguage.De, _ => throw new global::StrawberryShake.GraphQLClientException()}
;
}
public global::System.Object Format(global::System.Object? runtimeValue)
{
return runtimeValue switch
{
RequestLanguage.Ru => "RU", RequestLanguage.En => "EN", RequestLanguage.De => "DE", _ => throw new global::StrawberryShake.GraphQLClientException()}
;
}
}
/// <summary>
/// Represents the operation service of the FindAccounts GraphQL operation
/// <code>
/// query FindAccounts($accountNick: String!, $realmType: RealmType!, $language: RequestLanguage!) {
/// findAccounts(accountNick: $accountNick, realmType: $realmType, language: $language) {
/// __typename
/// accountsCount
/// accounts {
/// __typename
/// accountId
/// nickname
/// clanTag
/// lastBattle
/// battlesCount
/// winRate
/// }
/// }
/// }
/// </code>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsQueryDocument : global::StrawberryShake.IDocument
{
private FindAccountsQueryDocument()
{
}
public static FindAccountsQueryDocument Instance { get; } = new FindAccountsQueryDocument();
public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query;
public global::System.ReadOnlySpan<global::System.Byte> Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x28, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x69, 0x63, 0x6b, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 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, 0x6c, 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, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x28, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x69, 0x63, 0x6b, 0x3a, 0x20, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x69, 0x63, 0x6b, 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, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x24, 0x6c, 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, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 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, 0x6c, 0x61, 0x6e, 0x54, 0x61, 0x67, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d};
public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "16176c723580b497e58132294922a157");
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
}
}
/// <summary>
/// Represents the operation service of the FindAccounts GraphQL operation
/// <code>
/// query FindAccounts($accountNick: String!, $realmType: RealmType!, $language: RequestLanguage!) {
/// findAccounts(accountNick: $accountNick, realmType: $realmType, language: $language) {
/// __typename
/// accountsCount
/// accounts {
/// __typename
/// accountId
/// nickname
/// clanTag
/// lastBattle
/// battlesCount
/// winRate
/// }
/// }
/// }
/// </code>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsQuery : global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery
{
private readonly global::StrawberryShake.IOperationExecutor<IFindAccountsResult> _operationExecutor;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _realmTypeFormatter;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _requestLanguageFormatter;
public FindAccountsQuery(global::StrawberryShake.IOperationExecutor<IFindAccountsResult> operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
{
_operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor));
_stringFormatter = serializerResolver.GetInputValueFormatter("String");
_realmTypeFormatter = serializerResolver.GetInputValueFormatter("RealmType");
_requestLanguageFormatter = serializerResolver.GetInputValueFormatter("RequestLanguage");
}
global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IFindAccountsResult);
public async global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<IFindAccountsResult>> ExecuteAsync(global::System.String accountNick, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::System.Threading.CancellationToken cancellationToken = default)
{
var request = CreateRequest(accountNick, realmType, language);
return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
}
public global::System.IObservable<global::StrawberryShake.IOperationResult<IFindAccountsResult>> Watch(global::System.String accountNick, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::StrawberryShake.ExecutionStrategy? strategy = null)
{
var request = CreateRequest(accountNick, realmType, language);
return _operationExecutor.Watch(request, strategy);
}
private global::StrawberryShake.OperationRequest CreateRequest(global::System.String accountNick, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language)
{
var variables = new global::System.Collections.Generic.Dictionary<global::System.String, global::System.Object?>();
variables.Add("accountNick", FormatAccountNick(accountNick));
variables.Add("realmType", FormatRealmType(realmType));
variables.Add("language", FormatLanguage(language));
return CreateRequest(variables);
}
private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
{
return new global::StrawberryShake.OperationRequest(id: FindAccountsQueryDocument.Instance.Hash.Value, name: "FindAccounts", document: FindAccountsQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, variables: variables);
}
private global::System.Object? FormatAccountNick(global::System.String value)
{
if (value is null)
{
throw new global::System.ArgumentNullException(nameof(value));
}
return _stringFormatter.Format(value);
}
private global::System.Object? FormatRealmType(global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType value)
{
return _realmTypeFormatter.Format(value);
}
private global::System.Object? FormatLanguage(global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage value)
{
return _requestLanguageFormatter.Format(value);
}
global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
{
return CreateRequest(variables!);
}
}
/// <summary>
/// Represents the operation service of the FindAccounts GraphQL operation
/// <code>
/// query FindAccounts($accountNick: String!, $realmType: RealmType!, $language: RequestLanguage!) {
/// findAccounts(accountNick: $accountNick, realmType: $realmType, language: $language) {
/// __typename
/// accountsCount
/// accounts {
/// __typename
/// accountId
/// nickname
/// clanTag
/// lastBattle
/// battlesCount
/// winRate
/// }
/// }
/// }
/// </code>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IFindAccountsQuery : global::StrawberryShake.IOperationRequestFactory
{
global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<IFindAccountsResult>> ExecuteAsync(global::System.String accountNick, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::System.Threading.CancellationToken cancellationToken = default);
global::System.IObservable<global::StrawberryShake.IOperationResult<IFindAccountsResult>> Watch(global::System.String accountNick, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::StrawberryShake.ExecutionStrategy? strategy = null);
}
/// <summary>
/// Represents the WotBlitzStatisticsProClient GraphQL client
/// </summary>
[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.IFindAccountsQuery _findAccounts;
public WotBlitzStatisticsProClient(global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery findAccounts)
{
_findAccounts = findAccounts ?? throw new global::System.ArgumentNullException(nameof(findAccounts));
}
public static global::System.String ClientName => "WotBlitzStatisticsProClient";
public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery FindAccounts => _findAccounts;
}
/// <summary>
/// Represents the WotBlitzStatisticsProClient GraphQL client
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public interface IWotBlitzStatisticsProClient
{
global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsQuery FindAccounts { get; }
}
}
namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
{
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.FindAccountsResult>
{
private readonly global::StrawberryShake.IEntityStore _entityStore;
public FindAccountsResultFactory(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.IFindAccountsResult);
public FindAccountsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
{
if (snapshot is null)
{
snapshot = _entityStore.CurrentSnapshot;
}
if (dataInfo is FindAccountsResultInfo info)
{
return new FindAccountsResult(MapNonNullableIFindAccounts_FindAccounts(info.FindAccounts, snapshot));
}
throw new global::System.ArgumentException("FindAccountsResultInfo expected.");
}
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts MapNonNullableIFindAccounts_FindAccounts(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
{
IFindAccounts_FindAccounts returnValue = default !;
if (data.__typename.Equals("AccountsSearchResponse", global::System.StringComparison.Ordinal))
{
returnValue = new FindAccounts_FindAccounts_AccountsSearchResponse(data.AccountsCount ?? throw new global::System.ArgumentNullException(), MapIFindAccounts_FindAccounts_AccountsNonNullableArray(data.Accounts, snapshot));
}
else
{
throw new global::System.NotSupportedException();
}
return returnValue;
}
private global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts>? MapIFindAccounts_FindAccounts_AccountsNonNullableArray(global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>? list, global::StrawberryShake.IEntityStoreSnapshot snapshot)
{
if (list is null)
{
return null;
}
var accountsSearchResponseItems = new global::System.Collections.Generic.List<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts>();
foreach (global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData child in list)
{
accountsSearchResponseItems.Add(MapNonNullableIFindAccounts_FindAccounts_Accounts(child, snapshot));
}
return accountsSearchResponseItems;
}
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccounts_FindAccounts_Accounts MapNonNullableIFindAccounts_FindAccounts_Accounts(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
{
IFindAccounts_FindAccounts_Accounts returnValue = default !;
if (data.__typename.Equals("AccountsSearchResponseItem", global::System.StringComparison.Ordinal))
{
returnValue = new FindAccounts_FindAccounts_Accounts_AccountsSearchResponseItem(data.AccountId ?? throw new global::System.ArgumentNullException(), data.Nickname, data.ClanTag, data.LastBattle ?? throw new global::System.ArgumentNullException(), data.BattlesCount ?? throw new global::System.ArgumentNullException(), data.WinRate ?? 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);
}
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsResultInfo : global::StrawberryShake.IOperationResultDataInfo
{
private readonly global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> _entityIds;
private readonly global::System.UInt64 _version;
public FindAccountsResultInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseData findAccounts, global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
{
FindAccounts = findAccounts;
_entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
_version = version;
}
/// <summary>
/// Finds Wargaming accounts by nick
/// </summary>
public global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseData FindAccounts { get; }
public global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> EntityIds => _entityIds;
public global::System.UInt64 Version => _version;
public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
{
return new FindAccountsResultInfo(FindAccounts, _entityIds, version);
}
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindAccountsBuilder : global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult>
{
private readonly global::StrawberryShake.IEntityStore _entityStore;
private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer;
private readonly global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult> _resultDataFactory;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType> _realmTypeParser;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage> _requestLanguageParser;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::System.String> _stringParser;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.Int32, global::System.Int32> _intParser;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.Int64, global::System.Int64> _longParser;
private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::System.DateTimeOffset> _dateTimeParser;
public FindAccountsBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindAccountsResult> 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<global::System.String, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType>("RealmType") ?? throw new global::System.ArgumentException("No serializer for type `RealmType` found.");
_requestLanguageParser = serializerResolver.GetLeafValueParser<global::System.String, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage>("RequestLanguage") ?? throw new global::System.ArgumentException("No serializer for type `RequestLanguage` found.");
_stringParser = serializerResolver.GetLeafValueParser<global::System.String, global::System.String>("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found.");
_intParser = serializerResolver.GetLeafValueParser<global::System.Int32, global::System.Int32>("Int") ?? throw new global::System.ArgumentException("No serializer for type `Int` found.");
_longParser = serializerResolver.GetLeafValueParser<global::System.Int64, global::System.Int64>("Long") ?? throw new global::System.ArgumentException("No serializer for type `Long` found.");
_dateTimeParser = serializerResolver.GetLeafValueParser<global::System.String, global::System.DateTimeOffset>("DateTime") ?? throw new global::System.ArgumentException("No serializer for type `DateTime` found.");
}
public global::StrawberryShake.IOperationResult<IFindAccountsResult> Build(global::StrawberryShake.Response<global::System.Text.Json.JsonDocument> response)
{
(IFindAccountsResult Result, FindAccountsResultInfo Info)? data = null;
global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.IClientError>? 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<global::System.String, global::System.Object?>{{"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<global::System.String, global::System.Object?>{{"body", response.Body?.RootElement.ToString()}})};
}
return new global::StrawberryShake.OperationResult<IFindAccountsResult>(data?.Result, data?.Info, _resultDataFactory, errors);
}
private (IFindAccountsResult, FindAccountsResultInfo) BuildData(global::System.Text.Json.JsonElement obj)
{
var entityIds = new global::System.Collections.Generic.HashSet<global::StrawberryShake.EntityId>();
global::StrawberryShake.IEntityStoreSnapshot snapshot = default !;
_entityStore.Update(session =>
{
snapshot = session.CurrentSnapshot;
});
var resultInfo = new FindAccountsResultInfo(DeserializeNonNullableIFindAccounts_FindAccounts(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "findAccounts")), entityIds, snapshot.Version);
return (_resultDataFactory.Create(resultInfo), resultInfo);
}
private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseData DeserializeNonNullableIFindAccounts_FindAccounts(global::System.Text.Json.JsonElement? obj)
{
if (!obj.HasValue)
{
throw new global::System.ArgumentNullException();
}
var typename = obj.Value.GetProperty("__typename").GetString();
if (typename?.Equals("AccountsSearchResponse", global::System.StringComparison.Ordinal) ?? false)
{
return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseData(typename, accountsCount: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountsCount")), accounts: DeserializeIFindAccounts_FindAccounts_AccountsNonNullableArray(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accounts")));
}
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.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>? DeserializeIFindAccounts_FindAccounts_AccountsNonNullableArray(global::System.Text.Json.JsonElement? obj)
{
if (!obj.HasValue)
{
return null;
}
var accountsSearchResponseItems = new global::System.Collections.Generic.List<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>();
foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray())
{
accountsSearchResponseItems.Add(DeserializeNonNullableIFindAccounts_FindAccounts_Accounts(child));
}
return accountsSearchResponseItems;
}
private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData DeserializeNonNullableIFindAccounts_FindAccounts_Accounts(global::System.Text.Json.JsonElement? obj)
{
if (!obj.HasValue)
{
throw new global::System.ArgumentNullException();
}
var typename = obj.Value.GetProperty("__typename").GetString();
if (typename?.Equals("AccountsSearchResponseItem", global::System.StringComparison.Ordinal) ?? false)
{
return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData(typename, accountId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountId")), nickname: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "nickname")), clanTag: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "clanTag")), lastBattle: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastBattle")), battlesCount: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battlesCount")), winRate: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "winRate")));
}
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()!);
}
}
///<summary>Response contains a list of found accounts</summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class AccountsSearchResponseData
{
public AccountsSearchResponseData(global::System.String __typename, global::System.Int32? accountsCount = default !, global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>? accounts = default !)
{
this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename));
AccountsCount = accountsCount;
Accounts = accounts;
}
public global::System.String __typename { get; }
///<summary>Count of found accounts</summary>
public global::System.Int32? AccountsCount { get; }
///<summary>Found accounts list</summary>
public global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>? Accounts { get; }
}
///<summary>Account search result item</summary>
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class AccountsSearchResponseItemData
{
public AccountsSearchResponseItemData(global::System.String __typename, global::System.Int64? accountId = default !, global::System.String? nickname = default !, global::System.String? clanTag = default !, global::System.DateTimeOffset? lastBattle = default !, global::System.Int64? battlesCount = default !, global::System.Int32? winRate = default !)
{
this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename));
AccountId = accountId;
Nickname = nickname;
ClanTag = clanTag;
LastBattle = lastBattle;
BattlesCount = battlesCount;
WinRate = winRate;
}
public global::System.String __typename { get; }
///<summary>Player accountId</summary>
public global::System.Int64? AccountId { get; }
///<summary>Player nick</summary>
public global::System.String? Nickname { get; }
///<summary>Clan tag. Null if player doesn't have clan membership</summary>
public global::System.String? ClanTag { get; }
///<summary>Last battle time</summary>
public global::System.DateTimeOffset? LastBattle { get; }
///<summary>Player's battles count</summary>
public global::System.Int64? BattlesCount { get; }
///<summary>Win rate from 0 to 100</summary>
public global::System.Int32? WinRate { get; }
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class WotBlitzStatisticsProClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer
{
private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions()
{Indented = false};
public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj)
{
global::System.String __typename = obj.GetProperty("__typename").GetString()!;
return __typename switch
{
_ => throw new global::System.NotSupportedException()}
;
}
public global::System.String Format(global::StrawberryShake.EntityId entityId)
{
return entityId.Name switch
{
_ => throw new global::System.NotSupportedException()}
;
}
}
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class WotBlitzStatisticsProClientStoreAccessor : global::StrawberryShake.StoreAccessor
{
public WotBlitzStatisticsProClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories): base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
{
}
}
}