-
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.
feat: Implement new SDK function Microsoft Teams connector
- Loading branch information
1 parent
82a632d
commit 350a70f
Showing
35 changed files
with
1,862 additions
and
221 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
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,3 @@ | ||
name: MSTEAMS | ||
type: io.camunda:connector-microsoft-teams:1 | ||
variables: [ authentication, data ] |
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
53 changes: 0 additions & 53 deletions
53
connectors/microsoft-teams/src/main/java/io/camunda/connector/Authentication.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
connectors/microsoft-teams/src/main/java/io/camunda/connector/MSTeamsFunction.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,46 @@ | ||
/* | ||
* 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.google.gson.Gson; | ||
import io.camunda.connector.api.annotation.OutboundConnector; | ||
import io.camunda.connector.api.outbound.OutboundConnectorContext; | ||
import io.camunda.connector.api.outbound.OutboundConnectorFunction; | ||
import io.camunda.connector.model.MSTeamsRequest; | ||
import io.camunda.connector.suppliers.GraphServiceClientSupplier; | ||
import io.camunda.connector.suppliers.GsonSupplier; | ||
|
||
@OutboundConnector( | ||
name = "MSTEAMS", | ||
inputVariables = {"authentication", "data"}, | ||
type = "io.camunda:connector-microsoft-teams:1") | ||
public class MSTeamsFunction implements OutboundConnectorFunction { | ||
|
||
private final Gson gson; | ||
private final GraphServiceClientSupplier graphSupplier; | ||
|
||
public MSTeamsFunction() { | ||
this(new GraphServiceClientSupplier(), GsonSupplier.getGson()); | ||
} | ||
|
||
public MSTeamsFunction(final GraphServiceClientSupplier graphSupplier, final Gson gson) { | ||
this.graphSupplier = graphSupplier; | ||
this.gson = gson; | ||
} | ||
|
||
@Override | ||
public Object execute(OutboundConnectorContext context) { | ||
|
||
final var variables = context.getVariables(); | ||
final var msTeamsRequest = gson.fromJson(variables, MSTeamsRequest.class); | ||
|
||
context.validate(msTeamsRequest); | ||
context.replaceSecrets(msTeamsRequest); | ||
|
||
return msTeamsRequest.invoke(graphSupplier); | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
connectors/microsoft-teams/src/main/java/io/camunda/connector/MyConnectorFunction.java
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
connectors/microsoft-teams/src/main/java/io/camunda/connector/MyConnectorRequest.java
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
connectors/microsoft-teams/src/main/java/io/camunda/connector/MyConnectorResult.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.