private global::StrawberryShake.EntityId UpdateNonNullableIGetMessages_PersonByEmailEntity(
            global::System.Text.Json.JsonElement?obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            global::StrawberryShake.EntityId entityId = _extractId(obj.Value);
            entityIds.Add(entityId);


            if (entityId.Name.Equals("Person", global::System.StringComparison.Ordinal))
            {
                PersonEntity entity = _entityStore.GetOrCreate <PersonEntity>(entityId);
                entity.Messages = DeserializeIGetMessages_PersonByEmail_Messages(
                    global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "messages"),
                    entityIds);

                return(entityId);
            }

            throw new global::System.NotSupportedException();
        }
        private global::StrawberryShake.EntityId? UpdateIGetMessages_PersonByEmail_Messages_NodesEntity(
            global::System.Text.Json.JsonElement? obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return(null);
            }

            global::StrawberryShake.EntityId entityId = _extractId(obj.Value);
            entityIds.Add(entityId);


            if (entityId.Name.Equals("Message", global::System.StringComparison.Ordinal))
            {
                MessageEntity entity = _entityStore.GetOrCreate <MessageEntity>(entityId);
                entity.Id        = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "id"));
                entity.Text      = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "text"));
                entity.Direction = DeserializeNonNullableDirection(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "direction"));
                entity.Recipient = UpdateNonNullableIGetMessages_PersonByEmail_Messages_Nodes_RecipientEntity(
                    global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "recipient"),
                    entityIds);
                entity.Sender = UpdateNonNullableIGetMessages_PersonByEmail_Messages_Nodes_SenderEntity(
                    global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "sender"),
                    entityIds);
                entity.Sent = DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "sent"));

                return(entityId);
            }

            throw new global::System.NotSupportedException();
        }
        private global::StrawberryShake.EntityId? UpdateIGetPeople_People_NodesEntity(
            global::System.Text.Json.JsonElement? obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return(null);
            }

            global::StrawberryShake.EntityId entityId = _extractId(obj.Value);
            entityIds.Add(entityId);


            if (entityId.Name.Equals("Person", global::System.StringComparison.Ordinal))
            {
                PersonEntity entity = _entityStore.GetOrCreate <PersonEntity>(entityId);
                entity.Name     = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "name"));
                entity.Email    = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "email"));
                entity.IsOnline = DeserializeNonNullableBoolean(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "isOnline"));
                entity.ImageUri = DeserializeUri(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "imageUri"));
                entity.LastSeen = DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "lastSeen"));

                return(entityId);
            }

            throw new global::System.NotSupportedException();
        }
Beispiel #4
0
        private global::StrawberryShake.EntityId? UpdateIGetHero_HeroEntity(
            global::System.Text.Json.JsonElement? obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return(null);
            }

            global::StrawberryShake.EntityId entityId = _extractId(obj.Value);
            entityIds.Add(entityId);


            if (entityId.Name.Equals("GetHero_Hero_Droid", global::System.StringComparison.Ordinal))
            {
                DroidEntity entity = _entityStore.GetOrCreate <DroidEntity>(entityId);
                entity.Name      = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "name"));
                entity.AppearsIn = DeserializeEpisodeArray(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "appearsIn"));

                return(entityId);
            }

            if (entityId.Name.Equals("GetHero_Hero_Human", global::System.StringComparison.Ordinal))
            {
                HumanEntity entity = _entityStore.GetOrCreate <HumanEntity>(entityId);
                entity.Name      = DeserializeNonNullableString(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "name"));
                entity.AppearsIn = DeserializeEpisodeArray(global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "appearsIn"));

                return(entityId);
            }

            throw new global::System.NotSupportedException();
        }
        private global::System.Collections.Generic.IReadOnlyList <global::StrawberryShake.EntityId?>?UpdateIGetMessages_PersonByEmail_Messages_NodesEntityArray(
            global::System.Text.Json.JsonElement? obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return(null);
            }

            var iGetMessages_PersonByEmail_Messages_Nodess = new global::System.Collections.Generic.List <global::StrawberryShake.EntityId?>();

            foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray())
            {
                iGetMessages_PersonByEmail_Messages_Nodess.Add(UpdateIGetMessages_PersonByEmail_Messages_NodesEntity(
                                                                   child,
                                                                   entityIds));
            }

            return(iGetMessages_PersonByEmail_Messages_Nodess);
        }
        private global::Demo.State.MessageConnectionData? DeserializeIGetMessages_PersonByEmail_Messages(
            global::System.Text.Json.JsonElement? obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return(null);
            }

            var typename = obj.Value.GetProperty("__typename").GetString();

            if (typename?.Equals("MessageConnection", global::System.StringComparison.Ordinal) ?? false)
            {
                return(new global::Demo.State.MessageConnectionData(
                           typename,
                           nodes: UpdateIGetMessages_PersonByEmail_Messages_NodesEntityArray(
                               global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "nodes"),
                               entityIds)));
            }

            throw new global::System.NotSupportedException();
        }
        private global::Demo.State.SendMessagePayloadData DeserializeNonNullableISendMessage_SendMessage(
            global::System.Text.Json.JsonElement?obj,
            global::System.Collections.Generic.ISet <global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            var typename = obj.Value.GetProperty("__typename").GetString();

            if (typename?.Equals("SendMessagePayload", global::System.StringComparison.Ordinal) ?? false)
            {
                return(new global::Demo.State.SendMessagePayloadData(
                           typename,
                           message: UpdateNonNullableISendMessage_SendMessage_MessageEntity(
                               global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj.Value, "message"),
                               entityIds)));
            }

            throw new global::System.NotSupportedException();
        }