Skip to content

Commit b5d1ef9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 62867bb of spec repo
1 parent bc92028 commit b5d1ef9

26 files changed

+2426
-110
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 288 additions & 68 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List your managed organizations 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.OrganizationsApi;
6+
import com.datadog.api.client.v2.model.ManagedOrgsResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
12+
13+
try {
14+
ManagedOrgsResponse result = apiInstance.listOrgs();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling OrganizationsApi#listOrgs");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Delete a pending user's invitations 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.UsersApi;
6+
import java.util.UUID;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
UsersApi apiInstance = new UsersApi(defaultClient);
12+
13+
try {
14+
apiInstance.deleteUserInvitations(UUID.fromString("4dee724d-00cc-11ea-a77b-570c9d03c6c5"));
15+
} catch (ApiException e) {
16+
System.err.println("Exception when calling UsersApi#deleteUserInvitations");
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/OrganizationsApi.java

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.ApiResponse;
66
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.ManagedOrgsResponse;
78
import com.datadog.api.client.v2.model.OrgConfigGetResponse;
89
import com.datadog.api.client.v2.model.OrgConfigListResponse;
910
import com.datadog.api.client.v2.model.OrgConfigWriteRequest;
@@ -12,6 +13,7 @@
1213
import java.io.File;
1314
import java.util.ArrayList;
1415
import java.util.HashMap;
16+
import java.util.List;
1517
import java.util.Map;
1618
import java.util.concurrent.CompletableFuture;
1719

@@ -298,6 +300,174 @@ public CompletableFuture<ApiResponse<OrgConfigListResponse>> listOrgConfigsWithH
298300
new GenericType<OrgConfigListResponse>() {});
299301
}
300302

