Skip to content

Commit 94290dd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit cf78334 of spec repo
1 parent 86bec74 commit 94290dd

14 files changed

+744
-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:05.112"
2+
"spec_repo_commit": "cf78334",
3+
"generated": "2025-08-12 18:25:04.682"
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
body = DatadogAPIClient::V2::UpdateOutcomesAsyncRequest.new({
10+
data: DatadogAPIClient::V2::UpdateOutcomesAsyncRequestData.new({
11+
attributes: DatadogAPIClient::V2::UpdateOutcomesAsyncAttributes.new({
12+
results: [
13+
DatadogAPIClient::V2::UpdateOutcomesAsyncRequestItem.new({
14+
entity_reference: "service:my-service",
15+
remarks: 'See: <a href="https://app.datadoghq.com/services">Services</a>',
16+
rule_id: "q8MQxk8TCqrHnWkx",
17+
state: DatadogAPIClient::V2::State::PASS,
18+
}),
19+
],
20+
}),
21+
type: DatadogAPIClient::V2::UpdateOutcomesAsyncType::BATCHED_OUTCOME,
22+
}),
23+
})
24+
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
@@ -2505,6 +2505,9 @@
25052505
"filter_rule_id" => "String",
25062506
"filter_rule_name" => "String",
25072507
},
2508+
"v2.UpdateScorecardOutcomesAsync" => {
2509+
"body" => "UpdateOutcomesAsyncRequest",
2510+
},
25082511
"v2.CreateScorecardOutcomesBatch" => {
25092512
"body" => "OutcomesBatchRequest",
25102513
},

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

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
@@ -3650,6 +3650,11 @@ def overrides
36503650
"v2.update_open_api_response" => "UpdateOpenAPIResponse",
36513651
"v2.update_open_api_response_attributes" => "UpdateOpenAPIResponseAttributes",
36523652
"v2.update_open_api_response_data" => "UpdateOpenAPIResponseData",
3653+
"v2.update_outcomes_async_attributes" => "UpdateOutcomesAsyncAttributes",
3654+
"v2.update_outcomes_async_request" => "UpdateOutcomesAsyncRequest",
3655+
"v2.update_outcomes_async_request_data" => "UpdateOutcomesAsyncRequestData",
3656+
"v2.update_outcomes_async_request_item" => "UpdateOutcomesAsyncRequestItem",
3657+
"v2.update_outcomes_async_type" => "UpdateOutcomesAsyncType",
36533658
"v2.update_resource_evaluation_filters_request" => "UpdateResourceEvaluationFiltersRequest",
36543659
"v2.update_resource_evaluation_filters_request_data" => "UpdateResourceEvaluationFiltersRequestData",
36553660
"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)