-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ms-teams): add list chats method
- Loading branch information
1 parent
47c96d0
commit 8e799c7
Showing
7 changed files
with
77 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
connectors/microsoft-teams/src/main/java/io/camunda/connector/RemoveNullFieldsUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.connector; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import io.camunda.connector.suppliers.ObjectMapperSupplier; | ||
|
||
public class RemoveNullFieldsUtil { | ||
|
||
private RemoveNullFieldsUtil() {} | ||
|
||
public static Object removeNullFieldsInObject(Object object) { | ||
ObjectMapper objectMapper = ObjectMapperSupplier.nonNullObjectMapper(); | ||
try { | ||
return objectMapper.readValue(objectMapper.writer().writeValueAsString(object), Object.class); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...tors/microsoft-teams/src/main/java/io/camunda/connector/model/request/chat/ListChats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.connector.model.request.chat; | ||
|
||
import static io.camunda.connector.RemoveNullFieldsUtil.removeNullFieldsInObject; | ||
|
||
import com.microsoft.graph.requests.GraphServiceClient; | ||
import io.camunda.connector.model.request.MSTeamsRequestData; | ||
import okhttp3.Request; | ||
|
||
public class ListChats extends MSTeamsRequestData { | ||
|
||
@Override | ||
public Object invoke(final GraphServiceClient<Request> graphClient) { | ||
return removeNullFieldsInObject(graphClient.chats().buildRequest().get()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ListChats{}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters