Skip to content

Commit e41d8b4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 34e91d4 of spec repo (#3984)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent cafb34a commit e41d8b4

5 files changed

Lines changed: 213 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,13 @@ components:
10121012
required: true
10131013
schema:
10141014
type: string
1015+
MicrosoftTeamsTenantIDPathParameter:
1016+
description: Your tenant id.
1017+
in: path
1018+
name: tenant_id
1019+
required: true
1020+
schema:
1021+
type: string
10151022
MicrosoftTeamsTenantIDQueryParameter:
10161023
description: Your tenant id.
10171024
in: query
@@ -134956,6 +134963,26 @@ paths:
134956134963
tags:
134957134964
- Microsoft Teams Integration
134958134965
x-codegen-request-body-name: body
134966+
/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}:
134967+
delete:
134968+
description: Delete the user binding for a given tenant from the Datadog Microsoft Teams integration.
134969+
operationId: DeleteMSTeamsUserBinding
134970+
parameters:
134971+
- $ref: "#/components/parameters/MicrosoftTeamsTenantIDPathParameter"
134972+
responses:
134973+
"204":
134974+
description: No Content
134975+
"400":
134976+
$ref: "#/components/responses/BadRequestResponse"
134977+
"403":
134978+
$ref: "#/components/responses/ForbiddenResponse"
134979+
"412":
134980+
$ref: "#/components/responses/PreconditionFailedResponse"
134981+
"429":
134982+
$ref: "#/components/responses/TooManyRequestsResponse"
134983+
summary: Delete user binding
134984+
tags:
134985+
- Microsoft Teams Integration
134959134986
/api/v2/integration/ms-teams/configuration/workflows-webhook-handles:
134960134987
get:
134961134988
description: Get a list of all Workflows webhook handles from the Datadog Microsoft Teams integration.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Delete user binding returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient);
11+
12+
try {
13+
apiInstance.deleteMSTeamsUserBinding("tenant_id");
14+
} catch (ApiException e) {
15+
System.err.println(
16+
"Exception when calling MicrosoftTeamsIntegrationApi#deleteMSTeamsUserBinding");
17+
System.err.println("Status code: " + e.getCode());
18+
System.err.println("Reason: " + e.getResponseBody());
19+
System.err.println("Response headers: " + e.getResponseHeaders());
20+
e.printStackTrace();
21+
}
22+
}
23+
}

src/main/java/com/datadog/api/client/v2/api/MicrosoftTeamsIntegrationApi.java

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,142 @@ public MicrosoftTeamsWorkflowsWebhookHandleResponse createWorkflowsWebhookHandle
332332
new GenericType<MicrosoftTeamsWorkflowsWebhookHandleResponse>() {});
333333
}
334334

