Skip to content

Commit a7eb083

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

File tree

13 files changed

+499
-2
lines changed

13 files changed

+499
-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:07:03.564"
2+
"spec_repo_commit": "cf78334",
3+
"generated": "2025-08-12 18:24:59.988"
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:

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": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7112,6 +7112,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
71127112
},
71137113
operationResponseType: "OutcomesResponse",
71147114
},
7115+
"ServiceScorecardsApi.V2.UpdateScorecardOutcomesAsync": {
7116+
body: {
7117+
type: "UpdateOutcomesAsyncRequest",
7118+
format: "",
7119+
},
7120+
operationResponseType: "{}",
7121+
},
71157122
"ServiceScorecardsApi.V2.CreateScorecardOutcomesBatch": {
71167123
body: {
71177124
type: "OutcomesBatchRequest",

services/service_scorecards/src/v2/ServiceScorecardsApi.ts

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { OutcomesBatchRequest } from "./models/OutcomesBatchRequest";
3131
import { OutcomesBatchResponse } from "./models/OutcomesBatchResponse";
3232
import { OutcomesResponse } from "./models/OutcomesResponse";
3333
import { OutcomesResponseDataItem } from "./models/OutcomesResponseDataItem";
34+
import { UpdateOutcomesAsyncRequest } from "./models/UpdateOutcomesAsyncRequest";
3435
import { UpdateRuleRequest } from "./models/UpdateRuleRequest";
3536
import { UpdateRuleResponse } from "./models/UpdateRuleResponse";
3637
import { version } from "../version";
@@ -471,6 +472,67 @@ export class ServiceScorecardsApiRequestFactory extends BaseAPIRequestFactory {
471472
return requestContext;
472473
}
473474

475+
public async updateScorecardOutcomesAsync(
476+
body: UpdateOutcomesAsyncRequest,
477+
_options?: Configuration,
478+
): Promise<RequestContext> {
479+
const _config = _options || this.configuration;
480+
481+
if (
482+
!_config.unstableOperations[
483+
"ServiceScorecardsApi.v2.updateScorecardOutcomesAsync"
484+
]
485+
) {
486+
throw new Error(
487+
"Unstable operation 'updateScorecardOutcomesAsync' is disabled. Enable it by setting `configuration.unstableOperations['ServiceScorecardsApi.v2.updateScorecardOutcomesAsync'] = true`",
488+
);
489+
}
490+
491+
// verify required parameter 'body' is not null or undefined
492+
if (body === null || body === undefined) {
493+
throw new RequiredError("body", "updateScorecardOutcomesAsync");
494+
}
495+
496+
// Path Params
497+
const localVarPath = "/api/v2/scorecard/outcomes";
498+
499+
// Make Request Context
500+
const { server, overrides } = _config.getServerAndOverrides(
501+
"ServiceScorecardsApi.v2.updateScorecardOutcomesAsync",
502+
ServiceScorecardsApi.operationServers,
503+
);
504+
const requestContext = server.makeRequestContext(
505+
localVarPath,
506+
HttpMethod.POST,
507+
overrides,
508+
);
509+
requestContext.setHeaderParam("Accept", "*/*");
510+
requestContext.setHttpConfig(_config.httpConfig);
511+
512+
// Set User-Agent
513+
if (this.userAgent) {
514+
requestContext.setHeaderParam("User-Agent", this.userAgent);
515+
}
516+
517+
// Body Params
518+
const contentType = getPreferredMediaType(["application/json"]);
519+
requestContext.setHeaderParam("Content-Type", contentType);
520+
const serializedBody = stringify(
521+
serialize(body, TypingInfo, "UpdateOutcomesAsyncRequest", ""),
522+
contentType,
523+
);
524+
requestContext.setBody(serializedBody);
525+
526+
// Apply auth methods
527+
applySecurityAuthentication(_config, requestContext, [
528+
"apiKeyAuth",
529+
"appKeyAuth",
530+
"AuthZ",
531+
]);
532+
533+
return requestContext;
534+
}
535+
474536
public async updateScorecardRule(
475537
ruleId: string,
476538
body: UpdateRuleRequest,
@@ -829,6 +891,55 @@ export class ServiceScorecardsApiResponseProcessor {
829891
);
830892
}
831893

894+
/**
895+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
896+
* to the expected objects
897+
*
898+
* @params response Response returned by the server for a request to updateScorecardOutcomesAsync
899+
* @throws ApiException if the response code was not in [200, 299]
900+
*/
901+
public async updateScorecardOutcomesAsync(
902+
response: ResponseContext,
903+
): Promise<void> {
904+
const contentType = normalizeMediaType(response.headers["content-type"]);
905+
if (response.httpStatusCode === 202) {
906+
return;
907+
}
908+
if (
909+
response.httpStatusCode === 400 ||
910+
response.httpStatusCode === 403 ||
911+
response.httpStatusCode === 429
912+
) {
913+
const bodyText = parse(await response.body.text(), contentType);
914+
let body: APIErrorResponse;
915+
try {
916+
body = deserialize(
917+
bodyText,
918+
TypingInfo,
919+
"APIErrorResponse",
920+
) as APIErrorResponse;
921+
} catch (error) {
922+
logger.debug(`Got error deserializing error: ${error}`);
923+
throw new ApiException<APIErrorResponse>(
924+
response.httpStatusCode,
925+
bodyText,
926+
);
927+
}
928+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
929+
}
930+
931+
// Work around for missing responses in specification, e.g. for petstore.yaml
932+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
933+
return;
934+
}
935+
936+
const body = (await response.body.text()) || "";
937+
throw new ApiException<string>(
938+
response.httpStatusCode,
939+
'Unknown API Status Code!\nBody: "' + body + '"',
940+
);
941+
}
942+
832943
/**
833944
* Unwraps the actual response sent by the server from the response context and deserializes the response content
834945
* to the expected objects
@@ -1020,6 +1131,14 @@ export interface ServiceScorecardsApiListScorecardRulesRequest {
10201131
fieldsScorecard?: string;
10211132
}
10221133

1134+
export interface ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest {
1135+
/**
1136+
* Set of scorecard outcomes.
1137+
* @type UpdateOutcomesAsyncRequest
1138+
*/
1139+
body: UpdateOutcomesAsyncRequest;
1140+
}
1141+
10231142
export interface ServiceScorecardsApiUpdateScorecardRuleRequest {
10241143
/**
10251144
* The ID of the rule.
@@ -1276,6 +1395,27 @@ export class ServiceScorecardsApi {
12761395
}
12771396
}
12781397

1398+
/**
1399+
* Updates multiple scorecard rule outcomes in a single batched request.
1400+
* @param param The request object
1401+
*/
1402+
public updateScorecardOutcomesAsync(
1403+
param: ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest,
1404+
options?: Configuration,
1405+
): Promise<void> {
1406+
const requestContextPromise =
1407+
this.requestFactory.updateScorecardOutcomesAsync(param.body, options);
1408+
return requestContextPromise.then((requestContext) => {
1409+
return this.configuration.httpApi
1410+
.send(requestContext)
1411+
.then((responseContext) => {
1412+
return this.responseProcessor.updateScorecardOutcomesAsync(
1413+
responseContext,
1414+
);
1415+
});
1416+
});
1417+
}
1418+
12791419
/**
12801420
* Updates an existing rule.
12811421
* @param param The request object

services/service_scorecards/src/v2/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
ServiceScorecardsApiDeleteScorecardRuleRequest,
55
ServiceScorecardsApiListScorecardOutcomesRequest,
66
ServiceScorecardsApiListScorecardRulesRequest,
7+
ServiceScorecardsApiUpdateScorecardOutcomesAsyncRequest,
78
ServiceScorecardsApiUpdateScorecardRuleRequest,
89
ServiceScorecardsApi,
910
} from "./ServiceScorecardsApi";
@@ -40,6 +41,11 @@ export { RuleOutcomeRelationships } from "./models/RuleOutcomeRelationships";
4041
export { RuleType } from "./models/RuleType";
4142
export { ScorecardType } from "./models/ScorecardType";
4243
export { State } from "./models/State";
44+
export { UpdateOutcomesAsyncAttributes } from "./models/UpdateOutcomesAsyncAttributes";
45+
export { UpdateOutcomesAsyncRequest } from "./models/UpdateOutcomesAsyncRequest";
46+
export { UpdateOutcomesAsyncRequestData } from "./models/UpdateOutcomesAsyncRequestData";
47+
export { UpdateOutcomesAsyncRequestItem } from "./models/UpdateOutcomesAsyncRequestItem";
48+
export { UpdateOutcomesAsyncType } from "./models/UpdateOutcomesAsyncType";
4349
export { UpdateRuleRequest } from "./models/UpdateRuleRequest";
4450
export { UpdateRuleRequestData } from "./models/UpdateRuleRequestData";
4551
export { UpdateRuleResponse } from "./models/UpdateRuleResponse";

services/service_scorecards/src/v2/models/TypingInfo.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import { RelationshipToRuleData } from "./RelationshipToRuleData";
2727
import { RelationshipToRuleDataObject } from "./RelationshipToRuleDataObject";
2828
import { RuleAttributes } from "./RuleAttributes";
2929
import { RuleOutcomeRelationships } from "./RuleOutcomeRelationships";
30+
import { UpdateOutcomesAsyncAttributes } from "./UpdateOutcomesAsyncAttributes";
31+
import { UpdateOutcomesAsyncRequest } from "./UpdateOutcomesAsyncRequest";
32+
import { UpdateOutcomesAsyncRequestData } from "./UpdateOutcomesAsyncRequestData";
33+
import { UpdateOutcomesAsyncRequestItem } from "./UpdateOutcomesAsyncRequestItem";
3034
import { UpdateRuleRequest } from "./UpdateRuleRequest";
3135
import { UpdateRuleRequestData } from "./UpdateRuleRequestData";
3236
import { UpdateRuleResponse } from "./UpdateRuleResponse";
@@ -39,6 +43,7 @@ export const TypingInfo: ModelTypingInfo = {
3943
RuleType: ["rule"],
4044
ScorecardType: ["scorecard"],
4145
State: ["pass", "fail", "skip"],
46+
UpdateOutcomesAsyncType: ["batched-outcome"],
4247
},
4348
oneOfMap: {},
4449
typeMap: {
@@ -70,6 +75,10 @@ export const TypingInfo: ModelTypingInfo = {
7075
RelationshipToRuleDataObject: RelationshipToRuleDataObject,
7176
RuleAttributes: RuleAttributes,
7277
RuleOutcomeRelationships: RuleOutcomeRelationships,
78+
UpdateOutcomesAsyncAttributes: UpdateOutcomesAsyncAttributes,
79+
UpdateOutcomesAsyncRequest: UpdateOutcomesAsyncRequest,
80+
UpdateOutcomesAsyncRequestData: UpdateOutcomesAsyncRequestData,
81+
UpdateOutcomesAsyncRequestItem: UpdateOutcomesAsyncRequestItem,
7382
UpdateRuleRequest: UpdateRuleRequest,
7483
UpdateRuleRequestData: UpdateRuleRequestData,
7584
UpdateRuleResponse: UpdateRuleResponse,

0 commit comments

Comments
 (0)