Skip to content

Commit c1f424a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit d9302fe of spec repo (#3498)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 2d277d0 commit c1f424a

6 files changed

Lines changed: 78 additions & 32 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13100,12 +13100,17 @@ components:
1310013100
minLength: 1
1310113101
type: string
1310213102
repository_id:
13103-
description: The repository identifier.
13103+
deprecated: true
13104+
description: "Deprecated: use `repository_url` instead. The repository URL."
1310413105
example: github.com/datadog/shopist
1310513106
minLength: 1
1310613107
type: string
13108+
repository_url:
13109+
description: The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
13110+
example: https://github.com/datadog/shopist
13111+
minLength: 1
13112+
type: string
1310713113
required:
13108-
- repository_id
1310913114
- branch
1311013115
type: object
1311113116
BranchCoverageSummaryRequestData:
@@ -19067,12 +19072,17 @@ components:
1906719072
pattern: "^[a-fA-F0-9]{40}$"
1906819073
type: string
1906919074
repository_id:
19070-
description: The repository identifier.
19075+
deprecated: true
19076+
description: "Deprecated: use `repository_url` instead. The repository URL."
1907119077
example: github.com/datadog/shopist
1907219078
minLength: 1
1907319079
type: string
19080+
repository_url:
19081+
description: The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
19082+
example: https://github.com/datadog/shopist
19083+
minLength: 1
19084+
type: string
1907419085
required:
19075-
- repository_id
1907619086
- commit_sha
1907719087
type: object
1907819088
CommitCoverageSummaryRequestData:
@@ -122130,7 +122140,7 @@ paths:
122130122140
data:
122131122141
attributes:
122132122142
branch: prod
122133-
repository_id: github.com/datadog/test-service
122143+
repository_url: https://github.com/datadog/test-service
122134122144
type: ci_app_coverage_branch_summary_request
122135122145
schema:
122136122146
$ref: "#/components/schemas/BranchCoverageSummaryRequest"
@@ -122200,7 +122210,7 @@ paths:
122200122210
data:
122201122211
attributes:
122202122212
commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588
122203-
repository_id: github.com/datadog/test-service
122213+
repository_url: https://github.com/datadog/test-service
122204122214
type: ci_app_coverage_commit_summary_request
122205122215
schema:
122206122216
$ref: "#/components/schemas/CommitCoverageSummaryRequest"

examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
attributes: DatadogAPIClient::V2::BranchCoverageSummaryRequestAttributes.new({
1212
branch: "prod",
1313
repository_id: "github.com/datadog/shopist",
14+
repository_url: "https://github.com/datadog/shopist",
1415
}),
1516
type: DatadogAPIClient::V2::BranchCoverageSummaryRequestType::CI_APP_COVERAGE_BRANCH_SUMMARY_REQUEST,
1617
}),

examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
attributes: DatadogAPIClient::V2::CommitCoverageSummaryRequestAttributes.new({
1212
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
1313
repository_id: "github.com/datadog/shopist",
14+
repository_url: "https://github.com/datadog/shopist",
1415
}),
1516
type: DatadogAPIClient::V2::CommitCoverageSummaryRequestType::CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST,
1617
}),

features/v2/code_coverage.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ Feature: Code Coverage
1313
Scenario: Get code coverage summary for a branch returns "Bad Request" response
1414
Given operation "GetCodeCoverageBranchSummary" enabled
1515
And new "GetCodeCoverageBranchSummary" request
16-
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
16+
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

2020
@generated @skip @team:DataDog/ci-app-backend
2121
Scenario: Get code coverage summary for a branch returns "Not Found" response
2222
Given operation "GetCodeCoverageBranchSummary" enabled
2323
And new "GetCodeCoverageBranchSummary" request
24-
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
24+
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
2525
When the request is sent
2626
Then the response status is 404 Not Found
2727

2828
@generated @skip @team:DataDog/ci-app-backend
2929
Scenario: Get code coverage summary for a branch returns "OK" response
3030
Given operation "GetCodeCoverageBranchSummary" enabled
3131
And new "GetCodeCoverageBranchSummary" request
32-
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
32+
And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}}
3333
When the request is sent
3434
Then the response status is 200 OK
3535

