Skip to content

Commit 77ddef4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing optional field env in DORA API endpoints (#1702)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 01b029d commit 77ddef4

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-01-19 15:18:10.917989",
8-
"spec_repo_commit": "b407748b"
7+
"regenerated": "2024-01-19 16:05:46.039191",
8+
"spec_repo_commit": "20461e26"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-01-19 15:18:10.933129",
13-
"spec_repo_commit": "b407748b"
12+
"regenerated": "2024-01-19 16:05:46.061397",
13+
"spec_repo_commit": "20461e26"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4930,6 +4930,10 @@ components:
49304930
DORADeploymentRequestAttributes:
49314931
description: Attributes to create a DORA deployment event.
49324932
properties:
4933+
env:
4934+
description: Environment name to where the service was deployed.
4935+
example: staging
4936+
type: string
49334937
finished_at:
49344938
description: Unix timestamp in nanoseconds when the deployment finished.
49354939
It should not be older than 3 hours.
@@ -5018,6 +5022,10 @@ components:
50185022
DORAIncidentRequestAttributes:
50195023
description: Attributes to create a DORA incident event.
50205024
properties:
5025+
env:
5026+
description: Environment name that was impacted by the incident.
5027+
example: staging
5028+
type: string
50215029
finished_at:
50225030
description: Unix timestamp in nanoseconds when the incident finished. It
50235031
should not be older than 3 hours.

features/v2/dora_metrics.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Feature: DORA Metrics
4242
Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response
4343
Given operation "CreateDORAIncident" enabled
4444
And new "CreateDORAIncident" request
45-
And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "service": "shopist", "severity": "High", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
45+
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "service": "shopist", "severity": "High", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
4646
When the request is sent
4747
Then the response status is 202 OK - but delayed due to incident
4848

lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
2121
class DORADeploymentRequestAttributes
2222
include BaseGenericModel
2323

24+
# Environment name to where the service was deployed.
25+
attr_accessor :env
26+
2427
# Unix timestamp in nanoseconds when the deployment finished. It should not be older than 3 hours.
2528
attr_reader :finished_at
2629

@@ -43,6 +46,7 @@ class DORADeploymentRequestAttributes
4346
# @!visibility private
4447
def self.attribute_map
4548
{
49+
:'env' => :'env',
4650
:'finished_at' => :'finished_at',
4751
:'git' => :'git',
4852
:'id' => :'id',
@@ -56,6 +60,7 @@ def self.attribute_map
5660
# @!visibility private
5761
def self.openapi_types
5862
{
63+
:'env' => :'String',
5964
:'finished_at' => :'Integer',
6065
:'git' => :'DORAGitInfo',
6166
:'id' => :'String',
@@ -81,6 +86,10 @@ def initialize(attributes = {})
8186
h[k.to_sym] = v
8287
}
8388

89+
if attributes.key?(:'env')
90+
self.env = attributes[:'env']
91+
end
92+
8493
if attributes.key?(:'finished_at')
8594
self.finished_at = attributes[:'finished_at']
8695
end
@@ -152,6 +161,7 @@ def started_at=(started_at)
152161
def ==(o)
153162
return true if self.equal?(o)
154163
self.class == o.class &&
164+
env == o.env &&
155165
finished_at == o.finished_at &&
156166
git == o.git &&
157167
id == o.id &&
@@ -164,7 +174,7 @@ def ==(o)
164174
# @return [Integer] Hash code
165175
# @!visibility private
166176
def hash
167-
[finished_at, git, id, service, started_at, version].hash
177+
[env, finished_at, git, id, service, started_at, version].hash
168178
end
169179
end
170180
end

lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
2121
class DORAIncidentRequestAttributes
2222
include BaseGenericModel
2323

24+
# Environment name that was impacted by the incident.
25+
attr_accessor :env
26+
2427
# Unix timestamp in nanoseconds when the incident finished. It should not be older than 3 hours.
2528
attr_accessor :finished_at
2629

@@ -49,6 +52,7 @@ class DORAIncidentRequestAttributes
4952
# @!visibility private
5053
def self.attribute_map
5154
{
55+
:'env' => :'env',
5256
:'finished_at' => :'finished_at',
5357
:'git' => :'git',
5458
:'id' => :'id',
@@ -64,6 +68,7 @@ def self.attribute_map
6468
# @!visibility private
6569
def self.openapi_types
6670
{
71+
:'env' => :'String',
6772
:'finished_at' => :'Integer',
6873
:'git' => :'DORAGitInfo',
6974
:'id' => :'String',
@@ -91,6 +96,10 @@ def initialize(attributes = {})
9196
h[k.to_sym] = v
9297
}
9398

99+
if attributes.key?(:'env')
100+
self.env = attributes[:'env']
101+
end
102+
94103
if attributes.key?(:'finished_at')
95104
self.finished_at = attributes[:'finished_at']
96105
end
@@ -159,6 +168,7 @@ def started_at=(started_at)
159168
def ==(o)
160169
return true if self.equal?(o)
161170
self.class == o.class &&
171+
env == o.env &&
162172
finished_at == o.finished_at &&
163173
git == o.git &&
164174
id == o.id &&
@@ -173,7 +183,7 @@ def ==(o)
173183
# @return [Integer] Hash code
174184
# @!visibility private
175185
def hash
176-
[finished_at, git, id, name, service, severity, started_at, version].hash
186+
[env, finished_at, git, id, name, service, severity, started_at, version].hash
177187
end
178188
end
179189
end

0 commit comments

Comments
 (0)