// #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; private readonly global::StrawberryShake.IEntityMapper _player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper; public PlayerResultFactory(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityMapper player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper) { _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); _player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper = player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper ?? throw new global::System.ArgumentNullException(nameof(player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper)); } 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), MapNonNullableIPlayer_AccountMedals(info.AccountMedals, snapshot)); } throw new global::System.ArgumentException("PlayerResultInfo expected."); } private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo MapNonNullableIPlayer_AccountInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.IStatisticsData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { IPlayer_AccountInfo? returnValue; if (data is global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountInfoResponseData accountInfoResponse) { if (!accountInfoResponse.AccountId.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.CreatedAt.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.MaxFragsTankId.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.MaxXpTankId.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.AvgTier.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.LastBattleTime.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Battles.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.CapturePoints.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.DamageDealt.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.DamageReceived.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.DroppedCapturePoints.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Frags.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Frags8P.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Hits.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Losses.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.MaxFrags.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.MaxXp.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Shots.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Spotted.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.SurvivedBattles.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.WinAndSurvived.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Wins.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Xp.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.Wn7.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.WinRate.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.AvgDamage.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.AvgXp.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.DamageCoefficient.HasValue) { throw new global::System.ArgumentNullException(); } if (!accountInfoResponse.SurvivalRate.HasValue) { throw new global::System.ArgumentNullException(); } returnValue = new global::WotBlitzStatisticsPro.Blazor.GraphQl.Player_AccountInfo_AccountInfoResponse(accountInfoResponse.AccountId!.Value, accountInfoResponse.CreatedAt!.Value, accountInfoResponse.Nickname, accountInfoResponse.MaxFragsTankId!.Value, accountInfoResponse.MaxXpTankId!.Value, accountInfoResponse.AvgTier!.Value, accountInfoResponse.LastBattleTime!.Value, accountInfoResponse.Battles!.Value, accountInfoResponse.CapturePoints!.Value, accountInfoResponse.DamageDealt!.Value, accountInfoResponse.DamageReceived!.Value, accountInfoResponse.DroppedCapturePoints!.Value, accountInfoResponse.Frags!.Value, accountInfoResponse.Frags8P!.Value, accountInfoResponse.Hits!.Value, accountInfoResponse.Losses!.Value, accountInfoResponse.MaxFrags!.Value, accountInfoResponse.MaxXp!.Value, accountInfoResponse.Shots!.Value, accountInfoResponse.Spotted!.Value, accountInfoResponse.SurvivedBattles!.Value, accountInfoResponse.WinAndSurvived!.Value, accountInfoResponse.Wins!.Value, accountInfoResponse.Xp!.Value, accountInfoResponse.Wn7!.Value, accountInfoResponse.WinRate!.Value, accountInfoResponse.AvgDamage!.Value, accountInfoResponse.AvgXp!.Value, accountInfoResponse.DamageCoefficient!.Value, accountInfoResponse.SurvivalRate!.Value, MapIPlayer_AccountInfo_ClanInfo(accountInfoResponse.ClanInfo, snapshot), MapIPlayer_AccountInfo_TanksNonNullableArray(accountInfoResponse.Tanks, snapshot)); } else { throw new global::System.NotSupportedException(); } return returnValue; } private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountInfo_ClanInfo? MapIPlayer_AccountInfo_ClanInfo(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.ClanInfoResponseData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (data is null) { return null; } IPlayer_AccountInfo_ClanInfo returnValue = default !; if (data?.__typename.Equals("ClanInfoResponse", global::System.StringComparison.Ordinal) ?? false) { returnValue = new Player_AccountInfo_ClanInfo_ClanInfoResponse(data.ClanId ?? throw new global::System.ArgumentNullException(), data.JoinedAt ?? throw new global::System.ArgumentNullException(), data.Role, data.RoleLocalized ?? throw new global::System.ArgumentNullException(), data.Name, data.CreatedAt ?? throw new global::System.ArgumentNullException(), data.CreatorId, data.CreatorName, data.Description, data.DescriptionHtml, data.LeaderId, data.LeaderName, data.MembersCount, data.Motto, data.Tag, data.UpdatedAt); } 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.IStatisticsData 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.IStatisticsData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { IPlayer_AccountInfo_Tanks? returnValue; if (data is global::WotBlitzStatisticsPro.Blazor.GraphQl.State.TankInfoResponseData tankInfoResponse) { if (!tankInfoResponse.TankId.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.BattleLifeTimeInSeconds.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.MarkOfMastery.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.AvgBattleLifeTimeInMinutes.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Tier.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.IsPremium.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.LastBattleTime.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Battles.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.CapturePoints.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.DamageDealt.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.DamageReceived.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.DroppedCapturePoints.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Frags.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Frags8P.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Hits.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Losses.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.MaxFrags.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.MaxXp.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Shots.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Spotted.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.SurvivedBattles.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.WinAndSurvived.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Wins.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Xp.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.Wn7.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.WinRate.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.AvgDamage.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.AvgXp.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.DamageCoefficient.HasValue) { throw new global::System.ArgumentNullException(); } if (!tankInfoResponse.SurvivalRate.HasValue) { throw new global::System.ArgumentNullException(); } returnValue = new global::WotBlitzStatisticsPro.Blazor.GraphQl.Player_AccountInfo_Tanks_TankInfoResponse(tankInfoResponse.TankId!.Value, tankInfoResponse.BattleLifeTimeInSeconds!.Value, tankInfoResponse.MarkOfMastery!.Value, tankInfoResponse.AvgBattleLifeTimeInMinutes!.Value, tankInfoResponse.Name, tankInfoResponse.TankNationId, tankInfoResponse.TankNation, tankInfoResponse.Tier!.Value, tankInfoResponse.TankTypeId, tankInfoResponse.TankType, tankInfoResponse.IsPremium!.Value, tankInfoResponse.PreviewImage, tankInfoResponse.NormalImage, tankInfoResponse.LastBattleTime!.Value, tankInfoResponse.Battles!.Value, tankInfoResponse.CapturePoints!.Value, tankInfoResponse.DamageDealt!.Value, tankInfoResponse.DamageReceived!.Value, tankInfoResponse.DroppedCapturePoints!.Value, tankInfoResponse.Frags!.Value, tankInfoResponse.Frags8P!.Value, tankInfoResponse.Hits!.Value, tankInfoResponse.Losses!.Value, tankInfoResponse.MaxFrags!.Value, tankInfoResponse.MaxXp!.Value, tankInfoResponse.Shots!.Value, tankInfoResponse.Spotted!.Value, tankInfoResponse.SurvivedBattles!.Value, tankInfoResponse.WinAndSurvived!.Value, tankInfoResponse.Wins!.Value, tankInfoResponse.Xp!.Value, tankInfoResponse.Wn7!.Value, tankInfoResponse.WinRate!.Value, tankInfoResponse.AvgDamage!.Value, tankInfoResponse.AvgXp!.Value, tankInfoResponse.DamageCoefficient!.Value, tankInfoResponse.SurvivalRate!.Value); } else { throw new global::System.NotSupportedException(); } return returnValue; } private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountMedals MapNonNullableIPlayer_AccountMedals(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountAchievementsResponseData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { IPlayer_AccountMedals returnValue = default !; if (data.__typename.Equals("AccountAchievementsResponse", global::System.StringComparison.Ordinal)) { returnValue = new Player_AccountMedals_AccountAchievementsResponse(data.AccountId ?? throw new global::System.ArgumentNullException(), MapIPlayer_AccountMedals_SectionsNonNullableArray(data.Sections, snapshot)); } else { throw new global::System.NotSupportedException(); } return returnValue; } private global::System.Collections.Generic.IReadOnlyList? MapIPlayer_AccountMedals_SectionsNonNullableArray(global::System.Collections.Generic.IReadOnlyList? list, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (list is null) { return null; } var achievementSections = new global::System.Collections.Generic.List(); foreach (global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementSectionData child in list) { achievementSections.Add(MapNonNullableIPlayer_AccountMedals_Sections(child, snapshot)); } return achievementSections; } private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountMedals_Sections MapNonNullableIPlayer_AccountMedals_Sections(global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementSectionData data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { IPlayer_AccountMedals_Sections returnValue = default !; if (data.__typename.Equals("AchievementSection", global::System.StringComparison.Ordinal)) { returnValue = new Player_AccountMedals_Sections_AchievementSection(data.SectionId ?? throw new global::System.ArgumentNullException(), data.Order ?? throw new global::System.ArgumentNullException(), data.Name ?? throw new global::System.ArgumentNullException(), MapIPlayer_AccountMedals_Sections_MedalsNonNullableArray(data.Medals, snapshot)); } else { throw new global::System.NotSupportedException(); } return returnValue; } private global::System.Collections.Generic.IReadOnlyList? MapIPlayer_AccountMedals_Sections_MedalsNonNullableArray(global::System.Collections.Generic.IReadOnlyList? list, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (list is null) { return null; } var achievements = new global::System.Collections.Generic.List(); foreach (global::StrawberryShake.EntityId child in list) { achievements.Add(MapNonNullableIPlayer_AccountMedals_Sections_Medals(child, snapshot)); } return achievements; } private global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayer_AccountMedals_Sections_Medals MapNonNullableIPlayer_AccountMedals_Sections_Medals(global::StrawberryShake.EntityId entityId, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (entityId.Name.Equals("Achievement", global::System.StringComparison.Ordinal)) { return _player_AccountMedals_Sections_Medals_AchievementFromAchievementEntityMapper.Map(snapshot.GetEntity(entityId) ?? throw new global::StrawberryShake.GraphQLClientException()); } throw new global::System.NotSupportedException(); } global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot) { return Create(dataInfo, snapshot); } } }