diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 65d674fb23d1..99b25f0ac87f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13100,12 +13100,17 @@ components: minLength: 1 type: string repository_id: - description: The repository identifier. + deprecated: true + description: "Deprecated: use `repository_url` instead. The repository URL." example: github.com/datadog/shopist minLength: 1 type: string + repository_url: + 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`). + example: https://github.com/datadog/shopist + minLength: 1 + type: string required: - - repository_id - branch type: object BranchCoverageSummaryRequestData: @@ -19067,12 +19072,17 @@ components: pattern: "^[a-fA-F0-9]{40}$" type: string repository_id: - description: The repository identifier. + deprecated: true + description: "Deprecated: use `repository_url` instead. The repository URL." example: github.com/datadog/shopist minLength: 1 type: string + repository_url: + 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`). + example: https://github.com/datadog/shopist + minLength: 1 + type: string required: - - repository_id - commit_sha type: object CommitCoverageSummaryRequestData: @@ -122130,7 +122140,7 @@ paths: data: attributes: branch: prod - repository_id: github.com/datadog/test-service + repository_url: https://github.com/datadog/test-service type: ci_app_coverage_branch_summary_request schema: $ref: "#/components/schemas/BranchCoverageSummaryRequest" @@ -122200,7 +122210,7 @@ paths: data: attributes: commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_id: github.com/datadog/test-service + repository_url: https://github.com/datadog/test-service type: ci_app_coverage_commit_summary_request schema: $ref: "#/components/schemas/CommitCoverageSummaryRequest" diff --git a/examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb b/examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb index f5f6215bc64a..82eb6438ccfe 100644 --- a/examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb +++ b/examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb @@ -11,6 +11,7 @@ attributes: DatadogAPIClient::V2::BranchCoverageSummaryRequestAttributes.new({ branch: "prod", repository_id: "github.com/datadog/shopist", + repository_url: "https://github.com/datadog/shopist", }), type: DatadogAPIClient::V2::BranchCoverageSummaryRequestType::CI_APP_COVERAGE_BRANCH_SUMMARY_REQUEST, }), diff --git a/examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb b/examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb index 20a5f1e20f68..e2c7bdd0e378 100644 --- a/examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb +++ b/examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb @@ -11,6 +11,7 @@ attributes: DatadogAPIClient::V2::CommitCoverageSummaryRequestAttributes.new({ commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588", repository_id: "github.com/datadog/shopist", + repository_url: "https://github.com/datadog/shopist", }), type: DatadogAPIClient::V2::CommitCoverageSummaryRequestType::CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST, }), diff --git a/features/v2/code_coverage.feature b/features/v2/code_coverage.feature index 657ee0375c9e..a103acd210ae 100644 --- a/features/v2/code_coverage.feature +++ b/features/v2/code_coverage.feature @@ -13,7 +13,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "Bad Request" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + 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"}} When the request is sent Then the response status is 400 Bad Request @@ -21,7 +21,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "Not Found" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + 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"}} When the request is sent Then the response status is 404 Not Found @@ -29,7 +29,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "OK" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + 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"}} When the request is sent Then the response status is 200 OK @@ -61,7 +61,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "Bad Request" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + 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"}} When the request is sent Then the response status is 400 Bad Request @@ -69,7 +69,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "Not Found" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + 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"}} When the request is sent Then the response status is 404 Not Found @@ -77,7 +77,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "OK" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + 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"}} When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/v2/models/branch_coverage_summary_request_attributes.rb b/lib/datadog_api_client/v2/models/branch_coverage_summary_request_attributes.rb index 03f051e334f7..49f1a7bf2b43 100644 --- a/lib/datadog_api_client/v2/models/branch_coverage_summary_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/branch_coverage_summary_request_attributes.rb @@ -24,9 +24,12 @@ class BranchCoverageSummaryRequestAttributes # The branch name. attr_reader :branch - # The repository identifier. + # Deprecated: use `repository_url` instead. The repository URL. attr_reader :repository_id + # The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`). + attr_reader :repository_url + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -34,7 +37,8 @@ class BranchCoverageSummaryRequestAttributes def self.attribute_map { :'branch' => :'branch', - :'repository_id' => :'repository_id' + :'repository_id' => :'repository_id', + :'repository_url' => :'repository_url' } end @@ -43,7 +47,8 @@ def self.attribute_map def self.openapi_types { :'branch' => :'String', - :'repository_id' => :'String' + :'repository_id' => :'String', + :'repository_url' => :'String' } end @@ -72,6 +77,10 @@ def initialize(attributes = {}) if attributes.key?(:'repository_id') self.repository_id = attributes[:'repository_id'] end + + if attributes.key?(:'repository_url') + self.repository_url = attributes[:'repository_url'] + end end # Check to see if the all the properties in the model are valid @@ -80,8 +89,8 @@ def initialize(attributes = {}) def valid? return false if @branch.nil? return false if @branch.to_s.length < 1 - return false if @repository_id.nil? - return false if @repository_id.to_s.length < 1 + return false if !@repository_id.nil? && @repository_id.to_s.length < 1 + return false if !@repository_url.nil? && @repository_url.to_s.length < 1 true end @@ -102,15 +111,22 @@ def branch=(branch) # @param repository_id [Object] Object to be assigned # @!visibility private def repository_id=(repository_id) - if repository_id.nil? - fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.' - end - if repository_id.to_s.length < 1 + if !repository_id.nil? && repository_id.to_s.length < 1 fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.' end @repository_id = repository_id end + # Custom attribute writer method with validation + # @param repository_url [Object] Object to be assigned + # @!visibility private + def repository_url=(repository_url) + if !repository_url.nil? && repository_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.' + end + @repository_url = repository_url + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -139,6 +155,7 @@ def ==(o) self.class == o.class && branch == o.branch && repository_id == o.repository_id && + repository_url == o.repository_url && additional_properties == o.additional_properties end @@ -146,7 +163,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [branch, repository_id, additional_properties].hash + [branch, repository_id, repository_url, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/commit_coverage_summary_request_attributes.rb b/lib/datadog_api_client/v2/models/commit_coverage_summary_request_attributes.rb index 1a53a1001230..d5f08e68d445 100644 --- a/lib/datadog_api_client/v2/models/commit_coverage_summary_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/commit_coverage_summary_request_attributes.rb @@ -24,9 +24,12 @@ class CommitCoverageSummaryRequestAttributes # The commit SHA (40-character hexadecimal string). attr_reader :commit_sha - # The repository identifier. + # Deprecated: use `repository_url` instead. The repository URL. attr_reader :repository_id + # The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`). + attr_reader :repository_url + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -34,7 +37,8 @@ class CommitCoverageSummaryRequestAttributes def self.attribute_map { :'commit_sha' => :'commit_sha', - :'repository_id' => :'repository_id' + :'repository_id' => :'repository_id', + :'repository_url' => :'repository_url' } end @@ -43,7 +47,8 @@ def self.attribute_map def self.openapi_types { :'commit_sha' => :'String', - :'repository_id' => :'String' + :'repository_id' => :'String', + :'repository_url' => :'String' } end @@ -72,6 +77,10 @@ def initialize(attributes = {}) if attributes.key?(:'repository_id') self.repository_id = attributes[:'repository_id'] end + + if attributes.key?(:'repository_url') + self.repository_url = attributes[:'repository_url'] + end end # Check to see if the all the properties in the model are valid @@ -81,8 +90,8 @@ def valid? return false if @commit_sha.nil? pattern = Regexp.new(/^[a-fA-F0-9]{40}$/) return false if @commit_sha !~ pattern - return false if @repository_id.nil? - return false if @repository_id.to_s.length < 1 + return false if !@repository_id.nil? && @repository_id.to_s.length < 1 + return false if !@repository_url.nil? && @repository_url.to_s.length < 1 true end @@ -104,15 +113,22 @@ def commit_sha=(commit_sha) # @param repository_id [Object] Object to be assigned # @!visibility private def repository_id=(repository_id) - if repository_id.nil? - fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.' - end - if repository_id.to_s.length < 1 + if !repository_id.nil? && repository_id.to_s.length < 1 fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.' end @repository_id = repository_id end + # Custom attribute writer method with validation + # @param repository_url [Object] Object to be assigned + # @!visibility private + def repository_url=(repository_url) + if !repository_url.nil? && repository_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.' + end + @repository_url = repository_url + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -141,6 +157,7 @@ def ==(o) self.class == o.class && commit_sha == o.commit_sha && repository_id == o.repository_id && + repository_url == o.repository_url && additional_properties == o.additional_properties end @@ -148,7 +165,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [commit_sha, repository_id, additional_properties].hash + [commit_sha, repository_id, repository_url, additional_properties].hash end end end