Search in sources :

Example 1 with UserV2

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

the class SymphonyWorkflowConfig method defaultAddressingChecker.

@Bean
@ConditionalOnMissingBean
public AddressingChecker defaultAddressingChecker() {
    UserV2 symphonyBotUser = usersApi.v2UserGet(null, null, botIdentity.getEmail(), null, symphonyProperties.isLocalPod());
    SymphonyUser su = new SymphonyUser(symphonyBotUser.getDisplayName(), symphonyBotUser.getEmailAddress());
    return new InRoomAddressingChecker(su, true);
}
Also used : UserV2(com.symphony.api.model.UserV2) InRoomAddressingChecker(org.finos.symphony.toolkit.workflow.actions.consumers.InRoomAddressingChecker) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with UserV2

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

the class KoreAIBridgeFactoryImpl method koreAIEventHandler.

public StreamEventConsumer koreAIEventHandler(KoreAIRequester requester, ApiInstance api, KoreAIInstanceProperties props) {
    UsersApi usersApi = api.getPodApi(UsersApi.class);
    UserV2 u = usersApi.v2UserGet(null, null, api.getIdentity().getEmail(), null, true);
    long id = 0;
    if (u != null) {
        id = u.getId();
    }
    return new KoreAIEventHandler(api.getIdentity(), id, requester, om, props.isOnlyAddressed());
}
Also used : UsersApi(com.symphony.api.pod.UsersApi) UserV2(com.symphony.api.model.UserV2)

Example 3 with UserV2

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

the class PodApiIT method testUserLookup.

@ParameterizedTest
@MethodSource("setupConfigurations")
public void testUserLookup(TestClientStrategy client) throws Exception {
    UsersApi uApi = client.getPodApi(UsersApi.class);
    UserV2 u = uApi.v2UserGet(null, null, client.getIdentity().getEmail(), null, false);
    System.out.println(u);
    Assertions.assertTrue(u.getDisplayName().contains("Symphony Practice"));
}
Also used : UsersApi(com.symphony.api.pod.UsersApi) UserV2(com.symphony.api.model.UserV2) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

UserV2 (com.symphony.api.model.UserV2)3 UsersApi (com.symphony.api.pod.UsersApi)2 InRoomAddressingChecker (org.finos.symphony.toolkit.workflow.actions.consumers.InRoomAddressingChecker)1 SymphonyUser (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1