Skip to content

Commit 1a2d01a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit cf78334 of spec repo
1 parent b72cf1d commit 1a2d01a

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": "d02c8a3",
3-
"generated": "2025-08-08 12:08:19.964"
2+
"spec_repo_commit": "cf78334",
3+
"generated": "2025-08-12 18:26:11.072"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14454,6 +14454,10 @@ components:
1445414454
description: Entity definition in raw JSON or YAML representation.
1445514455
example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice\n"
1445614456
type: string
14457+
EntityReference:
14458+
description: The unique reference for an IDP entity.
14459+
example: service:my-service
14460+
type: string
1445714461
EntityRelationships:
1445814462
description: Entity relationships.
1445914463
properties:
@@ -43034,6 +43038,57 @@ components:
4303443038
id:
4303543039
$ref: '#/components/schemas/ApiID'
4303643040
type: object
43041+
UpdateOutcomesAsyncAttributes:
43042+
description: The JSON:API attributes for a batched set of scorecard outcomes.
43043+
properties:
43044+
results:
43045+
description: Set of scorecard outcomes to update asynchronously.
43046+
items:
43047+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestItem'
43048+
type: array
43049+
type: object
43050+
UpdateOutcomesAsyncRequest:
43051+
description: Scorecard outcomes batch request.
43052+
properties:
43053+
data:
43054+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestData'
43055+
type: object
43056+
UpdateOutcomesAsyncRequestData:
43057+
description: Scorecard outcomes batch request data.
43058+
properties:
43059+
attributes:
43060+
$ref: '#/components/schemas/UpdateOutcomesAsyncAttributes'
43061+
type:
43062+
$ref: '#/components/schemas/UpdateOutcomesAsyncType'
43063+
type: object
43064+
UpdateOutcomesAsyncRequestItem:
43065+
description: Scorecard outcome for a single entity and rule.
43066+
properties:
43067+
entity_reference:
43068+
$ref: '#/components/schemas/EntityReference'
43069+
remarks:
43070+
description: Any remarks regarding the scorecard rule's evaluation, and
43071+
supports HTML hyperlinks.
43072+
example: 'See: <a href="https://app.datadoghq.com/services">Services</a>'
43073+
type: string
43074+
rule_id:
43075+
$ref: '#/components/schemas/RuleId'
43076+
state:
43077+
$ref: '#/components/schemas/State'
43078+
required:
43079+
- rule_id
43080+
- entity_reference
43081+
- state
43082+
type: object
43083+
UpdateOutcomesAsyncType:
43084+
default: batched-outcome
43085+
description: The JSON:API type for scorecard outcomes.
43086+
enum:
43087+
- batched-outcome
43088+
example: batched-outcome
43089+
type: string
43090+
x-enum-varnames:
43091+
- BATCHED_OUTCOME
4303743092
UpdateResourceEvaluationFiltersRequest:
4303843093
description: Request object to update a resource filter.
4303943094
properties:
@@ -61018,6 +61073,37 @@ paths:
6101861073
resultsPath: data
6101961074
x-unstable: '**Note**: This endpoint is in public beta.
6102061075

61076+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
61077+
post:
61078+
description: Updates multiple scorecard rule outcomes in a single batched request.
61079+
operationId: UpdateScorecardOutcomesAsync
61080+
requestBody:
61081+
content:
61082+
application/json:
61083+
schema:
61084+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequest'
61085+
description: Set of scorecard outcomes.
61086+
required: true
61087+
responses:
61088+
'202':
61089+
description: Accepted
61090+
'400':
61091+
$ref: '#/components/responses/BadRequestResponse'
61092+
'403':
61093+
$ref: '#/components/responses/ForbiddenResponse'
61094+
'429':
61095+
$ref: '#/components/responses/TooManyRequestsResponse'
61096+
security:
61097+
- apiKeyAuth: []
61098+
appKeyAuth: []
61099+
- AuthZ:
61100+
- apm_service_catalog_write
61101+
summary: Update Scorecard outcomes asynchronously
61102+
tags:
61103+
- Service Scorecards
61104+
x-codegen-request-body-name: body
61105+
x-unstable: '**Note**: This endpoint is in public beta.
61106+
6102161107
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6102261108
/api/v2/scorecard/outcomes/batch:
6102361109
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
@@ -7102,6 +7102,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
71027102
},
71037103
"operationResponseType": "OutcomesResponse",
71047104
},
7105+
"v2.UpdateScorecardOutcomesAsync": {
7106+
"body": {
7107+
"type": "UpdateOutcomesAsyncRequest",
7108+
"format": "",
7109+
},
7110+
"operationResponseType": "void",
7111+
},
71057112
"v2.CreateScorecardOutcomesBatch": {
71067113
"body": {
71077114
"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)