Search in sources :

Example 1 with V2RoomSearchCriteria

use of com.symphony.api.model.V2RoomSearchCriteria in project spring-bot by finos.

the class PodApiIT method testRoomSearch.

@ParameterizedTest
@MethodSource("setupConfigurations")
public void testRoomSearch(TestClientStrategy client) throws Exception {
    StreamsApi sApi = client.getPodApi(StreamsApi.class);
    V2RoomSearchCriteria criteria = new V2RoomSearchCriteria();
    criteria.setQuery("Demo");
    criteria.setPrivate(true);
    criteria.setActive(true);
    criteria.setLabels(Collections.emptyList());
    criteria.setSortOrder(SortOrderEnum.BASIC);
    V3RoomSearchResults res = sApi.v3RoomSearchPost(criteria, null, 0, 100);
    System.out.println(res);
}
Also used : V2RoomSearchCriteria(com.symphony.api.model.V2RoomSearchCriteria) StreamsApi(com.symphony.api.pod.StreamsApi) V3RoomSearchResults(com.symphony.api.model.V3RoomSearchResults) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with V2RoomSearchCriteria

use of com.symphony.api.model.V2RoomSearchCriteria in project spring-bot by finos.

the class SymphonyConversationsImpl method loadRoomByName.

@Override
public SymphonyRoom loadRoomByName(String name) {
    V2RoomSearchCriteria rsc = new V2RoomSearchCriteria();
    rsc.setQuery(name);
    V3RoomSearchResults res = streamsApi.v3RoomSearchPost(rsc, null, null, null);
    return res.getRooms().stream().filter(r -> r.getRoomAttributes().getName().equals(name)).findFirst().map(rd -> new SymphonyRoom(rd.getRoomAttributes().getName(), rd.getRoomSystemInfo().getId())).orElse(null);
}
Also used : V2RoomSearchCriteria(com.symphony.api.model.V2RoomSearchCriteria) User(org.finos.symphony.toolkit.workflow.content.User) SymphonyIdentity(com.symphony.api.id.SymphonyIdentity) TypeEnum(com.symphony.api.model.StreamType.TypeEnum) LoggerFactory(org.slf4j.LoggerFactory) V3RoomDetail(com.symphony.api.model.V3RoomDetail) StreamsApi(com.symphony.api.pod.StreamsApi) InitializingBean(org.springframework.beans.factory.InitializingBean) V3RoomAttributes(com.symphony.api.model.V3RoomAttributes) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Map(java.util.Map) StreamList(com.symphony.api.model.StreamList) UserV2(com.symphony.api.model.UserV2) V3RoomSearchResults(com.symphony.api.model.V3RoomSearchResults) Logger(org.slf4j.Logger) UsersApi(com.symphony.api.pod.UsersApi) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser) AbstractStreamResolving(org.finos.symphony.toolkit.workflow.sources.symphony.streams.AbstractStreamResolving) MembershipList(com.symphony.api.model.MembershipList) SymphonyApiProperties(org.finos.symphony.toolkit.spring.api.properties.SymphonyApiProperties) RoomMembershipApi(com.symphony.api.pod.RoomMembershipApi) Set(java.util.Set) Chat(org.finos.symphony.toolkit.workflow.content.Chat) Collectors(java.util.stream.Collectors) List(java.util.List) Addressable(org.finos.symphony.toolkit.workflow.content.Addressable) StreamAttributes(com.symphony.api.model.StreamAttributes) StreamID(com.symphony.user.StreamID) SymphonyRoom(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom) StreamFilter(com.symphony.api.model.StreamFilter) Collections(java.util.Collections) StreamType(com.symphony.api.model.StreamType) UserId(com.symphony.api.model.UserId) V2RoomSearchCriteria(com.symphony.api.model.V2RoomSearchCriteria) V3RoomSearchResults(com.symphony.api.model.V3RoomSearchResults) SymphonyRoom(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)

Aggregations

V2RoomSearchCriteria (com.symphony.api.model.V2RoomSearchCriteria)2 V3RoomSearchResults (com.symphony.api.model.V3RoomSearchResults)2 StreamsApi (com.symphony.api.pod.StreamsApi)2 SymphonyIdentity (com.symphony.api.id.SymphonyIdentity)1 MembershipList (com.symphony.api.model.MembershipList)1 StreamAttributes (com.symphony.api.model.StreamAttributes)1 StreamFilter (com.symphony.api.model.StreamFilter)1 StreamList (com.symphony.api.model.StreamList)1 StreamType (com.symphony.api.model.StreamType)1 TypeEnum (com.symphony.api.model.StreamType.TypeEnum)1 UserId (com.symphony.api.model.UserId)1 UserV2 (com.symphony.api.model.UserV2)1 V3RoomAttributes (com.symphony.api.model.V3RoomAttributes)1 V3RoomDetail (com.symphony.api.model.V3RoomDetail)1 RoomMembershipApi (com.symphony.api.pod.RoomMembershipApi)1 UsersApi (com.symphony.api.pod.UsersApi)1 StreamID (com.symphony.user.StreamID)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1