// #nullable enable namespace WotBlitzStatisticsPro.Blazor.GraphQl.State { [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.12.1.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 _markOfMasteryParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _longParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _dateTimeParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _stringParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _floatParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _decimalParser; 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."); _markOfMasteryParser = serializerResolver.GetLeafValueParser("MarkOfMastery") ?? throw new global::System.ArgumentException("No serializer for type `MarkOfMastery` found."); _longParser = serializerResolver.GetLeafValueParser("Long") ?? throw new global::System.ArgumentException("No serializer for type `Long` found."); _dateTimeParser = serializerResolver.GetLeafValueParser("DateTime") ?? throw new global::System.ArgumentException("No serializer for type `DateTime` found."); _stringParser = serializerResolver.GetLeafValueParser("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found."); _floatParser = serializerResolver.GetLeafValueParser("Float") ?? throw new global::System.ArgumentException("No serializer for type `Float` found."); _decimalParser = serializerResolver.GetLeafValueParser("Decimal") ?? throw new global::System.ArgumentException("No serializer for type `Decimal` 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 { if (response.Body != null && response.Body.RootElement.TryGetProperty("errors", out global::System.Text.Json.JsonElement errorsElement)) { errors = global::StrawberryShake.Json.JsonErrorParser.ParseErrors(errorsElement); } 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 !; global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountAchievementsResponseData accountMedalsId = default !; _entityStore.Update(session => { accountMedalsId = DeserializeNonNullableIPlayer_AccountMedals(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountMedals"), entityIds); snapshot = session.CurrentSnapshot; }); var resultInfo = new PlayerResultInfo(DeserializeNonNullableIPlayer_AccountInfo(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountInfo")), accountMedalsId, entityIds, snapshot.Version); return (_resultDataFactory.Create(resultInfo), resultInfo); } private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.IStatisticsData 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")), createdAt: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "createdAt")), nickname: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "nickname")), maxFragsTankId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxFragsTankId")), maxXpTankId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxXpTankId")), avgTier: DeserializeNonNullableDouble(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgTier")), lastBattleTime: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastBattleTime")), battles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battles")), capturePoints: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "capturePoints")), damageDealt: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageDealt")), damageReceived: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageReceived")), droppedCapturePoints: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "droppedCapturePoints")), frags: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "frags")), frags8P: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "frags8P")), hits: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "hits")), losses: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "losses")), maxFrags: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxFrags")), maxXp: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxXp")), shots: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "shots")), spotted: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "spotted")), survivedBattles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "survivedBattles")), winAndSurvived: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "winAndSurvived")), wins: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "wins")), xp: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "xp")), wn7: DeserializeNonNullableDouble(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "wn7")), 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")), damageCoefficient: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageCoefficient")), survivalRate: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "survivalRate")), clanInfo: DeserializeIPlayer_AccountInfo_ClanInfo(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "clanInfo")), 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.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.String? DeserializeString(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { return null; } return _stringParser.Parse(obj.Value.GetString()!); } 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.Decimal DeserializeNonNullableDecimal(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } return _decimalParser.Parse(obj.Value.GetDecimal()!); } private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.ClanInfoResponseData? DeserializeIPlayer_AccountInfo_ClanInfo(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { return null; } var typename = obj.Value.GetProperty("__typename").GetString(); if (typename?.Equals("ClanInfoResponse", global::System.StringComparison.Ordinal) ?? false) { return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.ClanInfoResponseData(typename, clanId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "clanId")), joinedAt: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "joinedAt")), role: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "role")), roleLocalized: DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "roleLocalized")), name: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), createdAt: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "createdAt")), creatorId: DeserializeInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "creatorId")), creatorName: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "creatorName")), description: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "description")), descriptionHtml: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "descriptionHtml")), leaderId: DeserializeInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "leaderId")), leaderName: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "leaderName")), membersCount: DeserializeInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "membersCount")), motto: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "motto")), tag: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tag")), updatedAt: DeserializeDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "updatedAt"))); } throw new global::System.NotSupportedException(); } private global::System.String DeserializeNonNullableString(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } return _stringParser.Parse(obj.Value.GetString()!); } private global::System.Int64? DeserializeInt64(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { return null; } return _longParser.Parse(obj.Value.GetInt64()!); } private global::System.DateTimeOffset? DeserializeDateTimeOffset(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { return null; } return _dateTimeParser.Parse(obj.Value.GetString()!); } 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.IStatisticsData 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")), battleLifeTimeInSeconds: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battleLifeTimeInSeconds")), markOfMastery: DeserializeNonNullableMarkOfMastery(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "markOfMastery")), avgBattleLifeTimeInMinutes: DeserializeNonNullableDecimal(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "avgBattleLifeTimeInMinutes")), name: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), tankNationId: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankNationId")), tankNation: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankNation")), tier: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tier")), tankTypeId: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankTypeId")), tankType: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "tankType")), isPremium: DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isPremium")), previewImage: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "previewImage")), normalImage: DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "normalImage")), lastBattleTime: DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastBattleTime")), battles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "battles")), capturePoints: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "capturePoints")), damageDealt: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageDealt")), damageReceived: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "damageReceived")), droppedCapturePoints: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "droppedCapturePoints")), frags: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "frags")), frags8P: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "frags8P")), hits: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "hits")), losses: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "losses")), maxFrags: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxFrags")), maxXp: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxXp")), shots: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "shots")), spotted: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "spotted")), survivedBattles: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "survivedBattles")), winAndSurvived: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "winAndSurvived")), wins: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "wins")), xp: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "xp")), wn7: DeserializeNonNullableDouble(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "wn7")), 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")), 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::WotBlitzStatisticsPro.Blazor.GraphQl.MarkOfMastery DeserializeNonNullableMarkOfMastery(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } return _markOfMasteryParser.Parse(obj.Value.GetString()!); } 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()!); } private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountAchievementsResponseData DeserializeNonNullableIPlayer_AccountMedals(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } var typename = obj.Value.GetProperty("__typename").GetString(); if (typename?.Equals("AccountAchievementsResponse", global::System.StringComparison.Ordinal) ?? false) { return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountAchievementsResponseData(typename, accountId: DeserializeNonNullableInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "accountId")), sections: DeserializeIPlayer_AccountMedals_SectionsNonNullableArray(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "sections"), entityIds)); } throw new global::System.NotSupportedException(); } private global::System.Collections.Generic.IReadOnlyList? DeserializeIPlayer_AccountMedals_SectionsNonNullableArray(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { return null; } var achievementSections = new global::System.Collections.Generic.List(); foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray()) { achievementSections.Add(DeserializeNonNullableIPlayer_AccountMedals_Sections(session, child, entityIds)); } return achievementSections; } private global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementSectionData DeserializeNonNullableIPlayer_AccountMedals_Sections(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } var typename = obj.Value.GetProperty("__typename").GetString(); if (typename?.Equals("AchievementSection", global::System.StringComparison.Ordinal) ?? false) { return new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementSectionData(typename, sectionId: DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "sectionId")), order: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "order")), name: DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), medals: UpdateIPlayer_AccountMedals_Sections_MedalsEntityNonNullableArray(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "medals"), entityIds)); } throw new global::System.NotSupportedException(); } private global::System.Collections.Generic.IReadOnlyList? UpdateIPlayer_AccountMedals_Sections_MedalsEntityNonNullableArray(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { return null; } var achievements = new global::System.Collections.Generic.List(); foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray()) { achievements.Add(UpdateNonNullableIPlayer_AccountMedals_Sections_MedalsEntity(session, child, entityIds)); } return achievements; } private global::StrawberryShake.EntityId UpdateNonNullableIPlayer_AccountMedals_Sections_MedalsEntity(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { throw new global::System.ArgumentNullException(); } global::StrawberryShake.EntityId entityId = _idSerializer.Parse(obj.Value); entityIds.Add(entityId); if (entityId.Name.Equals("Achievement", global::System.StringComparison.Ordinal)) { if (session.CurrentSnapshot.TryGetEntity(entityId, out global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementEntity? entity)) { session.SetEntity(entityId, new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "medalType")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "condition")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "description")), DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "achievementValue")), DeserializeInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxSeriesValue")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "image")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "imageBig")), DeserializeInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "order")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "sectionId")))); } else { session.SetEntity(entityId, new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AchievementEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "medalType")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "condition")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "description")), DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "achievementValue")), DeserializeInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "maxSeriesValue")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "image")), DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "imageBig")), DeserializeInt64(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "order")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "sectionId")))); } return entityId; } throw new global::System.NotSupportedException(); } private global::System.Int32? DeserializeInt32(global::System.Text.Json.JsonElement? obj) { if (!obj.HasValue) { return null; } return _intParser.Parse(obj.Value.GetInt32()!); } } }