Skip to content

Commit ec18d29

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9f90cd6 of spec repo
1 parent 9055ce3 commit ec18d29

15 files changed

+568
-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:47.677"
2+
"spec_repo_commit": "9f90cd6",
3+
"generated": "2025-08-20 17:03:24.846"
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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Update Scorecard outcomes asynchronously returns "Accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateScorecardOutcomesAsync"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
results: [
16+
{
17+
entityReference: "service:my-service",
18+
remarks: `See: <a href="https://app.datadoghq.com/services">Services</a>`,
19+
ruleId: "q8MQxk8TCqrHnWkx",
20+
state: "pass",
21+
},
22+
],
23+
},
24+
type: "batched-outcome",
25+
},
26+
},
27+
};
28+
29+
apiInstance
30+
.updateScorecardOutcomesAsync(params)
31+
.then((data: any) => {
32+
console.log(
33+
"API called successfully. Returned data: " + JSON.stringify(data)
34+
);
35+
})
36+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7118,6 +7118,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
71187118
},
71197119
"operationResponseType": "OutcomesResponse",
71207120
},
7121+
"v2.UpdateScorecardOutcomesAsync": {
7122+
"body": {
7123+
"type": "UpdateOutcomesAsyncRequest",
7124+
"format": "",
7125+
},
7126+
"operationResponseType": "void",
7127+
},
71217128
"v2.CreateScorecardOutcomesBatch": {
71227129
"body": {
71237130
"type": "OutcomesBatchRequest",

features/v2/service_scorecards.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,22 @@ Feature: Service Scorecards
121121
Then the response status is 200 OK
122122
And the response has 4 items
123123

124+
@generated @skip @team:DataDog/service-catalog
125+
Scenario: Update Scorecard outcomes asynchronously returns "Accepted" response
126+
Given operation "UpdateScorecardOutcomesAsync" enabled
127+
And new "UpdateScorecardOutcomesAsync" request
128+
And body with value {"data": {"attributes": {"results": [{"entity_reference": "service:my-service", "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>", "rule_id": "q8MQxk8TCqrHnWkx", "state": "pass"}]}, "type": "batched-outcome"}}
129+
When the request is sent
130+
Then the response status is 202 Accepted
131+
132+
@generated @skip @team:DataDog/service-catalog
133+
Scenario: Update Scorecard outcomes asynchronously returns "Bad Request" response
134+
Given operation "UpdateScorecardOutcomesAsync" enabled
135+
And new "UpdateScorecardOutcomesAsync" request
136+
And body with value {"data": {"attributes": {"results": [{"entity_reference": "service:my-service", "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>", "rule_id": "q8MQxk8TCqrHnWkx", "state": "pass"}]}, "type": "batched-outcome"}}
137+
When the request is sent
138+
Then the response status is 400 Bad Request
139+
124140
@generated @skip @team:DataDog/service-catalog
125141
Scenario: Update an existing rule returns "Bad Request" response
126142
Given operation "UpdateScorecardRule" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,12 @@
27422742
"type": "safe"
27432743
}
27442744
},
2745+
"UpdateScorecardOutcomesAsync": {
2746+
"tag": "Service Scorecards",
2747+
"undo": {
2748+
"type": "idempotent"
2749+
}
2750+
},
27452751
"CreateScorecardOutcomesBatch": {
27462752
"tag": "Service Scorecards",
27472753
"undo": {

packages/datadog-api-client-common/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ export function createConfiguration(
298298
"v2.deleteScorecardRule": false,
299299
"v2.listScorecardOutcomes": false,
300300
"v2.listScorecardRules": false,
301+
"v2.updateScorecardOutcomesAsync": false,
301302
"v2.updateScorecardRule": false,
302303
"v2.createIncidentService": false,
303304
"v2.deleteIncidentService": false,

packages/datadog-api-client-v2/apis/ServiceScorecardsApi.ts

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { OutcomesBatchRequest } from "../models/OutcomesBatchRequest";
2525
import { OutcomesBatchResponse } from "../models/OutcomesBatchResponse";
2626
import { OutcomesResponse } from "../models/OutcomesResponse";
2727
import { OutcomesResponseDataItem } from "../models/OutcomesResponseDataItem";
28+
import { UpdateOutcomesAsyncRequest } from "../models/UpdateOutcomesAsyncRequest";
2829
import { UpdateRuleRequest } from "../models/UpdateRuleRequest";
2930
import { UpdateRuleResponse } from "../models/UpdateRuleResponse";
3031

@@ -388,6 +389,55 @@ export class ServiceScorecardsApiRequestFactory extends BaseAPIRequestFactory {
388389
return requestContext;
389390
}
390391

392+
public async updateScorecardOutcomesAsync(
393+
body: UpdateOutcomesAsyncRequest,
394+
_options?: Configuration
395+
): Promise<RequestContext> {
396+
const _config = _options || this.configuration;
397+
398+
logger.warn("Using unstable operation 'updateScorecardOutcomesAsync'");
399+
if (!_config.unstableOperations["v2.updateScorecardOutcomesAsync"]) {
400+
throw new Error(
401+
"Unstable operation 'updateScorecardOutcomesAsync' is disabled"
402+
);
403+
}
404+
405+
// verify required parameter 'body' is not null or undefined
406+
if (body === null || body === undefined) {
407+
throw new RequiredError("body", "updateScorecardOutcomesAsync");
408+
}
409+
410+
// Path Params
411+
const localVarPath = "/api/v2/scorecard/outcomes";
412+
413+
// Make Request Context
414+
const requestContext = _config
415+
.getServer("v2.ServiceScorecardsApi.updateScorecardOutcomesAsync")
416+
.makeRequestContext(localVarPath, HttpMethod.POST);
417+
requestContext.setHeaderParam("Accept", "*/*");
418+
requestContext.setHttpConfig(_config.httpConfig);
419+
420+
// Body Params
421+
const contentType = ObjectSerializer.getPreferredMediaType([
422+
"application/json",
423+
]);
424+
requestContext.setHeaderParam("Content-Type", contentType);
425+
const serializedBody = ObjectSerializer.stringify(
426+
ObjectSerializer.serialize(body, "UpdateOutcomesAsyncRequest", ""),
427+
contentType
428+
);
429+
requestContext.setBody(serializedBody);
430+
431+
// Apply auth methods
432+
applySecurityAuthentication(_config, requestContext, [
433+
"apiKeyAuth",
434+
"appKeyAuth",
435+
"AuthZ",
436+
]);
437+
438+
return requestContext;
439+
}
440+
391441
public async updateScorecardRule(
392442
ruleId: string,
393443
body: UpdateRuleRequest,
@@ -751,6 +801,64 @@ export class ServiceScorecardsApiResponseProcessor {
751801
);
752802
}
753803

804+
/**
805+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
806+
* to the expected objects
807+
*
808+
* @params response Response returned by the server for a request to updateScorecardOutcomesAsync
809+
* @throws ApiException if the response code was not in [200, 299]
810+
*/
811+
public async updateScorecardOutcomesAsync(
812+
response: ResponseContext
813+
): Promise<void> {
814+
const contentType = ObjectSerializer.normalizeMediaType(
815+
response.headers["content-type"]
816+
);
817+
if (response.httpStatusCode === 202) {
818+
return;
819+
}
820+
if (
821+
response.httpStatusCode === 400 ||
822+
response.httpStatusCode === 403 ||
823+
response.httpStatusCode === 429
824+
) {
825+
const bodyText = ObjectSerializer.parse(
826+
await response.body.text(),
827+
contentType
828+
);
829+
let body: APIErrorResponse;
830+
try {
831+
body = ObjectSerializer.deserialize(
832+
bodyText,
833+
"APIErrorResponse"
834+
) as APIErrorResponse;
835+
} catch (error) {
836+
logger.debug(`Got error deserializing error: ${error}`);
837+
throw new ApiException<APIErrorResponse>(
838+
response.httpStatusCode,
839+
bodyText
840+
);
841+
}
842+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
843+
}
844+
845+
// Work around for missing responses in specification, e.g. for petstore.yaml
846+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
847+
const body: void = ObjectSerializer.deserialize(
848+
ObjectSerializer.parse(await response.body.text(), contentType),
849+
"void",
850+
""
851+
) as void;
852+
return body;
853+
}
854+
855+
const body = (await response.body.text()) || "";
856+
throw new ApiException<string>(
857+
response.httpStatusCode,
858+
'Unknown API Status Code!\nBody: "' + body + '"'
859+
);
860+
}
861+
754862
/**
755863
* Unwraps the actual response sent by the server from the response context and deserializes the response content
756864
* to the expected objects
@@ -944,6 +1052,14 @@ export interface ServiceScorecardsApiListScorecardRulesRequest {
9441052
fieldsScorecard?: string;
9451053
}
9461054

1055+
export interface ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest {
1056+
/**
1057+
* Set of scorecard outcomes.
1058+
* @type UpdateOutcomesAsyncRequest
1059+
*/
1060+
body: UpdateOutcomesAsyncRequest;
1061+
}
1062+
9471063
export interface ServiceScorecardsApiUpdateScorecardRuleRequest {
9481064
/**
9491065
* The ID of the rule.
@@ -1201,6 +1317,27 @@ export class ServiceScorecardsApi {
12011317
}
12021318
}
12031319

1320+
/**
1321+
* Updates multiple scorecard rule outcomes in a single batched request.
1322+
* @param param The request object
1323+
*/
1324+
public updateScorecardOutcomesAsync(
1325+
param: ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest,
1326+
options?: Configuration
1327+
): Promise<void> {
1328+
const requestContextPromise =
1329+
this.requestFactory.updateScorecardOutcomesAsync(param.body, options);
1330+
return requestContextPromise.then((requestContext) => {
1331+
return this.configuration.httpApi
1332+
.send(requestContext)
1333+
.then((responseContext) => {
1334+
return this.responseProcessor.updateScorecardOutcomesAsync(
1335+
responseContext
1336+
);
1337+
});
1338+
});
1339+
}
1340+
12041341
/**
12051342
* Updates an existing rule.
12061343
* @param param The request object

0 commit comments

Comments
 (0)