Пример #1
0
        internal static ACSChatMemberAddedToThreadWithUserEventData DeserializeACSChatMemberAddedToThreadWithUserEventData(JsonElement element)
        {
            Optional <DateTimeOffset> time    = default;
            Optional <string>         addedBy = default;
            Optional <ACSChatThreadMemberProperties> memberAdded = default;
            Optional <DateTimeOffset> createTime    = default;
            Optional <long>           version       = default;
            Optional <string>         recipientId   = default;
            Optional <string>         transactionId = default;
            Optional <string>         threadId      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("time"))
                {
                    time = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("addedBy"))
                {
                    addedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("memberAdded"))
                {
                    memberAdded = ACSChatThreadMemberProperties.DeserializeACSChatThreadMemberProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("createTime"))
                {
                    createTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("version"))
                {
                    version = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("recipientId"))
                {
                    recipientId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("transactionId"))
                {
                    transactionId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("threadId"))
                {
                    threadId = property.Value.GetString();
                    continue;
                }
            }
            return(new ACSChatMemberAddedToThreadWithUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), Optional.ToNullable(time), addedBy.Value, memberAdded.Value));
        }
        internal static ACSChatThreadCreatedWithUserEventData DeserializeACSChatThreadCreatedWithUserEventData(JsonElement element)
        {
            Optional <string> createdBy = default;
            Optional <IReadOnlyDictionary <string, object> >          properties = default;
            Optional <IReadOnlyList <ACSChatThreadMemberProperties> > members    = default;
            Optional <DateTimeOffset> createTime    = default;
            Optional <int>            version       = default;
            Optional <string>         recipientId   = default;
            Optional <string>         transactionId = default;
            Optional <string>         threadId      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("createdBy"))
                {
                    createdBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetObject());
                    }
                    properties = dictionary;
                    continue;
                }
                if (property.NameEquals("members"))
                {
                    List <ACSChatThreadMemberProperties> array = new List <ACSChatThreadMemberProperties>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ACSChatThreadMemberProperties.DeserializeACSChatThreadMemberProperties(item));
                    }
                    members = array;
                    continue;
                }
                if (property.NameEquals("createTime"))
                {
                    createTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("version"))
                {
                    version = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("recipientId"))
                {
                    recipientId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("transactionId"))
                {
                    transactionId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("threadId"))
                {
                    threadId = property.Value.GetString();
                    continue;
                }
            }
            return(new ACSChatThreadCreatedWithUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), createdBy.Value, Optional.ToDictionary(properties), Optional.ToList(members)));
        }
Пример #3
0
 internal ACSChatMemberRemovedFromThreadWithUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset?createTime, long?version, DateTimeOffset?time, string removedBy, ACSChatThreadMemberProperties memberRemoved) : base(recipientId, transactionId, threadId, createTime, version)
 {
     Time          = time;
     RemovedBy     = removedBy;
     MemberRemoved = memberRemoved;
 }
 internal ACSChatMemberAddedToThreadWithUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset?createTime, int?version, DateTimeOffset?time, string addedBy, ACSChatThreadMemberProperties memberAdded) : base(recipientId, transactionId, threadId, createTime, version)
 {
     Time        = time;
     AddedBy     = addedBy;
     MemberAdded = memberAdded;
 }