Skip to content

Commit 1c0248f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a35d4f4 of spec repo
1 parent 2c45636 commit 1c0248f

14 files changed

+749
-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:28:34.170"
2+
"spec_repo_commit": "a35d4f4",
3+
"generated": "2025-08-22 14:58:59.629"
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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Update Scorecard outcomes asynchronously returns "Accepted" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new
8+
9+
# there is a valid "create_scorecard_rule" in the system
10+
CREATE_SCORECARD_RULE_DATA_ID = ENV["CREATE_SCORECARD_RULE_DATA_ID"]
11+
12+
body = DatadogAPIClient::V2::UpdateOutcomesAsyncRequest.new({
13+
data: DatadogAPIClient::V2::UpdateOutcomesAsyncRequestData.new({
14+
attributes: DatadogAPIClient::V2::UpdateOutcomesAsyncAttributes.new({
15+
results: [
16+
DatadogAPIClient::V2::UpdateOutcomesAsyncRequestItem.new({
17+
rule_id: CREATE_SCORECARD_RULE_DATA_ID,
18+
entity_reference: "service:my-service",
19+
remarks: 'See: <a href="https://app.datadoghq.com/services">Services</a>',
20+
state: DatadogAPIClient::V2::State::PASS,
21+
}),
22+
],
23+
}),
24+
type: DatadogAPIClient::V2::UpdateOutcomesAsyncType::BATCHED_OUTCOME,
25+
}),
26+
})
27+
p api_instance.update_scorecard_outcomes_async(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,9 @@
25112511
"filter_rule_id" => "String",
25122512
"filter_rule_name" => "String",
25132513
},
2514+
"v2.UpdateScorecardOutcomesAsync" => {
2515+
"body" => "UpdateOutcomesAsyncRequest",
2516+
},
25142517
"v2.CreateScorecardOutcomesBatch" => {
25152518
"body" => "OutcomesBatchRequest",
25162519
},

features/v2/service_scorecards.feature

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

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

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def initialize
265265
"v2.delete_scorecard_rule": false,
266266
"v2.list_scorecard_outcomes": false,
267267
"v2.list_scorecard_rules": false,
268+
"v2.update_scorecard_outcomes_async": false,
268269
"v2.update_scorecard_rule": false,
269270
"v2.create_incident_service": false,
270271
"v2.delete_incident_service": false,

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,6 +3701,11 @@ def overrides
37013701
"v2.update_open_api_response" => "UpdateOpenAPIResponse",
37023702
"v2.update_open_api_response_attributes" => "UpdateOpenAPIResponseAttributes",
37033703
"v2.update_open_api_response_data" => "UpdateOpenAPIResponseData",
3704+
"v2.update_outcomes_async_attributes" => "UpdateOutcomesAsyncAttributes",
3705+
"v2.update_outcomes_async_request" => "UpdateOutcomesAsyncRequest",
3706+
"v2.update_outcomes_async_request_data" => "UpdateOutcomesAsyncRequestData",
3707+
"v2.update_outcomes_async_request_item" => "UpdateOutcomesAsyncRequestItem",
3708+
"v2.update_outcomes_async_type" => "UpdateOutcomesAsyncType",
37043709
"v2.update_resource_evaluation_filters_request" => "UpdateResourceEvaluationFiltersRequest",
37053710
"v2.update_resource_evaluation_filters_request_data" => "UpdateResourceEvaluationFiltersRequestData",
37063711
"v2.update_resource_evaluation_filters_response" => "UpdateResourceEvaluationFiltersResponse",

lib/datadog_api_client/v2/api/service_scorecards_api.rb

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,79 @@ def list_scorecard_rules_with_pagination(opts = {})
454454
end
455455
end
456456

457+
# Update Scorecard outcomes asynchronously.
458+
#
459+
# @see #update_scorecard_outcomes_async_with_http_info
460+
def update_scorecard_outcomes_async(body, opts = {})
461+
update_scorecard_outcomes_async_with_http_info(body, opts)
462+
nil
463+
end
464+
465+
# Update Scorecard outcomes asynchronously.
466+
#
467+
# Updates multiple scorecard rule outcomes in a single batched request.
468+
#
469+
# @param body [UpdateOutcomesAsyncRequest] Set of scorecard outcomes.
470+
# @param opts [Hash] the optional parameters
471+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
472+
def update_scorecard_outcomes_async_with_http_info(body, opts = {})
473+
unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym]
474+
if unstable_enabled
475+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_outcomes_async")
476+
else
477+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_outcomes_async"))
478+
end
479+
480+
if @api_client.config.debugging
481+
@api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_outcomes_async ...'
482+
end
483+
# verify the required parameter 'body' is set
484+
if @api_client.config.client_side_validation && body.nil?
485+
fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_outcomes_async"
486+
end
487+
# resource path
488+
local_var_path = '/api/v2/scorecard/outcomes'
489+
490+
# query parameters
491+
query_params = opts[:query_params] || {}
492+
493+
# header parameters
494+
header_params = opts[:header_params] || {}
495+
# HTTP header 'Accept' (if needed)
496+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
497+
# HTTP header 'Content-Type'
498+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
499+
500+
# form parameters
501+
form_params = opts[:form_params] || {}
502+
503+
# http body (model)
504+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
505+
506+
# return_type
507+
return_type = opts[:debug_return_type]
508+
509+
# auth_names
510+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
511+
512+
new_options = opts.merge(
513+
:operation => :update_scorecard_outcomes_async,
514+
:header_params => header_params,
515+
:query_params => query_params,
516+
:form_params => form_params,
517+
:body => post_body,
518+
:auth_names => auth_names,
519+
:return_type => return_type,
520+
:api_version => "V2"
521+
)
522+
523+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
524+
if @api_client.config.debugging
525+
@api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_outcomes_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
526+
end
527+
return data, status_code, headers
528+
end
529+
457530
# Update an existing rule.
458531
#
459532
# @see #update_scorecard_rule_with_http_info
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The JSON:API attributes for a batched set of scorecard outcomes.
21+
class UpdateOutcomesAsyncAttributes
22+
include BaseGenericModel
23+
24+
# Set of scorecard outcomes to update asynchronously.
25+
attr_accessor :results
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'results' => :'results'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'results' => :'Array<UpdateOutcomesAsyncRequestItem>'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateOutcomesAsyncAttributes` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'results')
64+
if (value = attributes[:'results']).is_a?(Array)
65+
self.results = value
66+
end
67+
end
68+
end
69+
70+
# Returns the object in the form of hash, with additionalProperties support.
71+
# @return [Hash] Returns the object in the form of hash
72+
# @!visibility private
73+
def to_hash
74+
hash = {}
75+
self.class.attribute_map.each_pair do |attr, param|
76+
value = self.send(attr)
77+
if value.nil?
78+
is_nullable = self.class.openapi_nullable.include?(attr)
79+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
80+
end
81+
82+
hash[param] = _to_hash(value)
83+
end
84+
self.additional_properties.each_pair do |attr, value|
85+
hash[attr] = value
86+
end
87+
hash
88+
end
89+
90+
# Checks equality by comparing each attribute.
91+
# @param o [Object] Object to be compared
92+
# @!visibility private
93+
def ==(o)
94+
return true if self.equal?(o)
95+
self.class == o.class &&
96+
results == o.results &&
97+
additional_properties == o.additional_properties
98+
end
99+
100+
# Calculates hash code according to all attributes.
101+
# @return [Integer] Hash code
102+
# @!visibility private
103+
def hash
104+
[results, additional_properties].hash
105+
end
106+
end
107+
end

0 commit comments

Comments
 (0)