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();
        }
        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();
        }
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();
        }
Beispiel #5
0
 public GetMessagesResultInfo(
     global::StrawberryShake.EntityId personByEmail,
     global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds,
     ulong version)
 {
     PersonByEmail = personByEmail;
     _entityIds    = entityIds
                     ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version = version;
 }
 private IReadMessages_Message MapNonNullableIReadMessages_Message(global::StrawberryShake.EntityId entityId)
 {
     if (entityId.Name.Equals("Message", global::System.StringComparison.Ordinal))
     {
         return(_readMessages_Message_MessageFromMessageEntityMapper.Map(
                    _entityStore.GetEntity <MessageEntity>(entityId)
                    ?? throw new global::StrawberryShake.GraphQLClientException()));
     }
     throw new global::System.NotSupportedException();
 }
Beispiel #7
0
 private IGetMessages_PersonByEmail MapNonNullableIGetMessages_PersonByEmail(global::StrawberryShake.EntityId entityId)
 {
     if (entityId.Name.Equals("Person", global::System.StringComparison.Ordinal))
     {
         return(_getMessages_PersonByEmail_PersonFromPersonEntityMapper.Map(
                    _entityStore.GetEntity <PersonEntity>(entityId)
                    ?? throw new global::StrawberryShake.GraphQLClientException()));
     }
     throw new global::System.NotSupportedException();
 }
Beispiel #8
0
 public ReadMessagesResultInfo(
     global::StrawberryShake.EntityId message,
     global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds,
     ulong version)
 {
     Message    = message;
     _entityIds = entityIds
                  ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version = version;
 }
        private (IGetMessagesResult, GetMessagesResultInfo) BuildData(global::System.Text.Json.JsonElement obj)
        {
            using global::StrawberryShake.IEntityUpdateSession session = _entityStore.BeginUpdate();
            var entityIds = new global::System.Collections.Generic.HashSet <global::StrawberryShake.EntityId>();

            global::StrawberryShake.EntityId personByEmailId = UpdateNonNullableIGetMessages_PersonByEmailEntity(
                global::StrawberryShake.Transport.Http.JsonElementExtensions.GetPropertyOrNull(obj, "personByEmail"),
                entityIds);

            var resultInfo = new GetMessagesResultInfo(
                personByEmailId,
                entityIds,
                session.Version);

            return(_resultDataFactory.Create(resultInfo), resultInfo);
        }