-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathCreateWorkflowsWebhookHandle_1716851881.java
More file actions
40 lines (36 loc) · 1.96 KB
/
CreateWorkflowsWebhookHandle_1716851881.java
File metadata and controls
40 lines (36 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Create workflow webhook handle returns "CREATED" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi;
import com.datadog.api.client.v2.model.MicrosoftTeamsCreateWorkflowsWebhookHandleRequest;
import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes;
import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestData;
import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse;
import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleType;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient);
MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body =
new MicrosoftTeamsCreateWorkflowsWebhookHandleRequest()
.data(
new MicrosoftTeamsWorkflowsWebhookHandleRequestData()
.attributes(
new MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes()
.name("Example-Microsoft-Teams-Integration")
.url("https://example.logic.azure.com/workflows/123"))
.type(MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE));
try {
MicrosoftTeamsWorkflowsWebhookHandleResponse result =
apiInstance.createWorkflowsWebhookHandle(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling MicrosoftTeamsIntegrationApi#createWorkflowsWebhookHandle");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}