Skip to content

Commit f385ae5

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

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": "8001cbb",
3-
"generated": "2025-08-13 20:27:07.288"
2+
"spec_repo_commit": "c9f30db",
3+
"generated": "2025-08-15 16:35:22.686"
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: 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
@@ -3689,6 +3689,11 @@ def overrides
36893689
"v2.update_open_api_response" => "UpdateOpenAPIResponse",
36903690
"v2.update_open_api_response_attributes" => "UpdateOpenAPIResponseAttributes",
36913691
"v2.update_open_api_response_data" => "UpdateOpenAPIResponseData",
3692+
"v2.update_outcomes_async_attributes" => "UpdateOutcomesAsyncAttributes",
3693+
"v2.update_outcomes_async_request" => "UpdateOutcomesAsyncRequest",
3694+
"v2.update_outcomes_async_request_data" => "UpdateOutcomesAsyncRequestData",
3695+
"v2.update_outcomes_async_request_item" => "UpdateOutcomesAsyncRequestItem",
3696+
"v2.update_outcomes_async_type" => "UpdateOutcomesAsyncType",
36923697
"v2.update_resource_evaluation_filters_request" => "UpdateResourceEvaluationFiltersRequest",
36933698
"v2.update_resource_evaluation_filters_request_data" => "UpdateResourceEvaluationFiltersRequestData",
36943699
"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)