Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing CI App fields page and test_level #1448

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-26 17:14:47.582803",
"spec_repo_commit": "69e8c6e4"
"regenerated": "2023-07-28 14:17:52.139252",
"spec_repo_commit": "6f54a513"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-26 17:14:47.595457",
"spec_repo_commit": "69e8c6e4"
"regenerated": "2023-07-28 14:17:52.152274",
"spec_repo_commit": "6f54a513"
}
}
}
71 changes: 51 additions & 20 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1481,25 +1481,15 @@ components:
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from CI Visibility events.
description: JSON object of attributes from CI Visibility test events.
example:
customAttribute: 123
duration: 2345
type: object
service:
description: 'The name of the application or service generating CI Visibility
events.

It is used to switch from CI Visibility to APM, so make sure you define
the same

value when you use both products.'
example: web-ui-tests
type: string
tags:
$ref: '#/components/schemas/TagsEventAttribute'
timestamp:
$ref: '#/components/schemas/TimestampEventAttribute'
test_level:
$ref: '#/components/schemas/CIAppTestLevel'
type: object
CIAppGitInfo:
description: 'If pipelines are triggered due to actions to a Git repository,
Expand Down Expand Up @@ -1661,14 +1651,30 @@ components:
stored by Datadog.
properties:
attributes:
$ref: '#/components/schemas/CIAppEventAttributes'
$ref: '#/components/schemas/CIAppPipelineEventAttributes'
id:
description: Unique ID of the event.
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
type: string
type:
$ref: '#/components/schemas/CIAppPipelineEventTypeName'
type: object
CIAppPipelineEventAttributes:
description: JSON object containing all event attributes and their associated
values.
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from CI Visibility pipeline events.
example:
customAttribute: 123
duration: 2345
type: object
ci_level:
$ref: '#/components/schemas/CIAppPipelineLevel'
tags:
$ref: '#/components/schemas/TagsEventAttribute'
type: object
CIAppPipelineEventJob:
description: Details of a CI job.
properties:
Expand Down Expand Up @@ -2190,6 +2196,22 @@ components:
meta:
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppPipelineLevel:
description: Pipeline execution level.
enum:
- pipeline
- stage
- job
- step
- custom
example: pipeline
type: string
x-enum-varnames:
- PIPELINE
- STAGE
- JOB
- STEP
- CUSTOM
CIAppPipelinesAggregateRequest:
description: The object sent with the request to retrieve aggregation buckets
of pipeline events from your organization.
Expand Down Expand Up @@ -2463,6 +2485,20 @@ components:
meta:
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppTestLevel:
description: Test run level.
enum:
- session
- module
- suite
- test
example: test
type: string
x-enum-varnames:
- SESSION
- MODULE
- SUITE
- TEST
CIAppTestsAggregateRequest:
description: The object sent with the request to retrieve aggregation buckets
of test events from your organization.
Expand Down Expand Up @@ -2500,7 +2536,7 @@ components:
links:
$ref: '#/components/schemas/CIAppResponseLinks'
meta:
$ref: '#/components/schemas/CIAppResponseMetadata'
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppTestsBucketResponse:
description: Bucket values.
Expand Down Expand Up @@ -16579,11 +16615,6 @@ components:
items:
$ref: '#/components/schemas/TimeseriesResponseValues'
type: array
TimestampEventAttribute:
description: Timestamp of your event.
example: '2019-01-02T09:42:36.320Z'
format: date-time
type: string
Unit:
description: Object containing the metric unit family, scale factor, name, and
short name.
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ def overrides
"v2.ci_app_group_by_total" => "CIAppGroupByTotal",
"v2.ci_app_host_info" => "CIAppHostInfo",
"v2.ci_app_pipeline_event" => "CIAppPipelineEvent",
"v2.ci_app_pipeline_event_attributes" => "CIAppPipelineEventAttributes",
"v2.ci_app_pipeline_event_job" => "CIAppPipelineEventJob",
"v2.ci_app_pipeline_event_job_level" => "CIAppPipelineEventJobLevel",
"v2.ci_app_pipeline_event_job_status" => "CIAppPipelineEventJobStatus",
Expand All @@ -898,6 +899,7 @@ def overrides
"v2.ci_app_pipeline_event_step_level" => "CIAppPipelineEventStepLevel",
"v2.ci_app_pipeline_event_step_status" => "CIAppPipelineEventStepStatus",
"v2.ci_app_pipeline_event_type_name" => "CIAppPipelineEventTypeName",
"v2.ci_app_pipeline_level" => "CIAppPipelineLevel",
"v2.ci_app_pipelines_aggregate_request" => "CIAppPipelinesAggregateRequest",
"v2.ci_app_pipelines_aggregation_buckets_response" => "CIAppPipelinesAggregationBucketsResponse",
"v2.ci_app_pipelines_analytics_aggregate_response" => "CIAppPipelinesAnalyticsAggregateResponse",
Expand All @@ -917,6 +919,7 @@ def overrides
"v2.ci_app_test_events_request" => "CIAppTestEventsRequest",
"v2.ci_app_test_events_response" => "CIAppTestEventsResponse",
"v2.ci_app_test_event_type_name" => "CIAppTestEventTypeName",
"v2.ci_app_test_level" => "CIAppTestLevel",
"v2.ci_app_tests_aggregate_request" => "CIAppTestsAggregateRequest",
"v2.ci_app_tests_aggregation_buckets_response" => "CIAppTestsAggregationBucketsResponse",
"v2.ci_app_tests_analytics_aggregate_response" => "CIAppTestsAnalyticsAggregateResponse",
Expand Down
30 changes: 9 additions & 21 deletions lib/datadog_api_client/v2/models/ci_app_event_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,22 @@ module DatadogAPIClient::V2
class CIAppEventAttributes
include BaseGenericModel