@@ -61,23 +61,23 @@ Feature: Code Coverage
6161
Scenario: Get code coverage summary for a commit returns "Bad Request" response
6262
Given operation "GetCodeCoverageCommitSummary" enabled
6363
And new "GetCodeCoverageCommitSummary" request
64-
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
64+
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
6565
When the request is sent
6666
Then the response status is 400 Bad Request
6767

6868
@generated @skip @team:DataDog/ci-app-backend
6969
Scenario: Get code coverage summary for a commit returns "Not Found" response
7070
Given operation "GetCodeCoverageCommitSummary" enabled
7171
And new "GetCodeCoverageCommitSummary" request
72-
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
72+
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
7373
When the request is sent
7474
Then the response status is 404 Not Found
7575

7676
@generated @skip @team:DataDog/ci-app-backend
7777
Scenario: Get code coverage summary for a commit returns "OK" response
7878
Given operation "GetCodeCoverageCommitSummary" enabled
7979
And new "GetCodeCoverageCommitSummary" request
80-
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
80+
And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}}
8181
When the request is sent
8282
Then the response status is 200 OK
8383

lib/datadog_api_client/v2/models/branch_coverage_summary_request_attributes.rb

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ class BranchCoverageSummaryRequestAttributes
2424
# The branch name.
2525
attr_reader :branch
2626

27-
# The repository identifier.
27+
# Deprecated: use `repository_url` instead. The repository URL.
2828
attr_reader :repository_id
2929

30+
# The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
31+
attr_reader :repository_url
32+
3033
attr_accessor :additional_properties
3134

3235
# Attribute mapping from ruby-style variable name to JSON key.
3336
# @!visibility private
3437
def self.attribute_map
3538
{
3639
:'branch' => :'branch',
37-
:'repository_id' => :'repository_id'
40+
:'repository_id' => :'repository_id',
41+
:'repository_url' => :'repository_url'
3842
}
3943
end
4044

@@ -43,7 +47,8 @@ def self.attribute_map
4347
def self.openapi_types
4448
{
4549
:'branch' => :'String',
46-
:'repository_id' => :'String'
50+
:'repository_id' => :'String',
51+
:'repository_url' => :'String'
4752
}
4853
end
4954

@@ -72,6 +77,10 @@ def initialize(attributes = {})
7277
if attributes.key?(:'repository_id')
7378
self.repository_id = attributes[:'repository_id']
7479
end
80+
81+
if attributes.key?(:'repository_url')
82+
self.repository_url = attributes[:'repository_url']
83+
end
7584
end
7685

7786
# Check to see if the all the properties in the model are valid
@@ -80,8 +89,8 @@ def initialize(attributes = {})
8089
def valid?
8190
return false if @branch.nil?
8291
return false if @branch.to_s.length < 1
83-
return false if @repository_id.nil?
84-
return false if @repository_id.to_s.length < 1
92+
return false if !@repository_id.nil? && @repository_id.to_s.length < 1
93+
return false if !@repository_url.nil? && @repository_url.to_s.length < 1
8594
true
8695
end
8796

@@ -102,15 +111,22 @@ def branch=(branch)
102111
# @param repository_id [Object] Object to be assigned
103112
# @!visibility private
104113
def repository_id=(repository_id)
105-
if repository_id.nil?
106-
fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.'
107-
end
108-
if repository_id.to_s.length < 1
114+
if !repository_id.nil? && repository_id.to_s.length < 1
109115
fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.'
110116
end
111117
@repository_id = repository_id
112118
end
113119

120+
# Custom attribute writer method with validation
121+
# @param repository_url [Object] Object to be assigned
122+
# @!visibility private
123+
def repository_url=(repository_url)
124+
if !repository_url.nil? && repository_url.to_s.length < 1
125+
fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.'
126+
end
127+
@repository_url = repository_url
128+
end
129+
114130
# Returns the object in the form of hash, with additionalProperties support.
115131
# @return [Hash] Returns the object in the form of hash
116132
# @!visibility private
@@ -139,14 +155,15 @@ def ==(o)
139155
self.class == o.class &&
140156
branch == o.branch &&
141157
repository_id == o.repository_id &&
158+
repository_url == o.repository_url &&
142159
additional_properties == o.additional_properties
143160
end
144161

