Skip to content

Commit cafb34a

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

8 files changed

Lines changed: 690 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,14 @@ components:
17801780
required: false
17811781
schema:
17821782
type: boolean
1783+
SlackUserUuidQueryParameter:
1784+
description: The UUID of the Datadog user to list Slack bindings for.
1785+
in: query
1786+
name: user_uuid
1787+
required: true
1788+
schema:
1789+
format: uuid
1790+
type: string
17831791
SloID:
17841792
description: The ID of the SLO.
17851793
in: path
@@ -89039,6 +89047,37 @@ components:
8903989047
required:
8904089048
- slackTrigger
8904189049
type: object
89050+
SlackUserBindingData:
89051+
description: Slack team ID data from a response.
89052+
properties:
89053+
id:
89054+
description: The Slack team ID.
89055+
example: "T01234567"
89056+
type: string
89057+
type:
89058+
$ref: "#/components/schemas/SlackUserBindingType"
89059+
type: object
89060+
SlackUserBindingType:
89061+
default: team_id
89062+
description: Slack user binding resource type.
89063+
enum:
89064+
- team_id
89065+
example: team_id
89066+
type: string
89067+
x-enum-varnames:
89068+
- TEAM_ID
89069+
SlackUserBindingsResponse:
89070+
description: Response with a list of Slack user bindings.
89071+
properties:
89072+
data:
89073+
description: An array of Slack user bindings.
89074+
example: [{"id": "T01234567", "type": "team_id"}, {"id": "T09876543", "type": "team_id"}]
89075+
items:
89076+
$ref: "#/components/schemas/SlackUserBindingData"
89077+
type: array
89078+
required:
89079+
- data
89080+
type: object
8904289081
SloDataSource:
8904389082
default: slo
8904489083
description: A data source for SLO queries.
@@ -136401,6 +136440,36 @@ paths:
136401136440
summary: List ServiceNow users
136402136441
tags:
136403136442
- ServiceNow Integration
136443+
/api/v2/integration/slack/user-bindings:
136444+
get:
136445+
description: List all Slack user bindings for a given Datadog user from the Datadog Slack integration.
136446+
operationId: ListSlackUserBindings
136447+
parameters:
136448+
- $ref: "#/components/parameters/SlackUserUuidQueryParameter"
136449+
responses:
136450+
"200":
136451+
content:
136452+
application/json:
136453+
examples:
136454+
default:
136455+
value:
136456+
data:
136457+
- id: T01234567
136458+
type: team_id
136459+
- id: T09876543
136460+
type: team_id
136461+
schema:
136462+
$ref: "#/components/schemas/SlackUserBindingsResponse"
136463+
description: OK
136464+
"400":
136465+
$ref: "#/components/responses/BadRequestResponse"
136466+
"403":
136467+
$ref: "#/components/responses/ForbiddenResponse"
136468+
"429":
136469+
$ref: "#/components/responses/TooManyRequestsResponse"
136470+
summary: List Slack user bindings
136471+
tags:
136472+
- Slack Integration
136404136473
/api/v2/integration/statuspage/account:
136405136474
delete:
136406136475
description: Delete the Statuspage account configured for your organization.
@@ -186271,6 +186340,13 @@ tags:
186271186340
name: Service Level Objectives
186272186341
- description: Manage your ServiceNow Integration. ServiceNow is a cloud-based platform that helps organizations manage digital workflows for enterprise operations.
186273186342
name: ServiceNow Integration
186343+
- description: |-
186344+
Configure your [Datadog Slack integration](https://docs.datadoghq.com/integrations/slack/)
186345+
directly through the Datadog API.
186346+
externalDocs:
186347+
description: For more information about the Datadog Slack integration, see the integration page.
186348+
url: https://docs.datadoghq.com/integrations/slack/
186349+
name: Slack Integration
186274186350
- description: |-
186275186351
API to create, update, retrieve, and delete Software Catalog entities.
186276186352
externalDocs:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// List Slack user bindings returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SlackIntegrationApi;
6+
import com.datadog.api.client.v2.model.SlackUserBindingsResponse;
7+
import java.util.UUID;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
SlackIntegrationApi apiInstance = new SlackIntegrationApi(defaultClient);
13+
14+
try {
15+
SlackUserBindingsResponse result =
16+
apiInstance.listSlackUserBindings(
17+
UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling SlackIntegrationApi#listSlackUserBindings");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
package com.datadog.api.client.v2.api;
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.ApiResponse;
6+
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.SlackUserBindingsResponse;
8+
import jakarta.ws.rs.client.Invocation;
9+
import jakarta.ws.rs.core.GenericType;
10+
import java.util.ArrayList;
11+
import java.util.HashMap;
12+
import java.util.List;
13+
import java.util.Map;
14+
import java.util.UUID;
15+
import java.util.concurrent.CompletableFuture;
16+
17+
@jakarta.annotation.Generated(
18+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
19+
public class SlackIntegrationApi {
20+
private ApiClient apiClient;
21+
22+
public SlackIntegrationApi() {
23+
this(ApiClient.getDefaultApiClient());
24+
}
25+
26+
public SlackIntegrationApi(ApiClient apiClient) {
27+
this.apiClient = apiClient;
28+
}
29+
30+
/**
31+
* Get the API client.
32+
*
33+
* @return API client
34+
*/
35+
public ApiClient getApiClient() {
36+
return apiClient;
37+
}
38+
39+
/**
40+
* Set the API client.
41+
*
42+
* @param apiClient an instance of API client
43+
*/
44+
public void setApiClient(ApiClient apiClient) {
45+
this.apiClient = apiClient;
46+
}
47+
48+
/**
49+
* List Slack user bindings.
50+
*
51+
* <p>See {@link #listSlackUserBindingsWithHttpInfo}.
52+
*
53+
* @param userUuid The UUID of the Datadog user to list Slack bindings for. (required)
54+
* @return SlackUserBindingsResponse
55+
* @throws ApiException if fails to make API call
56+
*/
57+
public SlackUserBindingsResponse listSlackUserBindings(UUID userUuid) throws ApiException {
58+
return listSlackUserBindingsWithHttpInfo(userUuid).getData();
59+
}
60+
61+
/**
62+
* List Slack user bindings.
63+
*
64+
* <p>See {@link #listSlackUserBindingsWithHttpInfoAsync}.
65+
*
66+
* @param userUuid The UUID of the Datadog user to list Slack bindings for. (required)
67+
* @return CompletableFuture&lt;SlackUserBindingsResponse&gt;
68+
*/
69+
public CompletableFuture<SlackUserBindingsResponse> listSlackUserBindingsAsync(UUID userUuid) {
70+
return listSlackUserBindingsWithHttpInfoAsync(userUuid)
71+
.thenApply(
72+
response -> {
73+
return response.getData();
74+
});
75+
}
76+
77+
/**
78+
* List all Slack user bindings for a given Datadog user from the Datadog Slack integration.
79+
*
80+
* @param userUuid The UUID of the Datadog user to list Slack bindings for. (required)
81+
* @return ApiResponse&lt;SlackUserBindingsResponse&gt;
82+
* @throws ApiException if fails to make API call
83+
* @http.response.details
84+
* <table border="1">
85+
* <caption>Response details</caption>
86+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
87+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
88+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
89+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
90+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
91+
* </table>
92+
*/
93+
public ApiResponse<SlackUserBindingsResponse> listSlackUserBindingsWithHttpInfo(UUID userUuid)
94+
throws ApiException {
95+
Object localVarPostBody = null;
96+
97+
// verify the required parameter 'userUuid' is set
98+
if (userUuid == null) {
99+
throw new ApiException(
100+
400, "Missing the required parameter 'userUuid' when calling listSlackUserBindings");
101+
}
102+
// create path and map variables
103+
String localVarPath = "/api/v2/integration/slack/user-bindings";
104+
105+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
106+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
107+
108+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_uuid", userUuid));
109+
110+
Invocation.Builder builder =
111+
apiClient.createBuilder(
112+
"v2.SlackIntegrationApi.listSlackUserBindings",
113+
localVarPath,
114+
localVarQueryParams,
115+
localVarHeaderParams,
116+
new HashMap<String, String>(),
117+
new String[] {"application/json"},
118+
new String[] {"apiKeyAuth", "appKeyAuth"});
119+
return apiClient.invokeAPI(
120+
"GET",
121+
builder,
122+
localVarHeaderParams,
123+
new String[] {},
124+
localVarPostBody,
125+
new HashMap<String, Object>(),
126+
false,
127+
new GenericType<SlackUserBindingsResponse>() {});
128+
}
129+
130+
/**
131+
* List Slack user bindings.
132+
*
133+
* <p>See {@link #listSlackUserBindingsWithHttpInfo}.
134+
*
135+
* @param userUuid The UUID of the Datadog user to list Slack bindings for. (required)
136+
* @return CompletableFuture&lt;ApiResponse&lt;SlackUserBindingsResponse&gt;&gt;
137+
*/
138+
public CompletableFuture<ApiResponse<SlackUserBindingsResponse>>
139+
listSlackUserBindingsWithHttpInfoAsync(UUID userUuid) {
140+
Object localVarPostBody = null;
141+
142+
// verify the required parameter 'userUuid' is set
143+
if (userUuid == null) {
144+
CompletableFuture<ApiResponse<SlackUserBindingsResponse>> result = new CompletableFuture<>();
145+
result.completeExceptionally(
146+
new ApiException(
147+
400, "Missing the required parameter 'userUuid' when calling listSlackUserBindings"));
148+
return result;
149+
}
150+
// create path and map variables
151+
String localVarPath = "/api/v2/integration/slack/user-bindings";
152+
153+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
154+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
155+
156+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_uuid", userUuid));
157+
158+
Invocation.Builder builder;
159+
try {
160+
builder =
161+
apiClient.createBuilder(
162+
"v2.SlackIntegrationApi.listSlackUserBindings",
163+
localVarPath,
164+
localVarQueryParams,
165+
localVarHeaderParams,
166+
new HashMap<String, String>(),
167+
new String[] {"application/json"},
168+
new String[] {"apiKeyAuth", "appKeyAuth"});
169+
} catch (ApiException ex) {
170+
CompletableFuture<ApiResponse<SlackUserBindingsResponse>> result = new CompletableFuture<>();
171+
result.completeExceptionally(ex);
172+
return result;
173+
}
174+
return apiClient.invokeAPIAsync(
175+
"GET",
176+
builder,
177+
localVarHeaderParams,
178+
new String[] {},
179+
localVarPostBody,
180+
new HashMap<String, Object>(),
181+
false,
182+
new GenericType<SlackUserBindingsResponse>() {});
183+
}
184+
}

0 commit comments

Comments
 (0)