Skip to content

Commit dbb737f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a35d4f4 of spec repo
1 parent 3372c61 commit dbb737f

File tree

12 files changed

+1065
-2
lines changed

12 files changed

+1065
-2
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "4413e63",
3-
"generated": "2025-08-19 20:29:58.463"
2+
"spec_repo_commit": "a35d4f4",
3+
"generated": "2025-08-22 15:00:29.004"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14453,6 +14453,10 @@ components:
1445314453
description: Entity definition in raw JSON or YAML representation.
1445414454
example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice\n"
1445514455
type: string
14456+
EntityReference:
14457+
description: The unique reference for an IDP entity.
14458+
example: service:my-service
14459+
type: string
1445614460
EntityRelationships:
1445714461
description: Entity relationships.
1445814462
properties:
@@ -43724,6 +43728,57 @@ components:
4372443728
id:
4372543729
$ref: '#/components/schemas/ApiID'
4372643730
type: object
43731+
UpdateOutcomesAsyncAttributes:
43732+
description: The JSON:API attributes for a batched set of scorecard outcomes.
43733+
properties:
43734+
results:
43735+
description: Set of scorecard outcomes to update asynchronously.
43736+
items:
43737+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestItem'
43738+
type: array
43739+
type: object
43740+
UpdateOutcomesAsyncRequest:
43741+
description: Scorecard outcomes batch request.
43742+
properties:
43743+
data:
43744+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestData'
43745+
type: object
43746+
UpdateOutcomesAsyncRequestData:
43747+
description: Scorecard outcomes batch request data.
43748+
properties:
43749+
attributes:
43750+
$ref: '#/components/schemas/UpdateOutcomesAsyncAttributes'
43751+
type:
43752+
$ref: '#/components/schemas/UpdateOutcomesAsyncType'
43753+
type: object
43754+
UpdateOutcomesAsyncRequestItem:
43755+
description: Scorecard outcome for a single entity and rule.
43756+
properties:
43757+
entity_reference:
43758+
$ref: '#/components/schemas/EntityReference'
43759+
remarks:
43760+
description: Any remarks regarding the scorecard rule's evaluation. Supports
43761+
HTML hyperlinks.
43762+
example: 'See: <a href="https://app.datadoghq.com/services">Services</a>'
43763+
type: string
43764+
rule_id:
43765+
$ref: '#/components/schemas/RuleId'
43766+
state:
43767+
$ref: '#/components/schemas/State'
43768+
required:
43769+
- rule_id
43770+
- entity_reference
43771+
- state
43772+
type: object
43773+
UpdateOutcomesAsyncType:
43774+
default: batched-outcome
43775+
description: The JSON:API type for scorecard outcomes.
43776+
enum:
43777+
- batched-outcome
43778+
example: batched-outcome
43779+
type: string
43780+
x-enum-varnames:
43781+
- BATCHED_OUTCOME
4372743782
UpdateResourceEvaluationFiltersRequest:
4372843783
description: Request object to update a resource filter.
4372943784
properties:
@@ -61757,6 +61812,37 @@ paths:
6175761812
resultsPath: data
6175861813
x-unstable: '**Note**: This endpoint is in public beta.
6175961814