303+
/** Manage optional parameters to listOrgs. */
304+
public static class ListOrgsOptionalParameters {
305+
private String filterName;
306+
307+
/**
308+
* Set filterName.
309+
*
310+
* @param filterName Filter managed organizations by name. (optional)
311+
* @return ListOrgsOptionalParameters
312+
*/
313+
public ListOrgsOptionalParameters filterName(String filterName) {
314+
this.filterName = filterName;
315+
return this;
316+
}
317+
}
318+
319+
/**
320+
* List your managed organizations.
321+
*
322+
* <p>See {@link #listOrgsWithHttpInfo}.
323+
*
324+
* @return ManagedOrgsResponse
325+
* @throws ApiException if fails to make API call
326+
*/
327+
public ManagedOrgsResponse listOrgs() throws ApiException {
328+
return listOrgsWithHttpInfo(new ListOrgsOptionalParameters()).getData();
329+
}
330+
331+
/**
332+
* List your managed organizations.
333+
*
334+
* <p>See {@link #listOrgsWithHttpInfoAsync}.
335+
*
336+
* @return CompletableFuture&lt;ManagedOrgsResponse&gt;
337+
*/
338+
public CompletableFuture<ManagedOrgsResponse> listOrgsAsync() {
339+
return listOrgsWithHttpInfoAsync(new ListOrgsOptionalParameters())
340+
.thenApply(
341+
response -> {
342+
return response.getData();
343+
});
344+
}
345+
346+
/**
347+
* List your managed organizations.
348+
*
349+
* <p>See {@link #listOrgsWithHttpInfo}.
350+
*
351+
* @param parameters Optional parameters for the request.
352+
* @return ManagedOrgsResponse
353+
* @throws ApiException if fails to make API call
354+
*/
355+
public ManagedOrgsResponse listOrgs(ListOrgsOptionalParameters parameters) throws ApiException {
356+
return listOrgsWithHttpInfo(parameters).getData();
357+
}
358+
359+
/**
360+
* List your managed organizations.
361+
*
362+
* <p>See {@link #listOrgsWithHttpInfoAsync}.
363+
*
364+
* @param parameters Optional parameters for the request.
365+
* @return CompletableFuture&lt;ManagedOrgsResponse&gt;
366+
*/
367+
public CompletableFuture<ManagedOrgsResponse> listOrgsAsync(
368+
ListOrgsOptionalParameters parameters) {
369+
return listOrgsWithHttpInfoAsync(parameters)
370+
.thenApply(
371+
response -> {
372+
return response.getData();
373+
});
374+
}
375+
376+
/**
377+
* Returns the current organization and its managed organizations in JSON:API format.
378+
*
379+
* @param parameters Optional parameters for the request.
380+
* @return ApiResponse&lt;ManagedOrgsResponse&gt;
381+
* @throws ApiException if fails to make API call
382+
* @http.response.details
383+
* <table border="1">
384+
* <caption>Response details</caption>
385+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
386+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
387+
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
388+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
389+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
390+
* </table>
391+
*/
392+
public ApiResponse<ManagedOrgsResponse> listOrgsWithHttpInfo(
393+
ListOrgsOptionalParameters parameters) throws ApiException {
394+
Object localVarPostBody = null;
395+
String filterName = parameters.filterName;
396+
// create path and map variables
397+
String localVarPath = "/api/v2/org";
398+
399+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
400+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
401+
402+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName));
403+
404+
Invocation.Builder builder =
405+
apiClient.createBuilder(
406+
"v2.OrganizationsApi.listOrgs",
407+
localVarPath,
408+
localVarQueryParams,
409+
localVarHeaderParams,
410+
new HashMap<String, String>(),
411+
new String[] {"application/json"},
412+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
413+
return apiClient.invokeAPI(
414+
"GET",
415+
builder,
416+
localVarHeaderParams,
417+
new String[] {},
418+
localVarPostBody,
419+
new HashMap<String, Object>(),
420+
false,
421+
new GenericType<ManagedOrgsResponse>() {});
422+
}
423+
424+
/**
425+
* List your managed organizations.
426+
*
427+
* <p>See {@link #listOrgsWithHttpInfo}.
428+
*
429+
* @param parameters Optional parameters for the request.
430+
* @return CompletableFuture&lt;ApiResponse&lt;ManagedOrgsResponse&gt;&gt;
431+
*/
432+
public CompletableFuture<ApiResponse<ManagedOrgsResponse>> listOrgsWithHttpInfoAsync(
433+
ListOrgsOptionalParameters parameters) {
434+
Object localVarPostBody = null;
435+
String filterName = parameters.filterName;
436+
// create path and map variables
437+
String localVarPath = "/api/v2/org";
438+
439+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
440+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
441+
442+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName));
443+
444+
Invocation.Builder builder;
445+
try {
446+
builder =
447+
apiClient.createBuilder(
448+
"v2.OrganizationsApi.listOrgs",
449+
localVarPath,
450+
localVarQueryParams,
451+
localVarHeaderParams,
452+
new HashMap<String, String>(),
453+
new String[] {"application/json"},
454+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
455+
} catch (ApiException ex) {
456+
CompletableFuture<ApiResponse<ManagedOrgsResponse>> result = new CompletableFuture<>();
457+
result.completeExceptionally(ex);
458+
return result;
459+
}
460+
return apiClient.invokeAPIAsync(
461+
"GET",
462+
builder,
463+
localVarHeaderParams,
464+
new String[] {},
465+
localVarPostBody,
466+
new HashMap<String, Object>(),
467+
false,
468+
new GenericType<ManagedOrgsResponse>() {});
469+
}
470+
301471
/**
302472
* Update a specific Org Config.
303473
*

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

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ public void setApiClient(ApiClient apiClient) {
158158
*
159159
* <p>See {@link #activateContentPackWithHttpInfo}.
160160
*
161-
* @param contentPackId The ID of the content pack to activate (for example, <code>aws-cloudtrail
162-
* </code>). (required)
161+
* @param contentPackId The ID of the content pack to activate. (required)
163162
* @throws ApiException if fails to make API call
164163
*/
165164
public void activateContentPack(String contentPackId) throws ApiException {
@@ -171,8 +170,7 @@ public void activateContentPack(String contentPackId) throws ApiException {
171170
*
172171
* <p>See {@link #activateContentPackWithHttpInfoAsync}.
173172
*
174-
* @param contentPackId The ID of the content pack to activate (for example, <code>aws-cloudtrail
175-
* </code>). (required)
173+
* @param contentPackId The ID of the content pack to activate. (required)
176174
* @return CompletableFuture
177175
*/
178176
public CompletableFuture<Void> activateContentPackAsync(String contentPackId) {
@@ -184,11 +182,11 @@ public CompletableFuture<Void> activateContentPackAsync(String contentPackId) {
184182
}
185183

186184
/**
187-
* Activate a Cloud SIEM content pack. This operation configures the necessary log filters or
188-
* security filters depending on the pricing model and updates the content pack activation state.
185+
* Activate a security monitoring content pack. This operation configures the necessary log
186+
* filters or security filters depending on the pricing model and updates the content pack
187+
* activation state.
189188
*
190-
* @param contentPackId The ID of the content pack to activate (for example, <code>aws-cloudtrail
191-
* </code>). (required)
189+
* @param contentPackId The ID of the content pack to activate. (required)
192190
* @return ApiResponse&lt;Void&gt;
193191
* @throws ApiException if fails to make API call
194192
* @http.response.details
@@ -234,7 +232,7 @@ public ApiResponse<Void> activateContentPackWithHttpInfo(String contentPackId)
234232
localVarHeaderParams,
235233
new HashMap<String, String>(),
236234
new String[] {"*/*"},
237-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
235+
new String[] {"apiKeyAuth", "appKeyAuth"});
238236
return apiClient.invokeAPI(
239237
"PUT",
240238
builder,
@@ -251,8 +249,7 @@ public ApiResponse<Void> activateContentPackWithHttpInfo(String contentPackId)
251249
*
252250
* <p>See {@link #activateContentPackWithHttpInfo}.
253251
*
254-
* @param contentPackId The ID of the content pack to activate (for example, <code>aws-cloudtrail
255-
* </code>). (required)
252+
* @param contentPackId The ID of the content pack to activate. (required)
256253
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
257254
*/
258255
public CompletableFuture<ApiResponse<Void>> activateContentPackWithHttpInfoAsync(
@@ -297,7 +294,7 @@ public CompletableFuture<ApiResponse<Void>> activateContentPackWithHttpInfoAsync
297294
localVarHeaderParams,
298295
new HashMap<String, String>(),
299296
new String[] {"*/*"},
300-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
297+
new String[] {"apiKeyAuth", "appKeyAuth"});
301298
} catch (ApiException ex) {
302299
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
303300
result.completeExceptionally(ex);
@@ -3426,8 +3423,7 @@ public ApiResponse<NotificationRuleResponse> createVulnerabilityNotificationRule
34263423
*
34273424
* <p>See {@link #deactivateContentPackWithHttpInfo}.
34283425
*
3429-
* @param contentPackId The ID of the content pack to deactivate (for example, <code>
3430-
* aws-cloudtrail</code>). (required)
3426+
* @param contentPackId The ID of the content pack to deactivate. (required)
34313427
* @throws ApiException if fails to make API call
34323428
*/
34333429
public void deactivateContentPack(String contentPackId) throws ApiException {
@@ -3439,8 +3435,7 @@ public void deactivateContentPack(String contentPackId) throws ApiException {
34393435
*
34403436
* <p>See {@link #deactivateContentPackWithHttpInfoAsync}.
34413437
*
3442-
* @param contentPackId The ID of the content pack to deactivate (for example, <code>
3443-
* aws-cloudtrail</code>). (required)
3438+
* @param contentPackId The ID of the content pack to deactivate. (required)
34443439
* @return CompletableFuture
34453440
*/
34463441
public CompletableFuture<Void> deactivateContentPackAsync(String contentPackId) {
@@ -3452,11 +3447,11 @@ public CompletableFuture<Void> deactivateContentPackAsync(String contentPackId)
34523447
}
34533448

34543449
/**
3455-
* Deactivate a Cloud SIEM content pack. This operation removes the content pack's configuration
3456-
* from log filters or security filters and updates the content pack activation state.
3450+
* Deactivate a security monitoring content pack. This operation removes the content pack's
3451+
* configuration from log filters or security filters and updates the content pack activation
3452+
* state.
34573453
*
3458-
* @param contentPackId The ID of the content pack to deactivate (for example, <code>
3459-
* aws-cloudtrail</code>). (required)
3454+
* @param contentPackId The ID of the content pack to deactivate. (required)
34603455
* @return ApiResponse&lt;Void&gt;
34613456
* @throws ApiException if fails to make API call
34623457
* @http.response.details
@@ -3502,7 +3497,7 @@ public ApiResponse<Void> deactivateContentPackWithHttpInfo(String contentPackId)
35023497
localVarHeaderParams,
35033498
new HashMap<String, String>(),
35043499
new String[] {"*/*"},
3505-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3500+
new String[] {"apiKeyAuth", "appKeyAuth"});
35063501
return apiClient.invokeAPI(
35073502
"PUT",
35083503
builder,
@@ -3519,8 +3514,7 @@ public ApiResponse<Void> deactivateContentPackWithHttpInfo(String contentPackId)
35193514
*
35203515
* <p>See {@link #deactivateContentPackWithHttpInfo}.
35213516
*
3522-
* @param contentPackId The ID of the content pack to deactivate (for example, <code>
3523-
* aws-cloudtrail</code>). (required)
3517+
* @param contentPackId The ID of the content pack to deactivate. (required)
35243518
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
35253519
*/
35263520
public CompletableFuture<ApiResponse<Void>> deactivateContentPackWithHttpInfoAsync(
@@ -3565,7 +3559,7 @@ public CompletableFuture<ApiResponse<Void>> deactivateContentPackWithHttpInfoAsy
35653559
localVarHeaderParams,
35663560
new HashMap<String, String>(),
35673561
new String[] {"*/*"},
3568-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3562+
new String[] {"apiKeyAuth", "appKeyAuth"});
35693563
} catch (ApiException ex) {
35703564
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
35713565
result.completeExceptionally(ex);
@@ -5765,8 +5759,9 @@ public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throw
57655759
}
57665760

57675761
/**
5768-
* Get the activation state, integration status, and log collection status for all Cloud SIEM
5769-
* content packs.
5762+
* Get the activation and configuration states for all security monitoring content packs. This
5763+
* endpoint returns status information about each content pack including activation state,
5764+
* integration status, and log collection status.
57705765
*
57715766
* @return ApiResponse&lt;SecurityMonitoringContentPackStatesResponse&gt;
57725767
* @throws ApiException if fails to make API call
@@ -5803,7 +5798,7 @@ public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throw
58035798
localVarHeaderParams,
58045799
new HashMap<String, String>(),
58055800
new String[] {"application/json"},
5806-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
5801+
new String[] {"apiKeyAuth", "appKeyAuth"});
58075802
return apiClient.invokeAPI(
58085803
"GET",
58095804
builder,
@@ -5851,7 +5846,7 @@ public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throw
58515846
localVarHeaderParams,
58525847
new HashMap<String, String>(),
58535848
new String[] {"application/json"},
5854-
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
5849+
new String[] {"apiKeyAuth", "appKeyAuth"});
58555850
} catch (ApiException ex) {
58565851
CompletableFuture<ApiResponse<SecurityMonitoringContentPackStatesResponse>> result =
58575852
new CompletableFuture<>();

0 commit comments

Comments
 (0)