Skip to content

Commit 51e0fea

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d434565 of spec repo
1 parent cc15cdb commit 51e0fea

20 files changed

+1345
-65
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 114 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24779,6 +24779,30 @@ components:
2477924779
required:
2478024780
- data
2478124781
type: object
24782+
GetSuppressionVersionHistoryData:
24783+
description: Data for the suppression version history.
24784+
properties:
24785+
attributes:
24786+
$ref: '#/components/schemas/SuppressionVersionHistory'
24787+
id:
24788+
description: ID of the suppression.
24789+
type: string
24790+
type:
24791+
$ref: '#/components/schemas/GetSuppressionVersionHistoryDataType'
24792+
type: object
24793+
GetSuppressionVersionHistoryDataType:
24794+
description: Type of data.
24795+
enum:
24796+
- suppression_version_history
24797+
type: string
24798+
x-enum-varnames:
24799+
- SUPPRESSIONVERSIONHISTORY
24800+
GetSuppressionVersionHistoryResponse:
24801+
description: Response for getting the suppression version history.
24802+
properties:
24803+
data:
24804+
$ref: '#/components/schemas/GetSuppressionVersionHistoryData'
24805+
type: object
2478224806
GetTeamMembershipsSort:
2478324807
description: Specifies the order of returned team memberships
2478424808
enum:
@@ -44235,38 +44259,13 @@ components:
4423544259
description: The `RuleVersionHistory` `data`.
4423644260
type: object
4423744261
type: object
44238-
RuleVersionUpdate:
44239-
description: A change in a rule version.
44240-
properties:
44241-
change:
44242-
description: The new value of the field.
44243-
example: cloud_provider:aws
44244-
type: string
44245-
field:
44246-
description: The field that was changed.
44247-
example: Tags
44248-
type: string
44249-
type:
44250-
$ref: '#/components/schemas/RuleVersionUpdateType'
44251-
type: object
44252-
RuleVersionUpdateType:
44253-
description: The type of change.
44254-
enum:
44255-
- create
44256-
- update
44257-
- delete
44258-
type: string
44259-
x-enum-varnames:
44260-
- CREATE
44261-
- UPDATE
44262-
- DELETE
4426344262
RuleVersions:
4426444263
description: A rule version with a list of updates.
4426544264
properties:
4426644265
changes:
4426744266
description: A list of changes.
4426844267
items:
44269-
$ref: '#/components/schemas/RuleVersionUpdate'
44268+
$ref: '#/components/schemas/VersionHistoryUpdate'
4427044269
type: array
4427144270
rule:
4427244271
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
@@ -52826,6 +52825,32 @@ components:
5282652825
format: double
5282752826
type: number
5282852827
type: object
52828+
SuppressionVersionHistory:
52829+
description: Response object containing the version history of a suppression.
52830+
properties:
52831+
count:
52832+
description: The number of suppression versions.
52833+
format: int32
52834+
maximum: 2147483647
52835+
type: integer
52836+
data:
52837+
additionalProperties:
52838+
$ref: '#/components/schemas/SuppressionVersions'
52839+
description: A suppression version with a list of updates.
52840+
description: The version history of a suppression.
52841+
type: object
52842+
type: object
52843+
SuppressionVersions:
52844+
description: A suppression version with a list of updates.
52845+
properties:
52846+
changes:
52847+
description: A list of changes.
52848+
items:
52849+
$ref: '#/components/schemas/VersionHistoryUpdate'
52850+
type: array
52851+
suppression:
52852+
$ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes'
52853+
type: object
5282952854
TableResultV2:
5283052855
description: A reference table resource containing its full configuration and
5283152856
state.
@@ -57156,6 +57181,31 @@ components:
5715657181
example: 1
5715757182
format: int64
5715857183
type: integer
57184+
VersionHistoryUpdate:
57185+
description: A change in a rule version.
57186+
properties:
57187+
change:
57188+
description: The new value of the field.
57189+
example: cloud_provider:aws
57190+
type: string
57191+
field:
57192+
description: The field that was changed.
57193+
example: Tags
57194+
type: string
57195+
type:
57196+
$ref: '#/components/schemas/VersionHistoryUpdateType'
57197+
type: object
57198+
VersionHistoryUpdateType:
57199+
description: The type of change.
57200+
enum:
57201+
- create
57202+
- update
57203+
- delete
57204+
type: string
57205+
x-enum-varnames:
57206+
- CREATE
57207+
- UPDATE
57208+
- DELETE
5715957209
VirusTotalAPIKey:
5716057210
description: The definition of the `VirusTotalAPIKey` object.
5716157211
properties:
@@ -69009,6 +69059,9 @@ paths:
6900969059
operator: OR
6901069060
permissions:
6901169061
- incident_read
69062+
x-unstable: '**Note**: This endpoint is in Preview.
69063+
69064+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6901269065
post:
6901369066
description: Create an impact for an incident.
6901469067
operationId: CreateIncidentImpact
@@ -69052,6 +69105,9 @@ paths:
6905269105
operator: OR
6905369106
permissions:
6905469107
- incident_write
69108+
x-unstable: '**Note**: This endpoint is in Preview.
69109+
69110+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6905569111
/api/v2/incidents/{incident_id}/impacts/{impact_id}:
6905669112
delete:
6905769113
description: Delete an incident impact.
@@ -69082,6 +69138,9 @@ paths:
6908269138
operator: OR
6908369139
permissions:
6908469140
- incident_write
69141+
x-unstable: '**Note**: This endpoint is in Preview.
69142+
69143+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6908569144
/api/v2/incidents/{incident_id}/relationships/integrations:
6908669145
get:
6908769146
description: Get all integration metadata for an incident.
@@ -81986,6 +82045,35 @@ paths:
8198682045
summary: Update a suppression rule
8198782046
tags:
8198882047
- Security Monitoring
82048+
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history:
82049+
get:
82050+
description: Get a suppression's version history.
82051+
operationId: GetSuppressionVersionHistory
82052+
parameters:
82053+
- $ref: '#/components/parameters/SecurityMonitoringSuppressionID'
82054+
- $ref: '#/components/parameters/PageSize'
82055+
- $ref: '#/components/parameters/PageNumber'
82056+
responses:
82057+
'200':
82058+
content:
82059+
application/json:
82060+
schema:
82061+
$ref: '#/components/schemas/GetSuppressionVersionHistoryResponse'
82062+
description: OK
82063+
'403':
82064+
$ref: '#/components/responses/NotAuthorizedResponse'
82065+
'404':
82066+
$ref: '#/components/responses/NotFoundResponse'
82067+
'429':
82068+
$ref: '#/components/responses/TooManyRequestsResponse'
82069+
security:
82070+
- apiKeyAuth: []
82071+
appKeyAuth: []
82072+
- AuthZ:
82073+
- security_monitoring_suppressions_read
82074+
summary: Get a suppression's version history
82075+
tags:
82076+
- Security Monitoring
8198982077
/api/v2/security_monitoring/rules:
8199082078
get:
8199182079
description: List rules.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get a suppression's version history 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.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.GetSuppressionVersionHistoryResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
12+
13+
// there is a valid "suppression" in the system
14+
String SUPPRESSION_DATA_ID = System.getenv("SUPPRESSION_DATA_ID");
15+
16+
try {
17+
GetSuppressionVersionHistoryResponse result =
18+
apiInstance.getSuppressionVersionHistory(SUPPRESSION_DATA_ID);
19+
System.out.println(result);
20+
} catch (ApiException e) {
21+
System.err.println(
22+
"Exception when calling SecurityMonitoringApi#getSuppressionVersionHistory");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,14 @@ public class ApiClient {
748748
put("v2.updateDeploymentGate", false);
749749
put("v2.updateDeploymentRule", false);
750750
put("v2.createIncident", false);
751+
put("v2.createIncidentImpact", false);
751752
put("v2.createIncidentIntegration", false);
752753
put("v2.createIncidentNotificationRule", false);
753754
put("v2.createIncidentNotificationTemplate", false);
754755
put("v2.createIncidentTodo", false);
755756
put("v2.createIncidentType", false);
756757
put("v2.deleteIncident", false);
758+
put("v2.deleteIncidentImpact", false);
757759
put("v2.deleteIncidentIntegration", false);
758760
put("v2.deleteIncidentNotificationRule", false);
759761
put("v2.deleteIncidentNotificationTemplate", false);
@@ -766,6 +768,7 @@ public class ApiClient {
766768
put("v2.getIncidentTodo", false);
767769
put("v2.getIncidentType", false);
768770
put("v2.listIncidentAttachments", false);
771+
put("v2.listIncidentImpacts", false);
769772
put("v2.listIncidentIntegrations", false);
770773
put("v2.listIncidentNotificationRules", false);
771774
put("v2.listIncidentNotificationTemplates", false);

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ public ApiResponse<IncidentImpactResponse> createIncidentImpactWithHttpInfo(
353353
IncidentImpactCreateRequest body,
354354
CreateIncidentImpactOptionalParameters parameters)
355355
throws ApiException {
356+
// Check if unstable operation is enabled
357+
String operationId = "createIncidentImpact";
358+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
359+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
360+
} else {
361+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
362+
}
356363
Object localVarPostBody = body;
357364

358365
// verify the required parameter 'incidentId' is set
@@ -413,6 +420,16 @@ public ApiResponse<IncidentImpactResponse> createIncidentImpactWithHttpInfo(
413420
String incidentId,
414421
IncidentImpactCreateRequest body,
415422
CreateIncidentImpactOptionalParameters parameters) {
423+
// Check if unstable operation is enabled
424+
String operationId = "createIncidentImpact";
425+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
426+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
427+
} else {
428+
CompletableFuture<ApiResponse<IncidentImpactResponse>> result = new CompletableFuture<>();
429+
result.completeExceptionally(
430+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
431+
return result;
432+
}
416433
Object localVarPostBody = body;
417434

418435
// verify the required parameter 'incidentId' is set
@@ -1501,6 +1518,13 @@ public CompletableFuture<Void> deleteIncidentImpactAsync(String incidentId, Stri
15011518
*/
15021519
public ApiResponse<Void> deleteIncidentImpactWithHttpInfo(String incidentId, String impactId)
15031520
throws ApiException {
1521+
// Check if unstable operation is enabled
1522+
String operationId = "deleteIncidentImpact";
1523+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1524+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1525+
} else {
1526+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
1527+
}
15041528
Object localVarPostBody = null;
15051529

15061530
// verify the required parameter 'incidentId' is set
@@ -1554,6 +1578,16 @@ public ApiResponse<Void> deleteIncidentImpactWithHttpInfo(String incidentId, Str
15541578
*/
15551579
public CompletableFuture<ApiResponse<Void>> deleteIncidentImpactWithHttpInfoAsync(
15561580
String incidentId, String impactId) {
1581+
// Check if unstable operation is enabled
1582+
String operationId = "deleteIncidentImpact";
1583+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1584+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1585+
} else {
1586+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1587+
result.completeExceptionally(
1588+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
1589+
return result;
1590+
}
15571591
Object localVarPostBody = null;
15581592

15591593
// verify the required parameter 'incidentId' is set
@@ -4107,6 +4141,13 @@ public CompletableFuture<IncidentImpactsResponse> listIncidentImpactsAsync(
41074141
*/
41084142
public ApiResponse<IncidentImpactsResponse> listIncidentImpactsWithHttpInfo(
41094143
String incidentId, ListIncidentImpactsOptionalParameters parameters) throws ApiException {
4144+
// Check if unstable operation is enabled
4145+
String operationId = "listIncidentImpacts";
4146+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
4147+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
4148+
} else {
4149+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
4150+
}
41104151
Object localVarPostBody = null;
41114152

41124153
// verify the required parameter 'incidentId' is set
@@ -4158,6 +4199,16 @@ public ApiResponse<IncidentImpactsResponse> listIncidentImpactsWithHttpInfo(
41584199
public CompletableFuture<ApiResponse<IncidentImpactsResponse>>
41594200
listIncidentImpactsWithHttpInfoAsync(
41604201
String incidentId, ListIncidentImpactsOptionalParameters parameters) {
4202+
// Check if unstable operation is enabled
4203+
String operationId = "listIncidentImpacts";
4204+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
4205+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
4206+
} else {
4207+
CompletableFuture<ApiResponse<IncidentImpactsResponse>> result = new CompletableFuture<>();
4208+
result.completeExceptionally(
4209+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
4210+
return result;
4211+
}
41614212
Object localVarPostBody = null;
41624213

41634214
// verify the required parameter 'incidentId' is set

0 commit comments

Comments
 (0)