61815+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
61816+
post:
61817+
description: Updates multiple scorecard rule outcomes in a single batched request.
61818+
operationId: UpdateScorecardOutcomesAsync
61819+
requestBody:
61820+
content:
61821+
application/json:
61822+
schema:
61823+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequest'
61824+
description: Set of scorecard outcomes.
61825+
required: true
61826+
responses:
61827+
'202':
61828+
description: Accepted
61829+
'400':
61830+
$ref: '#/components/responses/BadRequestResponse'
61831+
'403':
61832+
$ref: '#/components/responses/ForbiddenResponse'
61833+
'429':
61834+
$ref: '#/components/responses/TooManyRequestsResponse'
61835+
security:
61836+
- apiKeyAuth: []
61837+
appKeyAuth: []
61838+
- AuthZ:
61839+
- apm_service_catalog_write
61840+
summary: Update Scorecard outcomes asynchronously
61841+
tags:
61842+
- Service Scorecards
61843+
x-codegen-request-body-name: body
61844+
x-unstable: '**Note**: This endpoint is in public beta.
61845+
6176061846
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6176161847
/api/v2/scorecard/outcomes/batch:
6176261848
post:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Update Scorecard outcomes asynchronously returns "Accepted" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ServiceScorecardsApi;
6+
import com.datadog.api.client.v2.model.State;
7+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncAttributes;
8+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncRequest;
9+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncRequestData;
10+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncRequestItem;
11+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncType;
12+
import java.util.Collections;
13+
14+
public class Example {
15+
public static void main(String[] args) {
16+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
17+
defaultClient.setUnstableOperationEnabled("v2.updateScorecardOutcomesAsync", true);
18+
ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
19+
20+
// there is a valid "create_scorecard_rule" in the system
21+
String CREATE_SCORECARD_RULE_DATA_ID = System.getenv("CREATE_SCORECARD_RULE_DATA_ID");
22+
23+
UpdateOutcomesAsyncRequest body =
24+
new UpdateOutcomesAsyncRequest()
25+
.data(
26+
new UpdateOutcomesAsyncRequestData()
27+
.attributes(
28+
new UpdateOutcomesAsyncAttributes()
29+
.results(
30+
Collections.singletonList(
31+
new UpdateOutcomesAsyncRequestItem()
32+
.ruleId(CREATE_SCORECARD_RULE_DATA_ID)
33+
.entityReference("service:my-service")
34+
.remarks(
35+
"""
36+
See: <a href="https://app.datadoghq.com/services">Services</a>
37+
""")
38+
.state(State.PASS))))
39+
.type(UpdateOutcomesAsyncType.BATCHED_OUTCOME));
40+
41+
try {
42+
apiInstance.updateScorecardOutcomesAsync(body);
43+
} catch (ApiException e) {
44+
System.err.println(
45+
"Exception when calling ServiceScorecardsApi#updateScorecardOutcomesAsync");
46+
System.err.println("Status code: " + e.getCode());
47+
System.err.println("Reason: " + e.getResponseBody());
48+
System.err.println("Response headers: " + e.getResponseHeaders());
49+
e.printStackTrace();
50+
}
51+
}
52+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ public class ApiClient {
763763
put("v2.deleteScorecardRule", false);
764764
put("v2.listScorecardOutcomes", false);
765765
put("v2.listScorecardRules", false);
766+
put("v2.updateScorecardOutcomesAsync", false);
766767
put("v2.updateScorecardRule", false);
767768
put("v2.createIncidentService", false);
768769
put("v2.deleteIncidentService", false);

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

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.datadog.api.client.v2.model.OutcomesBatchResponse;
1414
import com.datadog.api.client.v2.model.OutcomesResponse;
1515
import com.datadog.api.client.v2.model.OutcomesResponseDataItem;
16+
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncRequest;
1617
import com.datadog.api.client.v2.model.UpdateRuleRequest;
1718
import com.datadog.api.client.v2.model.UpdateRuleResponse;
1819
import jakarta.ws.rs.client.Invocation;
@@ -1295,6 +1296,155 @@ public CompletableFuture<ApiResponse<ListRulesResponse>> listScorecardRulesWithH
12951296
new GenericType<ListRulesResponse>() {});
12961297
}
12971298

