diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5808b5f79644..e0b45ec93580 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -37090,6 +37090,8 @@ components: type: string platform: $ref: "#/components/schemas/IssuePlatform" + regression: + $ref: "#/components/schemas/IssueRegression" service: description: Service name. example: "email-api-py" @@ -37360,6 +37362,27 @@ components: - id - type type: object + IssueRegression: + description: Regression information for an issue that was previously resolved and then reopened. + properties: + regressed_at: + description: Timestamp when the issue was reopened (regressed). + example: "2024-01-03T08:00:00Z" + format: date-time + type: string + regressed_at_version: + description: Application version where the regression was observed. + example: "v2.5.2" + type: string + resolved_at: + description: Timestamp when the issue was resolved before the regression. + example: "2024-01-01T10:00:00Z" + format: date-time + type: string + required: + - resolved_at + - regressed_at + type: object IssueRelationships: description: Relationship between the issue and an assignee, case and/or teams. properties: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c8a70ed3c2fc..615323fce059 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3331,6 +3331,7 @@ def overrides "v2.issue_language" => "IssueLanguage", "v2.issue_platform" => "IssuePlatform", "v2.issue_reference" => "IssueReference", + "v2.issue_regression" => "IssueRegression", "v2.issue_relationships" => "IssueRelationships", "v2.issue_response" => "IssueResponse", "v2.issues_search_request" => "IssuesSearchRequest", diff --git a/lib/datadog_api_client/v2/models/issue_attributes.rb b/lib/datadog_api_client/v2/models/issue_attributes.rb index 55e5661930fb..1732a0c9edbe 100644 --- a/lib/datadog_api_client/v2/models/issue_attributes.rb +++ b/lib/datadog_api_client/v2/models/issue_attributes.rb @@ -54,6 +54,9 @@ class IssueAttributes # Platform associated with the issue. attr_accessor :platform + # Regression information for an issue that was previously resolved and then reopened. + attr_accessor :regression + # Service name. attr_accessor :service @@ -77,6 +80,7 @@ def self.attribute_map :'last_seen' => :'last_seen', :'last_seen_version' => :'last_seen_version', :'platform' => :'platform', + :'regression' => :'regression', :'service' => :'service', :'state' => :'state' } @@ -97,6 +101,7 @@ def self.openapi_types :'last_seen' => :'Integer', :'last_seen_version' => :'String', :'platform' => :'IssuePlatform', + :'regression' => :'IssueRegression', :'service' => :'String', :'state' => :'IssueState' } @@ -166,6 +171,10 @@ def initialize(attributes = {}) self.platform = attributes[:'platform'] end + if attributes.key?(:'regression') + self.regression = attributes[:'regression'] + end + if attributes.key?(:'service') self.service = attributes[:'service'] end @@ -212,6 +221,7 @@ def ==(o) last_seen == o.last_seen && last_seen_version == o.last_seen_version && platform == o.platform && + regression == o.regression && service == o.service && state == o.state && additional_properties == o.additional_properties @@ -221,7 +231,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [error_message, error_type, file_path, first_seen, first_seen_version, function_name, is_crash, languages, last_seen, last_seen_version, platform, service, state, additional_properties].hash + [error_message, error_type, file_path, first_seen, first_seen_version, function_name, is_crash, languages, last_seen, last_seen_version, platform, regression, service, state, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/issue_regression.rb b/lib/datadog_api_client/v2/models/issue_regression.rb new file mode 100644 index 000000000000..76028cc36483 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_regression.rb @@ -0,0 +1,154 @@ +=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 + # Regression information for an issue that was previously resolved and then reopened. + class IssueRegression + include BaseGenericModel + + # Timestamp when the issue was reopened (regressed). + attr_reader :regressed_at + + # Application version where the regression was observed. + attr_accessor :regressed_at_version + + # Timestamp when the issue was resolved before the regression. + attr_reader :resolved_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'regressed_at' => :'regressed_at', + :'regressed_at_version' => :'regressed_at_version', + :'resolved_at' => :'resolved_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'regressed_at' => :'Time', + :'regressed_at_version' => :'String', + :'resolved_at' => :'Time' + } + 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::IssueRegression` 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?(:'regressed_at') + self.regressed_at = attributes[:'regressed_at'] + end + + if attributes.key?(:'regressed_at_version') + self.regressed_at_version = attributes[:'regressed_at_version'] + end + + if attributes.key?(:'resolved_at') + self.resolved_at = attributes[:'resolved_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @regressed_at.nil? + return false if @resolved_at.nil? + true + end + + # Custom attribute writer method with validation + # @param regressed_at [Object] Object to be assigned + # @!visibility private + def regressed_at=(regressed_at) + if regressed_at.nil? + fail ArgumentError, 'invalid value for "regressed_at", regressed_at cannot be nil.' + end + @regressed_at = regressed_at + end + + # Custom attribute writer method with validation + # @param resolved_at [Object] Object to be assigned + # @!visibility private + def resolved_at=(resolved_at) + if resolved_at.nil? + fail ArgumentError, 'invalid value for "resolved_at", resolved_at cannot be nil.' + end + @resolved_at = resolved_at + 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 && + regressed_at == o.regressed_at && + regressed_at_version == o.regressed_at_version && + resolved_at == o.resolved_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [regressed_at, regressed_at_version, resolved_at, additional_properties].hash + end + end +end