Skip to content

Commit b429cdc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c9f30db of spec repo
1 parent fe484d2 commit b429cdc

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": "8001cbb",
3-
"generated": "2025-08-13 20:27:09.207"
2+
"spec_repo_commit": "c9f30db",
3+
"generated": "2025-08-15 16:35:22.218"
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:

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)