Skip to content
Open
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
18 changes: 18 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20118,9 +20118,27 @@ components:
description: Color palette to apply to the widget.
type: string
type: object
TimeseriesWidgetAnomalyDetection:
description: Anomaly detection configuration for a timeseries widget.
properties:
detection_sensitivity:
$ref: "#/components/schemas/TimeseriesWidgetAnomalyDetectionSensitivity"
required:
- detection_sensitivity
type: object
TimeseriesWidgetAnomalyDetectionSensitivity:
description: Sensitivity level for anomaly detection. Use `never_detect` to disable anomaly detection.
enum:
- never_detect
example: never_detect
type: string
x-enum-varnames:
- NEVER_DETECT
TimeseriesWidgetDefinition:
description: The timeseries visualization allows you to display the evolution of one or more metrics, log events, or Indexed Spans over time.
properties:
anomaly_detection:
$ref: "#/components/schemas/TimeseriesWidgetAnomalyDetection"
custom_links:
description: List of custom links.
items:
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ def overrides
"v1.timeseries_background" => "TimeseriesBackground",
"v1.timeseries_background_type" => "TimeseriesBackgroundType",
"v1.timeseries_request_style" => "TimeseriesRequestStyle",
"v1.timeseries_widget_anomaly_detection" => "TimeseriesWidgetAnomalyDetection",
"v1.timeseries_widget_anomaly_detection_sensitivity" => "TimeseriesWidgetAnomalyDetectionSensitivity",
"v1.timeseries_widget_definition" => "TimeseriesWidgetDefinition",
"v1.timeseries_widget_definition_type" => "TimeseriesWidgetDefinitionType",
"v1.timeseries_widget_expression_alias" => "TimeseriesWidgetExpressionAlias",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
=begin
#Datadog API V1 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::V1
# Anomaly detection configuration for a timeseries widget.
class TimeseriesWidgetAnomalyDetection
include BaseGenericModel

# Sensitivity level for anomaly detection. Use `never_detect` to disable anomaly detection.
attr_reader :detection_sensitivity

attr_accessor :additional_properties

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'detection_sensitivity' => :'TimeseriesWidgetAnomalyDetectionSensitivity'
}
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::V1::TimeseriesWidgetAnomalyDetection` 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?(:'detection_sensitivity')
self.detection_sensitivity = attributes[:'detection_sensitivity']
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 @detection_sensitivity.nil?
true
end

# Custom attribute writer method with validation
# @param detection_sensitivity [Object] Object to be assigned
# @!visibility private
def detection_sensitivity=(detection_sensitivity)
if detection_sensitivity.nil?
fail ArgumentError, 'invalid value for "detection_sensitivity", detection_sensitivity cannot be nil.'
end
@detection_sensitivity = detection_sensitivity
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 &&
detection_sensitivity == o.detection_sensitivity &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[detection_sensitivity, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
=begin
#Datadog API V1 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::V1
# Sensitivity level for anomaly detection. Use `never_detect` to disable anomaly detection.
class TimeseriesWidgetAnomalyDetectionSensitivity
include BaseEnumModel

NEVER_DETECT = "never_detect".freeze
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module DatadogAPIClient::V1
class TimeseriesWidgetDefinition
include BaseGenericModel

# Anomaly detection configuration for a timeseries widget.
attr_accessor :anomaly_detection

# List of custom links.
attr_accessor :custom_links

Expand Down Expand Up @@ -75,6 +78,7 @@ class TimeseriesWidgetDefinition
# @!visibility private
def self.attribute_map
{
:'anomaly_detection' => :'anomaly_detection',
:'custom_links' => :'custom_links',
:'description' => :'description',
:'events' => :'events',
Expand All @@ -98,6 +102,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'anomaly_detection' => :'TimeseriesWidgetAnomalyDetection',
:'custom_links' => :'Array<WidgetCustomLink>',
:'description' => :'String',
:'events' => :'Array<WidgetEvent>',
Expand Down Expand Up @@ -135,6 +140,10 @@ def initialize(attributes = {})
end
}

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

if attributes.key?(:'custom_links')
if (value = attributes[:'custom_links']).is_a?(Array)
self.custom_links = value
Expand Down Expand Up @@ -269,6 +278,7 @@ def to_hash
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
anomaly_detection == o.anomaly_detection &&
custom_links == o.custom_links &&
description == o.description &&
events == o.events &&
Expand All @@ -292,7 +302,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[custom_links, description, events, legend_columns, legend_layout, legend_size, markers, requests, right_yaxis, show_legend, time, title, title_align, title_size, type, yaxis, additional_properties].hash
[anomaly_detection, custom_links, description, events, legend_columns, legend_layout, legend_size, markers, requests, right_yaxis, show_legend, time, title, title_align, title_size, type, yaxis, additional_properties].hash
end
end
end
Loading