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
775 changes: 773 additions & 2 deletions .generator/schemas/v1/openapi.yaml

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,54 @@ def overrides
"v1.group_type" => "GroupType",
"v1.group_widget_definition" => "GroupWidgetDefinition",
"v1.group_widget_definition_type" => "GroupWidgetDefinitionType",
"v1.guided_table_column" => "GuidedTableColumn",
"v1.guided_table_column_comparison" => "GuidedTableColumnComparison",
"v1.guided_table_column_comparison_with_other_column" => "GuidedTableColumnComparisonWithOtherColumn",
"v1.guided_table_column_comparison_with_other_column_type" => "GuidedTableColumnComparisonWithOtherColumnType",
"v1.guided_table_column_comparison_with_self" => "GuidedTableColumnComparisonWithSelf",
"v1.guided_table_column_comparison_with_self_type" => "GuidedTableColumnComparisonWithSelfType",
"v1.guided_table_column_format" => "GuidedTableColumnFormat",
"v1.guided_table_column_function" => "GuidedTableColumnFunction",
"v1.guided_table_column_function_args_item" => "GuidedTableColumnFunctionArgsItem",
"v1.guided_table_compute_column" => "GuidedTableComputeColumn",
"v1.guided_table_compute_column_compute" => "GuidedTableComputeColumnCompute",
"v1.guided_table_compute_column_type" => "GuidedTableComputeColumnType",
"v1.guided_table_conditional_formats" => "GuidedTableConditionalFormats",
"v1.guided_table_events_query" => "GuidedTableEventsQuery",
"v1.guided_table_events_query_data_source" => "GuidedTableEventsQueryDataSource",
"v1.guided_table_events_query_search" => "GuidedTableEventsQuerySearch",
"v1.guided_table_formula_column" => "GuidedTableFormulaColumn",
"v1.guided_table_group_key" => "GuidedTableGroupKey",
"v1.guided_table_metrics_query" => "GuidedTableMetricsQuery",
"v1.guided_table_metrics_query_data_source" => "GuidedTableMetricsQueryDataSource",
"v1.guided_table_number_bar_column_format" => "GuidedTableNumberBarColumnFormat",
"v1.guided_table_number_bar_column_format_mode" => "GuidedTableNumberBarColumnFormatMode",
"v1.guided_table_number_format" => "GuidedTableNumberFormat",
"v1.guided_table_number_format_precision" => "GuidedTableNumberFormatPrecision",
"v1.guided_table_preset_column" => "GuidedTablePresetColumn",
"v1.guided_table_preset_column_preset" => "GuidedTablePresetColumnPreset",
"v1.guided_table_preset_column_preset_type" => "GuidedTablePresetColumnPresetType",
"v1.guided_table_preset_column_type" => "GuidedTablePresetColumnType",
"v1.guided_table_query" => "GuidedTableQuery",
"v1.guided_table_range_formatting_rule" => "GuidedTableRangeFormattingRule",
"v1.guided_table_range_formatting_rule_scale" => "GuidedTableRangeFormattingRuleScale",
"v1.guided_table_range_formatting_rule_type" => "GuidedTableRangeFormattingRuleType",
"v1.guided_table_range_palette" => "GuidedTableRangePalette",
"v1.guided_table_request" => "GuidedTableRequest",
"v1.guided_table_request_request_type" => "GuidedTableRequestRequestType",
"v1.guided_table_row_group_by" => "GuidedTableRowGroupBy",
"v1.guided_table_row_group_by_format" => "GuidedTableRowGroupByFormat",
"v1.guided_table_rows" => "GuidedTableRows",
"v1.guided_table_sort" => "GuidedTableSort",
"v1.guided_table_storage_type" => "GuidedTableStorageType",
"v1.guided_table_text_formatting_rule" => "GuidedTableTextFormattingRule",
"v1.guided_table_text_formatting_rule_replace" => "GuidedTableTextFormattingRuleReplace",
"v1.guided_table_text_formatting_rule_replace_one_of4484404608" => "GuidedTableTextFormattingRuleReplaceOneOf4484404608",
"v1.guided_table_threshold_formatting_rule" => "GuidedTableThresholdFormattingRule",
"v1.guided_table_threshold_formatting_rule_value" => "GuidedTableThresholdFormattingRuleValue",
"v1.guided_table_threshold_palette" => "GuidedTableThresholdPalette",
"v1.guided_table_trend_column_format" => "GuidedTableTrendColumnFormat",
"v1.guided_table_trend_column_format_mode" => "GuidedTableTrendColumnFormatMode",
"v1.heat_map_widget_definition" => "HeatMapWidgetDefinition",
"v1.heat_map_widget_definition_type" => "HeatMapWidgetDefinitionType",
"v1.heat_map_widget_request" => "HeatMapWidgetRequest",
Expand Down Expand Up @@ -799,6 +847,7 @@ def overrides
"v1.synthetics_warning_type" => "SyntheticsWarningType",
"v1.table_widget_cell_display_mode" => "TableWidgetCellDisplayMode",
"v1.table_widget_definition" => "TableWidgetDefinition",
"v1.table_widget_definition_requests_item" => "TableWidgetDefinitionRequestsItem",
"v1.table_widget_definition_type" => "TableWidgetDefinitionType",
"v1.table_widget_has_search_bar" => "TableWidgetHasSearchBar",
"v1.table_widget_request" => "TableWidgetRequest",
Expand Down
64 changes: 64 additions & 0 deletions lib/datadog_api_client/v1/models/guided_table_column.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
=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
# Definition of a single column in a guided table widget. A column can be a computed value, a preset comparison, or a formula.
module GuidedTableColumn
class << self
include BaseOneOfModel
include BaseOneOfModelNoDiscriminator

