use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.
the class ChatImplClientTestBase method createThreadOptions.
protected static CreateChatThreadOptions createThreadOptions(String userId1, String userId2) {
List<ChatParticipant> participants = new ArrayList<ChatParticipant>();
participants.add(generateParticipant(userId1, "Tester 1"));
participants.add(generateParticipant(userId2, "Tester 2"));
CreateChatThreadOptions options = new CreateChatThreadOptions().setTopic("Test").setParticipants(participants);
return options;
}
use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.
the class ChatMessageContentConverter method convert.
/**
* Maps from {com.azure.android.communication.chat.implementation.models.ChatMessageContent} to {@link ChatMessageContent}.
*/
public static ChatMessageContent convert(com.azure.android.communication.chat.implementation.models.ChatMessageContent obj, ClientLogger logger) {
if (obj == null) {
return null;
}
ChatMessageContent chatMessageContent = new ChatMessageContent().setMessage(obj.getMessage()).setTopic(obj.getTopic());
if (obj.getInitiatorCommunicationIdentifier() != null) {
chatMessageContent.setInitiatorCommunicationIdentifier(CommunicationIdentifierConverter.convert(obj.getInitiatorCommunicationIdentifier(), logger));
}
if (obj.getParticipants() != null) {
List<com.azure.android.communication.chat.models.ChatParticipant> participants = new ArrayList<>(obj.getParticipants().size());
for (ChatParticipant innerParticipant : obj.getParticipants()) {
participants.add(ChatParticipantConverter.convert(innerParticipant, logger));
}
chatMessageContent.setParticipants(participants);
}
return chatMessageContent;
}
use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.
the class ChatImplClientTestBase method generateParticipant.
private static ChatParticipant generateParticipant(String id, String displayName) {
ChatParticipant chatParticipant = new ChatParticipant();
chatParticipant.setCommunicationIdentifier(new CommunicationIdentifierModel().setCommunicationUser(new CommunicationUserIdentifierModel().setId(id)));
chatParticipant.setDisplayName(displayName);
return chatParticipant;
}
Aggregations