1299+
/**
1300+
* Update Scorecard outcomes asynchronously.
1301+
*
1302+
* <p>See {@link #updateScorecardOutcomesAsyncWithHttpInfo}.
1303+
*
1304+
* @param body Set of scorecard outcomes. (required)
1305+
* @throws ApiException if fails to make API call
1306+
*/
1307+
public void updateScorecardOutcomesAsync(UpdateOutcomesAsyncRequest body) throws ApiException {
1308+
updateScorecardOutcomesAsyncWithHttpInfo(body);
1309+
}
1310+
1311+
/**
1312+
* Update Scorecard outcomes asynchronously.
1313+
*
1314+
* <p>See {@link #updateScorecardOutcomesAsyncWithHttpInfoAsync}.
1315+
*
1316+
* @param body Set of scorecard outcomes. (required)
1317+
* @return CompletableFuture
1318+
*/
1319+
public CompletableFuture<Void> updateScorecardOutcomesAsyncAsync(
1320+
UpdateOutcomesAsyncRequest body) {
1321+
return updateScorecardOutcomesAsyncWithHttpInfoAsync(body)
1322+
.thenApply(
1323+
response -> {
1324+
return response.getData();
1325+
});
1326+
}
1327+
1328+
/**
1329+
* Updates multiple scorecard rule outcomes in a single batched request.
1330+
*
1331+
* @param body Set of scorecard outcomes. (required)
1332+
* @return ApiResponse&lt;Void&gt;
1333+
* @throws ApiException if fails to make API call
1334+
* @http.response.details
1335+
* <table border="1">
1336+
* <caption>Response details</caption>
1337+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1338+
* <tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
1339+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
1340+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
1341+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1342+
* </table>
1343+
*/
1344+
public ApiResponse<Void> updateScorecardOutcomesAsyncWithHttpInfo(UpdateOutcomesAsyncRequest body)
1345+
throws ApiException {
1346+
// Check if unstable operation is enabled
1347+
String operationId = "updateScorecardOutcomesAsync";
1348+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1349+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1350+
} else {
1351+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
1352+
}
1353+
Object localVarPostBody = body;
1354+
1355+
// verify the required parameter 'body' is set
1356+
if (body == null) {
1357+
throw new ApiException(
1358+
400, "Missing the required parameter 'body' when calling updateScorecardOutcomesAsync");
1359+
}
1360+
// create path and map variables
1361+
String localVarPath = "/api/v2/scorecard/outcomes";
1362+
1363+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1364+
1365+
Invocation.Builder builder =
1366+
apiClient.createBuilder(
1367+
"v2.ServiceScorecardsApi.updateScorecardOutcomesAsync",
1368+
localVarPath,
1369+
new ArrayList<Pair>(),
1370+
localVarHeaderParams,
1371+
new HashMap<String, String>(),
1372+
new String[] {"*/*"},
1373+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1374+
return apiClient.invokeAPI(
1375+
"POST",
1376+
builder,
1377+
localVarHeaderParams,
1378+
new String[] {"application/json"},
1379+
localVarPostBody,
1380+
new HashMap<String, Object>(),
1381+
false,
1382+
null);
1383+
}
1384+
1385+
/**
1386+
* Update Scorecard outcomes asynchronously.
1387+
*
1388+
* <p>See {@link #updateScorecardOutcomesAsyncWithHttpInfo}.
1389+
*
1390+
* @param body Set of scorecard outcomes. (required)
1391+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
1392+
*/
1393+
public CompletableFuture<ApiResponse<Void>> updateScorecardOutcomesAsyncWithHttpInfoAsync(
1394+
UpdateOutcomesAsyncRequest body) {
1395+
// Check if unstable operation is enabled
1396+
String operationId = "updateScorecardOutcomesAsync";
1397+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1398+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1399+
} else {
1400+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1401+
result.completeExceptionally(
1402+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
1403+
return result;
1404+
}
1405+
Object localVarPostBody = body;
1406+
1407+
// verify the required parameter 'body' is set
1408+
if (body == null) {
1409+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1410+
result.completeExceptionally(
1411+
new ApiException(
1412+
400,
1413+
"Missing the required parameter 'body' when calling updateScorecardOutcomesAsync"));
1414+
return result;
1415+
}
1416+
// create path and map variables
1417+
String localVarPath = "/api/v2/scorecard/outcomes";
1418+
1419+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1420+
1421+
Invocation.Builder builder;
1422+
try {
1423+
builder =
1424+
apiClient.createBuilder(
1425+
"v2.ServiceScorecardsApi.updateScorecardOutcomesAsync",
1426+
localVarPath,
1427+
new ArrayList<Pair>(),
1428+
localVarHeaderParams,
1429+
new HashMap<String, String>(),
1430+
new String[] {"*/*"},
1431+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1432+
} catch (ApiException ex) {
1433+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1434+
result.completeExceptionally(ex);
1435+
return result;
1436+
}
1437+
return apiClient.invokeAPIAsync(
1438+
"POST",
1439+
builder,
1440+
localVarHeaderParams,
1441+
new String[] {"application/json"},
1442+
localVarPostBody,
1443+
new HashMap<String, Object>(),
1444+
false,
1445+
null);
1446+
}
1447+
12981448
/**
12991449
* Update an existing rule.
13001450
*

0 commit comments

Comments
 (0)