# List of class defined in oneOf (OpenAPI v3)
def openapi_one_of
[
:'GuidedTableComputeColumn',
:'GuidedTablePresetColumn',
:'GuidedTableFormulaColumn'
]
end
# Builds the object
# @param data [Mixed] Data to be matched against the list of oneOf items
# @return [Object] Returns the model or the data itself
def build(data)
# Go through the list of oneOf items and attempt to identify the appropriate one.
# Note:
# - We do not attempt to check whether exactly one item matches.
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
# - TODO: scalar values are de facto behaving as if they were nullable.
# - TODO: logging when debugging is set.
openapi_one_of.each do |klass|
begin
next if klass == :AnyType # "nullable: true"
typed_data = find_and_cast_into_type(klass, data)
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
return typed_data if typed_data
rescue # rescue all errors so we keep iterating even if the current item lookup raises
end
end

if openapi_one_of.include?(:AnyType)
data
else
self._unparsed = true
DatadogAPIClient::UnparsedObject.new(data)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
=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
# Comparison to display in a guided table column.
module GuidedTableColumnComparison
class << self
include BaseOneOfModel
include BaseOneOfModelNoDiscriminator

# List of class defined in oneOf (OpenAPI v3)
def openapi_one_of
[
:'GuidedTableColumnComparisonWithSelf',
:'GuidedTableColumnComparisonWithOtherColumn'
]
end
# Builds the object
# @param data [Mixed] Data to be matched against the list of oneOf items
# @return [Object] Returns the model or the data itself
def build(data)
# Go through the list of oneOf items and attempt to identify the appropriate one.
# Note:
# - We do not attempt to check whether exactly one item matches.
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
# - TODO: scalar values are de facto behaving as if they were nullable.
# - TODO: logging when debugging is set.
openapi_one_of.each do |klass|
begin
next if klass == :AnyType # "nullable: true"
typed_data = find_and_cast_into_type(klass, data)
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
return typed_data if typed_data
rescue # rescue all errors so we keep iterating even if the current item lookup raises
end
end

if openapi_one_of.include?(:AnyType)
data
else
self._unparsed = true
DatadogAPIClient::UnparsedObject.new(data)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
=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
# Comparison of a column value against another column.
class GuidedTableColumnComparisonWithOtherColumn
include BaseGenericModel

# Name of the column to compare against.
attr_reader :column

#
attr_reader :type

attr_accessor :additional_properties

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'column' => :'String',
:'type' => :'GuidedTableColumnComparisonWithOtherColumnType'
}
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::GuidedTableColumnComparisonWithOtherColumn` 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?(:'column')
self.column = attributes[:'column']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
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 @column.nil?
return false if @type.nil?
true
end

# Custom attribute writer method with validation
# @param column [Object] Object to be assigned
# @!visibility private
def column=(column)
if column.nil?
fail ArgumentError, 'invalid value for "column", column cannot be nil.'
end
@column = column
end

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

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[column, type, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
=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
#
class GuidedTableColumnComparisonWithOtherColumnType
include BaseEnumModel

DIFF_FROM = "diff_from".freeze
PERCENT_OF = "percent_of".freeze
PERCENT_DIFF_FROM = "percent_diff_from".freeze
end
end
Loading
Loading