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

68 lines
3.6 KiB
C#

// <auto-generated/>
#nullable enable
namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
{
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
public partial class FindPlayersResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::WotBlitzStatisticsPro.Blazor.GraphQl.FindPlayersResult>
{
private readonly global::StrawberryShake.IEntityStore _entityStore;
public FindPlayersResultFactory(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.IFindPlayersResult);
public FindPlayersResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
{
if (snapshot is null)
{
snapshot = _entityStore.CurrentSnapshot;
}
if (dataInfo is FindPlayersResultInfo info)
{
return new FindPlayersResult(MapNonNullableIFindPlayers_PlayersNonNullableArray(info.Players, snapshot));
}
throw new global::System.ArgumentException("FindPlayersResultInfo expected.");
}
private global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayers_Players> MapNonNullableIFindPlayers_PlayersNonNullableArray(global::System.Collections.Generic.IReadOnlyList<global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData>? list, global::StrawberryShake.IEntityStoreSnapshot snapshot)
{
if (list is null)
{
throw new global::System.ArgumentNullException();
}
var accountsSearchResponseItems = new global::System.Collections.Generic.List<global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayers_Players>();
foreach (global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData child in list)
{
accountsSearchResponseItems.Add(MapNonNullableIFindPlayers_Players(child, snapshot));
}
return accountsSearchResponseItems;
}
private global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayers_Players MapNonNullableIFindPlayers_Players(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
{
IFindPlayers_Players returnValue = default !;
if (data.__typename.Equals("AccountsSearchResponseItem", global::System.StringComparison.Ordinal))
{
returnValue = new FindPlayers_Players_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);
}
}
}