335+
/**
336+
* Delete user binding.
337+
*
338+
* <p>See {@link #deleteMSTeamsUserBindingWithHttpInfo}.
339+
*
340+
* @param tenantId Your tenant id. (required)
341+
* @throws ApiException if fails to make API call
342+
*/
343+
public void deleteMSTeamsUserBinding(String tenantId) throws ApiException {
344+
deleteMSTeamsUserBindingWithHttpInfo(tenantId);
345+
}
346+
347+
/**
348+
* Delete user binding.
349+
*
350+
* <p>See {@link #deleteMSTeamsUserBindingWithHttpInfoAsync}.
351+
*
352+
* @param tenantId Your tenant id. (required)
353+
* @return CompletableFuture
354+
*/
355+
public CompletableFuture<Void> deleteMSTeamsUserBindingAsync(String tenantId) {
356+
return deleteMSTeamsUserBindingWithHttpInfoAsync(tenantId)
357+
.thenApply(
358+
response -> {
359+
return response.getData();
360+
});
361+
}
362+
363+
/**
364+
* Delete the user binding for a given tenant from the Datadog Microsoft Teams integration.
365+
*
366+
* @param tenantId Your tenant id. (required)
367+
* @return ApiResponse&lt;Void&gt;
368+
* @throws ApiException if fails to make API call
369+
* @http.response.details
370+
* <table border="1">
371+
* <caption>Response details</caption>
372+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
373+
* <tr><td> 204 </td><td> No Content </td><td> - </td></tr>
374+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
375+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
376+
* <tr><td> 412 </td><td> Failed Precondition </td><td> - </td></tr>
377+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
378+
* </table>
379+
*/
380+
public ApiResponse<Void> deleteMSTeamsUserBindingWithHttpInfo(String tenantId)
381+
throws ApiException {
382+
Object localVarPostBody = null;
383+
384+
// verify the required parameter 'tenantId' is set
385+
if (tenantId == null) {
386+
throw new ApiException(
387+
400, "Missing the required parameter 'tenantId' when calling deleteMSTeamsUserBinding");
388+
}
389+
// create path and map variables
390+
String localVarPath =
391+
"/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}"
392+
.replaceAll("\\{" + "tenant_id" + "\\}", apiClient.escapeString(tenantId.toString()));
393+
394+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
395+
396+
Invocation.Builder builder =
397+
apiClient.createBuilder(
398+
"v2.MicrosoftTeamsIntegrationApi.deleteMSTeamsUserBinding",
399+
localVarPath,
400+
new ArrayList<Pair>(),
401+
localVarHeaderParams,
402+
new HashMap<String, String>(),
403+
new String[] {"*/*"},
404+
new String[] {"apiKeyAuth", "appKeyAuth"});
405+
return apiClient.invokeAPI(
406+
"DELETE",
407+
builder,
408+
localVarHeaderParams,
409+
new String[] {},
410+
localVarPostBody,
411+
new HashMap<String, Object>(),
412+
false,
413+
null);
414+
}
415+
416+
/**
417+
* Delete user binding.
418+
*
419+
* <p>See {@link #deleteMSTeamsUserBindingWithHttpInfo}.
420+
*
421+
* @param tenantId Your tenant id. (required)
422+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
423+
*/
424+
public CompletableFuture<ApiResponse<Void>> deleteMSTeamsUserBindingWithHttpInfoAsync(
425+
String tenantId) {
426+
Object localVarPostBody = null;
427+
428+
// verify the required parameter 'tenantId' is set
429+
if (tenantId == null) {
430+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
431+
result.completeExceptionally(
432+
new ApiException(
433+
400,
434+
"Missing the required parameter 'tenantId' when calling deleteMSTeamsUserBinding"));
435+
return result;
436+
}
437+
// create path and map variables
438+
String localVarPath =
439+
"/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}"
440+
.replaceAll("\\{" + "tenant_id" + "\\}", apiClient.escapeString(tenantId.toString()));
441+
442+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
443+
444+
Invocation.Builder builder;
445+
try {
446+
builder =
447+
apiClient.createBuilder(
448+
"v2.MicrosoftTeamsIntegrationApi.deleteMSTeamsUserBinding",
449+
localVarPath,
450+
new ArrayList<Pair>(),
451+
localVarHeaderParams,
452+
new HashMap<String, String>(),
453+
new String[] {"*/*"},
454+
new String[] {"apiKeyAuth", "appKeyAuth"});
455+
} catch (ApiException ex) {
456+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
457+
result.completeExceptionally(ex);
458+
return result;
459+
}
460+
return apiClient.invokeAPIAsync(
461+
"DELETE",
462+
builder,
463+
localVarHeaderParams,
464+
new String[] {},
465+
localVarPostBody,
466+
new HashMap<String, Object>(),
467+
false,
468+
null);
469+
}
470+
335471
/**
336472
* Delete tenant-based handle.
337473
*

src/test/resources/com/datadog/api/client/v2/api/microsoft_teams_integration.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,27 @@ Feature: Microsoft Teams Integration
146146
When the request is sent
147147
Then the response status is 204 OK
148148

149+
@generated @skip @team:DataDog/chat-integrations
150+
Scenario: Delete user binding returns "Bad Request" response
151+
Given new "DeleteMSTeamsUserBinding" request
152+
And request contains "tenant_id" parameter from "REPLACE.ME"
153+
When the request is sent
154+
Then the response status is 400 Bad Request
155+
156+
@generated @skip @team:DataDog/chat-integrations
157+
Scenario: Delete user binding returns "Failed Precondition" response
158+
Given new "DeleteMSTeamsUserBinding" request
159+
And request contains "tenant_id" parameter from "REPLACE.ME"
160+
When the request is sent
161+
Then the response status is 412 Failed Precondition
162+
163+
@generated @skip @team:DataDog/chat-integrations
164+
Scenario: Delete user binding returns "No Content" response
165+
Given new "DeleteMSTeamsUserBinding" request
166+
And request contains "tenant_id" parameter from "REPLACE.ME"
167+
When the request is sent
168+
Then the response status is 204 No Content
169+
149170
@team:DataDog/chat-integrations
150171
Scenario: Delete workflow webhook handle returns "OK" response
151172
Given there is a valid "workflows_webhook_handle" in the system

src/test/resources/com/datadog/api/client/v2/api/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,12 @@
35293529
"type": "idempotent"
35303530
}
35313531
},
3532+
"DeleteMSTeamsUserBinding": {
3533+
"tag": "Microsoft Teams Integration",
3534+
"undo": {
3535+
"type": "idempotent"
3536+
}
3537+
},
35323538
"ListWorkflowsWebhookHandles": {
35333539
"tag": "Microsoft Teams Integration",
35343540
"undo": {

0 commit comments

Comments
 (0)