# JSON object of attributes from CI Visibility events.
# JSON object of attributes from CI Visibility test events.
attr_accessor :attributes

# The name of the application or service generating CI Visibility events.
# It is used to switch from CI Visibility to APM, so make sure you define the same
# value when you use both products.
attr_accessor :service

# Array of tags associated with your event.
attr_accessor :tags

# Timestamp of your event.
attr_accessor :timestamp
# Test run level.
attr_accessor :test_level

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

Expand All @@ -51,9 +45,8 @@ def self.attribute_map
def self.openapi_types
{
:'attributes' => :'Hash<String, Object>',
:'service' => :'String',
:'tags' => :'Array<String>',
:'timestamp' => :'Time'
:'test_level' => :'CIAppTestLevel'
}
end

Expand All @@ -77,18 +70,14 @@ def initialize(attributes = {})
self.attributes = attributes[:'attributes']
end

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

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end

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

Expand All @@ -99,16 +88,15 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
attributes == o.attributes &&
service == o.service &&
tags == o.tags &&
timestamp == o.timestamp
test_level == o.test_level
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[attributes, service, tags, timestamp].hash
[attributes, tags, test_level].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'attributes' => :'CIAppEventAttributes',
:'attributes' => :'CIAppPipelineEventAttributes',
:'id' => :'String',
:'type' => :'CIAppPipelineEventTypeName'
}
Expand Down
102 changes: 102 additions & 0 deletions lib/datadog_api_client/v2/models/ci_app_pipeline_event_attributes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
=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
# JSON object containing all event attributes and their associated values.
class CIAppPipelineEventAttributes
include BaseGenericModel

# JSON object of attributes from CI Visibility pipeline events.
attr_accessor :attributes

# Pipeline execution level.
attr_accessor :ci_level

# Array of tags associated with your event.
attr_accessor :tags

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'attributes' => :'Hash<String, Object>',
:'ci_level' => :'CIAppPipelineLevel',
:'tags' => :'Array<String>'
}
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::CIAppPipelineEventAttributes` initialize method"
end

# 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))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CIAppPipelineEventAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

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

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

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
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 &&
attributes == o.attributes &&
ci_level == o.ci_level &&
tags == o.tags
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[attributes, ci_level, tags].hash
end
end
end
30 changes: 30 additions & 0 deletions lib/datadog_api_client/v2/models/ci_app_pipeline_level.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
=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
# Pipeline execution level.
class CIAppPipelineLevel
include BaseEnumModel

PIPELINE = "pipeline".freeze
STAGE = "stage".freeze
JOB = "job".freeze
STEP = "step".freeze
CUSTOM = "custom".freeze
end
end
Loading
Loading