internal static CreateChatThreadResultInternal DeserializeCreateChatThreadResultInternal(JsonElement element)
        {
            Optional <ChatThreadInternal>     chatThread = default;
            Optional <CreateChatThreadErrors> errors     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("chatThread"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    chatThread = ChatThreadInternal.DeserializeChatThreadInternal(property.Value);
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    errors = CreateChatThreadErrors.DeserializeCreateChatThreadErrors(property.Value);
                    continue;
                }
            }
            return(new CreateChatThreadResultInternal(chatThread.Value, errors.Value));
        }
예제 #2
0
 internal ChatThread(ChatThreadInternal chatThreadInternal)
 {
     Id        = chatThreadInternal.Id;
     Topic     = chatThreadInternal.Topic;
     CreatedOn = chatThreadInternal.CreatedOn;
     CreatedBy = new CommunicationUser(chatThreadInternal.CreatedBy);
     Members   = chatThreadInternal.Members.Select(x => x.ToChatThreadMember()).ToList();
 }
예제 #3
0
 internal ChatThread(ChatThreadInternal chatThreadInternal)
 {
     Id        = chatThreadInternal.Id;
     Topic     = chatThreadInternal.Topic;
     CreatedOn = chatThreadInternal.CreatedOn;
     CreatedBy = CommunicationIdentifierSerializer.Deserialize(chatThreadInternal.CreatedByCommunicationIdentifier);
     DeletedOn = chatThreadInternal.DeletedOn;
 }
예제 #4
0
 internal ChatThread(ChatThreadInternal chatThreadInternal)
 {
     Id        = chatThreadInternal.Id;
     Topic     = chatThreadInternal.Topic;
     CreatedOn = chatThreadInternal.CreatedOn;
     CreatedBy = new CommunicationUserIdentifier(chatThreadInternal.CreatedBy);
     DeletedOn = chatThreadInternal.DeletedOn;
 }
예제 #5
0
 internal ChatThread(ChatThreadInternal chatThreadInternal)
 {
     Id           = chatThreadInternal.Id;
     Topic        = chatThreadInternal.Topic;
     CreatedOn    = chatThreadInternal.CreatedOn;
     CreatedBy    = new CommunicationUser(chatThreadInternal.CreatedBy);
     Participants = chatThreadInternal.Participants.Select(x => x.ToChatParticipant()).ToList();
 }