Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30615,6 +30615,15 @@ components:
example: 12
format: int64
type: integer
flags:
additionalProperties:
$ref: "#/components/schemas/CoverageSummaryFlagStats"
description: |-
Coverage statistics broken down by flag. Each entry contains only coverage percentages.
Branch summaries include the flags of the latest covered commit, including coverage carried forward
to that commit. Pull request summaries include flags across all commits of the pull request.
nullable: true
type: object
patch_coverage:
description: Overall patch coverage percentage.
example: 70.1
Expand Down Expand Up @@ -30672,6 +30681,22 @@ components:
type:
$ref: "#/components/schemas/CoverageSummaryType"
type: object
CoverageSummaryFlagStats:
description: Coverage statistics for a specific flag.
properties:
patch_coverage:
description: Patch coverage percentage for the flag.
example: 70.0
format: double
nullable: true
type: number
total_coverage:
description: Total coverage percentage for the flag.
example: 75.0
format: double
nullable: true
type: number
type: object
CoverageSummaryResponse:
description: Response object containing code coverage summary.
properties:
Expand Down Expand Up @@ -170025,8 +170050,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific branch in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.
operationId: GetCodeCoverageBranchSummary
requestBody:
content:
Expand Down Expand Up @@ -170090,8 +170115,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific commit in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.

The commit SHA must be a 40-character hexadecimal string (SHA-1 hash).
operationId: GetCodeCoverageCommitSummary
Expand Down Expand Up @@ -170228,8 +170253,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific pull request in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.
operationId: GetCodeCoveragePRSummary
requestBody:
content:
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2865,6 +2865,7 @@ def overrides
"v2.coverage_summary_attributes" => "CoverageSummaryAttributes",
"v2.coverage_summary_codeowner_stats" => "CoverageSummaryCodeownerStats",
"v2.coverage_summary_data" => "CoverageSummaryData",
"v2.coverage_summary_flag_stats" => "CoverageSummaryFlagStats",
"v2.coverage_summary_response" => "CoverageSummaryResponse",
"v2.coverage_summary_service_stats" => "CoverageSummaryServiceStats",
"v2.coverage_summary_type" => "CoverageSummaryType",
Expand Down
12 changes: 6 additions & 6 deletions lib/datadog_api_client/v2/api/code_coverage_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def get_code_coverage_branch_summary(body, opts = {})
# Get code coverage summary for a branch.
#
# Retrieve aggregated code coverage statistics for a specific branch in a repository.
# This endpoint provides overall coverage metrics as well as breakdowns by service
# and code owner.
# This endpoint provides overall coverage metrics as well as breakdowns by service,
# code owner, and flag.
#
# @param body [BranchCoverageSummaryRequest]
# @param opts [Hash] the optional parameters
Expand Down Expand Up @@ -103,8 +103,8 @@ def get_code_coverage_commit_summary(body, opts = {})
# Get code coverage summary for a commit.
#
# Retrieve aggregated code coverage statistics for a specific commit in a repository.
# This endpoint provides overall coverage metrics as well as breakdowns by service
# and code owner.
# This endpoint provides overall coverage metrics as well as breakdowns by service,
# code owner, and flag.
#
# The commit SHA must be a 40-character hexadecimal string (SHA-1 hash).
#
Expand Down Expand Up @@ -243,8 +243,8 @@ def get_code_coverage_pr_summary(body, opts = {})
# Get code coverage summary for a pull request.
#
# Retrieve aggregated code coverage statistics for a specific pull request in a repository.
# This endpoint provides overall coverage metrics as well as breakdowns by service
# and code owner.
# This endpoint provides overall coverage metrics as well as breakdowns by service,
# code owner, and flag.
#
# @param body [PRCoverageSummaryRequest]
# @param opts [Hash] the optional parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class CoverageSummaryAttributes
# Total number of coverage reports evaluated.
attr_accessor :evaluated_reports_count

# Coverage statistics broken down by flag. Each entry contains only coverage percentages.
# Branch summaries include the flags of the latest covered commit, including coverage carried forward
# to that commit. Pull request summaries include flags across all commits of the pull request.
attr_accessor :flags

# Overall patch coverage percentage.
attr_accessor :patch_coverage

Expand All @@ -48,6 +53,7 @@ def self.attribute_map
:'codeowners' => :'codeowners',
:'evaluated_flags_count' => :'evaluated_flags_count',
:'evaluated_reports_count' => :'evaluated_reports_count',
:'flags' => :'flags',
:'patch_coverage' => :'patch_coverage',
:'services' => :'services',
:'total_coverage' => :'total_coverage'
Expand All @@ -61,6 +67,7 @@ def self.openapi_types
:'codeowners' => :'Hash<String, CoverageSummaryCodeownerStats>',
:'evaluated_flags_count' => :'Integer',
:'evaluated_reports_count' => :'Integer',
:'flags' => :'Hash<String, CoverageSummaryFlagStats>',
:'patch_coverage' => :'Float',
:'services' => :'Hash<String, CoverageSummaryServiceStats>',
:'total_coverage' => :'Float'
Expand All @@ -72,6 +79,7 @@ def self.openapi_types
def self.openapi_nullable
Set.new([
:'codeowners',
:'flags',
:'patch_coverage',
:'services',
:'total_coverage',
Expand Down Expand Up @@ -108,6 +116,10 @@ def initialize(attributes = {})
self.evaluated_reports_count = attributes[:'evaluated_reports_count']
end

if attributes.key?(:'flags')
self.flags = attributes[:'flags']
end

if attributes.key?(:'patch_coverage')
self.patch_coverage = attributes[:'patch_coverage']
end
Expand Down Expand Up @@ -150,6 +162,7 @@ def ==(o)
codeowners == o.codeowners &&
evaluated_flags_count == o.evaluated_flags_count &&
evaluated_reports_count == o.evaluated_reports_count &&
flags == o.flags &&
patch_coverage == o.patch_coverage &&
services == o.services &&
total_coverage == o.total_coverage &&
Expand All @@ -160,7 +173,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[codeowners, evaluated_flags_count, evaluated_reports_count, patch_coverage, services, total_coverage, additional_properties].hash
[codeowners, evaluated_flags_count, evaluated_reports_count, flags, patch_coverage, services, total_coverage, additional_properties].hash
end
end
end
124 changes: 124 additions & 0 deletions lib/datadog_api_client/v2/models/coverage_summary_flag_stats.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Coverage statistics for a specific flag.
class CoverageSummaryFlagStats
include BaseGenericModel

# Patch coverage percentage for the flag.
attr_accessor :patch_coverage

# Total coverage percentage for the flag.
attr_accessor :total_coverage

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'patch_coverage' => :'patch_coverage',
:'total_coverage' => :'total_coverage'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'patch_coverage' => :'Float',
:'total_coverage' => :'Float'
}
end

# List of attributes with nullable: true
# @!visibility private
def self.openapi_nullable
Set.new([
:'patch_coverage',
:'total_coverage',
])
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CoverageSummaryFlagStats` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'patch_coverage')
self.patch_coverage = attributes[:'patch_coverage']
end

if attributes.key?(:'total_coverage')
self.total_coverage = attributes[:'total_coverage']
end
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
patch_coverage == o.patch_coverage &&
total_coverage == o.total_coverage &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[patch_coverage, total_coverage, additional_properties].hash
end
end
end
Loading