Ejemplo n.º 1
0
        internal static ChatMessagesCollection DeserializeChatMessagesCollection(JsonElement element)
        {
            IReadOnlyList <ChatMessageInternal> value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <ChatMessageInternal> array = new List <ChatMessageInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ChatMessageInternal.DeserializeChatMessageInternal(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ChatMessagesCollection(value, nextLink.Value));
        }
Ejemplo n.º 2
0
 internal ChatMessage(ChatMessageInternal chatMessageInternal)
 {
     Id                = chatMessageInternal.Id;
     Type              = chatMessageInternal.Type;
     SequenceId        = chatMessageInternal.SequenceId;
     Version           = chatMessageInternal.Version;
     Content           = new ChatMessageContent(chatMessageInternal.Content);
     SenderDisplayName = chatMessageInternal.SenderDisplayName;
     CreatedOn         = chatMessageInternal.CreatedOn;
     if (chatMessageInternal.SenderId != null)
     {
         Sender = new CommunicationUserIdentifier(chatMessageInternal.SenderId);
     }
     DeletedOn = chatMessageInternal.DeletedOn;
     EditedOn  = chatMessageInternal.EditedOn;
 }
Ejemplo n.º 3
0
 internal ChatMessage(ChatMessageInternal chatMessageInternal)
 {
     Id                = chatMessageInternal.Id;
     Type              = chatMessageInternal.Type;
     SequenceId        = chatMessageInternal.SequenceId;
     Version           = chatMessageInternal.Version;
     Content           = new ChatMessageContent(chatMessageInternal.Content);
     SenderDisplayName = chatMessageInternal.SenderDisplayName;
     CreatedOn         = chatMessageInternal.CreatedOn;
     if (chatMessageInternal.SenderCommunicationIdentifier != null)
     {
         Sender = CommunicationIdentifierSerializer.Deserialize(chatMessageInternal.SenderCommunicationIdentifier);
     }
     DeletedOn = chatMessageInternal.DeletedOn;
     EditedOn  = chatMessageInternal.EditedOn;
     Metadata  = chatMessageInternal.Metadata;
 }