Skip to content

Commit a888fb1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c9f30db of spec repo
1 parent 3e94288 commit a888fb1

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": "8001cbb",
3-
"generated": "2025-08-13 20:28:25.331"
2+
"spec_repo_commit": "c9f30db",
3+
"generated": "2025-08-15 16:36:42.349"
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:
@@ -43591,6 +43595,57 @@ components:
4359143595
id:
4359243596
$ref: '#/components/schemas/ApiID'
4359343597
type: object
43598+
UpdateOutcomesAsyncAttributes:
43599+
description: The JSON:API attributes for a batched set of scorecard outcomes.
43600+
properties:
43601+
results:
43602+
description: Set of scorecard outcomes to update asynchronously.
43603+
items:
43604+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestItem'
43605+
type: array
43606+
type: object
43607+
UpdateOutcomesAsyncRequest:
43608+
description: Scorecard outcomes batch request.
43609+
properties:
43610+
data:
43611+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequestData'
43612+
type: object
43613+
UpdateOutcomesAsyncRequestData:
43614+
description: Scorecard outcomes batch request data.
43615+
properties:
43616+
attributes:
43617+
$ref: '#/components/schemas/UpdateOutcomesAsyncAttributes'
43618+
type:
43619+
$ref: '#/components/schemas/UpdateOutcomesAsyncType'
43620+
type: object
43621+
UpdateOutcomesAsyncRequestItem:
43622+
description: Scorecard outcome for a single entity and rule.
43623+
properties:
43624+
entity_reference:
43625+
$ref: '#/components/schemas/EntityReference'
43626+
remarks:
43627+
description: Any remarks regarding the scorecard rule's evaluation, and
43628+
supports HTML hyperlinks.
43629+
example: 'See: <a href="https://app.datadoghq.com/services">Services</a>'
43630+
type: string
43631+
rule_id:
43632+
$ref: '#/components/schemas/RuleId'
43633+
state:
43634+
$ref: '#/components/schemas/State'
43635+
required:
43636+
- rule_id
43637+
- entity_reference
43638+
- state
43639+
type: object
43640+
UpdateOutcomesAsyncType:
43641+
default: batched-outcome
43642+
description: The JSON:API type for scorecard outcomes.
43643+
enum:
43644+
- batched-outcome
43645+
example: batched-outcome
43646+
type: string
43647+
x-enum-varnames:
43648+
- BATCHED_OUTCOME
4359443649
UpdateResourceEvaluationFiltersRequest:
4359543650
description: Request object to update a resource filter.
4359643651
properties:
@@ -61575,6 +61630,37 @@ paths:
6157561630
resultsPath: data
6157661631
x-unstable: '**Note**: This endpoint is in public beta.
6157761632

61633+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
61634+
post:
61635+
description: Updates multiple scorecard rule outcomes in a single batched request.
61636+
operationId: UpdateScorecardOutcomesAsync
61637+
requestBody:
61638+
content:
61639+
application/json:
61640+
schema:
61641+
$ref: '#/components/schemas/UpdateOutcomesAsyncRequest'
61642+
description: Set of scorecard outcomes.
61643+
required: true
61644+
responses:
61645+
'202':
61646+
description: Accepted
61647+
'400':
61648+
$ref: '#/components/responses/BadRequestResponse'
61649+
'403':
61650+
$ref: '#/components/responses/ForbiddenResponse'
61651+
'429':
61652+
$ref: '#/components/responses/TooManyRequestsResponse'
61653+
security:
61654+
- apiKeyAuth: []
61655+
appKeyAuth: []
61656+
- AuthZ:
61657+
- apm_service_catalog_write
61658+
summary: Update Scorecard outcomes asynchronously
61659+
tags:
61660+
- Service Scorecards
61661+
x-codegen-request-body-name: body
61662+
x-unstable: '**Note**: This endpoint is in public beta.
61663+
6157861664
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6157961665
/api/v2/scorecard/outcomes/batch:
6158061666
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)