145162
# Calculates hash code according to all attributes.
146163
# @return [Integer] Hash code
147164
# @!visibility private
148165
def hash
149-
[branch, repository_id, additional_properties].hash
166+
[branch, repository_id, repository_url, additional_properties].hash
150167
end
151168
end
152169
end

lib/datadog_api_client/v2/models/commit_coverage_summary_request_attributes.rb

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ class CommitCoverageSummaryRequestAttributes
2424
# The commit SHA (40-character hexadecimal string).
2525
attr_reader :commit_sha
2626

27-
# The repository identifier.
27+
# Deprecated: use `repository_url` instead. The repository URL.
2828
attr_reader :repository_id
2929

30+
# The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
31+
attr_reader :repository_url
32+
3033
attr_accessor :additional_properties
3134

3235
# Attribute mapping from ruby-style variable name to JSON key.
3336
# @!visibility private
3437
def self.attribute_map
3538
{
3639
:'commit_sha' => :'commit_sha',
37-
:'repository_id' => :'repository_id'
40+
:'repository_id' => :'repository_id',
41+
:'repository_url' => :'repository_url'
3842
}
3943
end
4044

@@ -43,7 +47,8 @@ def self.attribute_map
4347
def self.openapi_types
4448
{
4549
:'commit_sha' => :'String',
46-
:'repository_id' => :'String'
50+
:'repository_id' => :'String',
51+
:'repository_url' => :'String'
4752
}
4853
end
4954

@@ -72,6 +77,10 @@ def initialize(attributes = {})
7277
if attributes.key?(:'repository_id')
7378
self.repository_id = attributes[:'repository_id']
7479
end
80+
81+
if attributes.key?(:'repository_url')
82+
self.repository_url = attributes[:'repository_url']
83+
end
7584
end
7685

7786
# Check to see if the all the properties in the model are valid
@@ -81,8 +90,8 @@ def valid?
8190
return false if @commit_sha.nil?
8291
pattern = Regexp.new(/^[a-fA-F0-9]{40}$/)
8392
return false if @commit_sha !~ pattern
84-
return false if @repository_id.nil?
85-
return false if @repository_id.to_s.length < 1
93+
return false if !@repository_id.nil? && @repository_id.to_s.length < 1
94+
return false if !@repository_url.nil? && @repository_url.to_s.length < 1
8695
true
8796
end
8897

@@ -104,15 +113,22 @@ def commit_sha=(commit_sha)
104113
# @param repository_id [Object] Object to be assigned
105114
# @!visibility private
106115
def repository_id=(repository_id)
107-
if repository_id.nil?
108-
fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.'
109-
end
110-
if repository_id.to_s.length < 1
116+
if !repository_id.nil? && repository_id.to_s.length < 1
111117
fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.'
112118
end
113119
@repository_id = repository_id
114120
end
115121

122+
# Custom attribute writer method with validation
123+
# @param repository_url [Object] Object to be assigned
124+
# @!visibility private
125+
def repository_url=(repository_url)
126+
if !repository_url.nil? && repository_url.to_s.length < 1
127+
fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.'
128+
end
129+
@repository_url = repository_url
130+
end
131+
116132
# Returns the object in the form of hash, with additionalProperties support.
117133
# @return [Hash] Returns the object in the form of hash
118134
# @!visibility private
@@ -141,14 +157,15 @@ def ==(o)
141157
self.class == o.class &&
142158
commit_sha == o.commit_sha &&
143159
repository_id == o.repository_id &&
160+
repository_url == o.repository_url &&
144161
additional_properties == o.additional_properties
145162
end
146163

147164
# Calculates hash code according to all attributes.
148165
# @return [Integer] Hash code
149166
# @!visibility private
150167
def hash
151-
[commit_sha, repository_id, additional_properties].hash
168+
[commit_sha, repository_id, repository_url, additional_properties].hash
152169
end
153170
end
154171
end

0 commit comments

Comments
 (0)