From 76d363369a8c30a18b83c24d1f183759561f8a54 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 16 Mar 2021 19:17:26 +0000 Subject: [PATCH] Regenerate client from commit cc977e5 of spec repo --- .apigentools-info | 8 ++-- data/v1/openapi.yaml | 33 ++++++++++++++ docs/v1/README.md | 1 + docs/v1/TimeseriesWidgetDefinition.md | 4 ++ docs/v1/TimeseriesWidgetLegendLayout.md | 15 +++++++ lib/datadog_api_client/v1.rb | 1 + .../v1/models/timeseries_widget_definition.rb | 45 ++++++++++++++++++- .../models/timeseries_widget_legend_layout.rb | 41 +++++++++++++++++ .../timeseries_widget_legend_layout_spec.rb | 31 +++++++++++++ 9 files changed, 174 insertions(+), 5 deletions(-) create mode 100644 docs/v1/TimeseriesWidgetLegendLayout.md create mode 100644 lib/datadog_api_client/v1/models/timeseries_widget_legend_layout.rb create mode 100644 spec/v1/models/timeseries_widget_legend_layout_spec.rb diff --git a/.apigentools-info b/.apigentools-info index 0317300b31cf..28e837e6296d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev6", - "regenerated": "2021-03-12 10:37:31.735704", - "spec_repo_commit": "95807f2" + "regenerated": "2021-03-16 19:17:09.841531", + "spec_repo_commit": "cc977e5" }, "v2": { "apigentools_version": "1.4.1.dev6", - "regenerated": "2021-03-12 10:37:44.418418", - "spec_repo_commit": "95807f2" + "regenerated": "2021-03-16 19:17:24.865935", + "spec_repo_commit": "cc977e5" } } } \ No newline at end of file diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index 326aebcb48b2..1abf738484de 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -8259,6 +8259,10 @@ components: items: $ref: '#/components/schemas/WidgetEvent' type: array + legend_columns: + $ref: '#/components/schemas/TimeseriesWidgetLegendColumns' + legend_layout: + $ref: '#/components/schemas/TimeseriesWidgetLegendLayout' legend_size: $ref: '#/components/schemas/WidgetLegendSize' markers: @@ -8319,6 +8323,35 @@ components: required: - expression type: object + TimeseriesWidgetLegendColumns: + description: Columns displayed in the legend. + items: + description: Legend column. + enum: + - value + - avg + - sum + - min + - max + type: string + x-enum-varnames: + - VALUE + - AVG + - SUM + - MIN + - MAX + type: array + TimeseriesWidgetLegendLayout: + description: Layout of the legend. + enum: + - auto + - horizontal + - vertical + type: string + x-enum-varnames: + - AUTO + - HORIZONTAL + - VERTICAL TimeseriesWidgetRequest: description: Updated timeseries widget. properties: diff --git a/docs/v1/README.md b/docs/v1/README.md index f56717a31f98..727b065b7f26 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -639,6 +639,7 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::TimeseriesWidgetDefinition](TimeseriesWidgetDefinition.md) - [DatadogAPIClient::V1::TimeseriesWidgetDefinitionType](TimeseriesWidgetDefinitionType.md) - [DatadogAPIClient::V1::TimeseriesWidgetExpressionAlias](TimeseriesWidgetExpressionAlias.md) + - [DatadogAPIClient::V1::TimeseriesWidgetLegendLayout](TimeseriesWidgetLegendLayout.md) - [DatadogAPIClient::V1::TimeseriesWidgetRequest](TimeseriesWidgetRequest.md) - [DatadogAPIClient::V1::ToplistWidgetDefinition](ToplistWidgetDefinition.md) - [DatadogAPIClient::V1::ToplistWidgetDefinitionType](ToplistWidgetDefinitionType.md) diff --git a/docs/v1/TimeseriesWidgetDefinition.md b/docs/v1/TimeseriesWidgetDefinition.md index 2384b46844bd..05c3bd58fde1 100644 --- a/docs/v1/TimeseriesWidgetDefinition.md +++ b/docs/v1/TimeseriesWidgetDefinition.md @@ -6,6 +6,8 @@ | ---- | ---- | ----------- | ----- | | **custom_links** | [**Array<WidgetCustomLink>**](WidgetCustomLink.md) | List of custom links. | [optional] | | **events** | [**Array<WidgetEvent>**](WidgetEvent.md) | List of widget events. | [optional] | +| **legend_columns** | **Array<String>** | Columns displayed in the legend. | [optional] | +| **legend_layout** | [**TimeseriesWidgetLegendLayout**](TimeseriesWidgetLegendLayout.md) | | [optional] | | **legend_size** | **String** | Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\". | [optional] | | **markers** | [**Array<WidgetMarker>**](WidgetMarker.md) | List of markers. | [optional] | | **requests** | [**Array<TimeseriesWidgetRequest>**](TimeseriesWidgetRequest.md) | List of timeseries widget requests. | | @@ -26,6 +28,8 @@ require 'datadog_api_client/v1' instance = DatadogAPIClient::V1::TimeseriesWidgetDefinition.new( custom_links: null, events: null, + legend_columns: null, + legend_layout: null, legend_size: null, markers: null, requests: [{"q/apm_query/log_query":"<METRIC_1>{<SCOPE_1>}"}], diff --git a/docs/v1/TimeseriesWidgetLegendLayout.md b/docs/v1/TimeseriesWidgetLegendLayout.md new file mode 100644 index 000000000000..5a8bb8bff5a4 --- /dev/null +++ b/docs/v1/TimeseriesWidgetLegendLayout.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::TimeseriesWidgetLegendLayout + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeseriesWidgetLegendLayout.new() +``` + diff --git a/lib/datadog_api_client/v1.rb b/lib/datadog_api_client/v1.rb index ea2a5b8add50..2d35e9b708ac 100644 --- a/lib/datadog_api_client/v1.rb +++ b/lib/datadog_api_client/v1.rb @@ -393,6 +393,7 @@ require 'datadog_api_client/v1/models/timeseries_widget_definition' require 'datadog_api_client/v1/models/timeseries_widget_definition_type' require 'datadog_api_client/v1/models/timeseries_widget_expression_alias' +require 'datadog_api_client/v1/models/timeseries_widget_legend_layout' require 'datadog_api_client/v1/models/timeseries_widget_request' require 'datadog_api_client/v1/models/toplist_widget_definition' require 'datadog_api_client/v1/models/toplist_widget_definition_type' diff --git a/lib/datadog_api_client/v1/models/timeseries_widget_definition.rb b/lib/datadog_api_client/v1/models/timeseries_widget_definition.rb index f0c14803655d..0a909205be61 100644 --- a/lib/datadog_api_client/v1/models/timeseries_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/timeseries_widget_definition.rb @@ -25,6 +25,11 @@ class TimeseriesWidgetDefinition # List of widget events. attr_accessor :events + # Columns displayed in the legend. + attr_accessor :legend_columns + + attr_accessor :legend_layout + # Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\". attr_accessor :legend_size @@ -53,11 +58,35 @@ class TimeseriesWidgetDefinition attr_accessor :yaxis + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'custom_links' => :'custom_links', :'events' => :'events', + :'legend_columns' => :'legend_columns', + :'legend_layout' => :'legend_layout', :'legend_size' => :'legend_size', :'markers' => :'markers', :'requests' => :'requests', @@ -82,6 +111,8 @@ def self.openapi_types { :'custom_links' => :'Array', :'events' => :'Array', + :'legend_columns' => :'Array', + :'legend_layout' => :'TimeseriesWidgetLegendLayout', :'legend_size' => :'String', :'markers' => :'Array', :'requests' => :'Array', @@ -129,6 +160,16 @@ def initialize(attributes = {}) end end + if attributes.key?(:'legend_columns') + if (value = attributes[:'legend_columns']).is_a?(Array) + self.legend_columns = value + end + end + + if attributes.key?(:'legend_layout') + self.legend_layout = attributes[:'legend_layout'] + end + if attributes.key?(:'legend_size') self.legend_size = attributes[:'legend_size'] end @@ -229,6 +270,8 @@ def ==(o) self.class == o.class && custom_links == o.custom_links && events == o.events && + legend_columns == o.legend_columns && + legend_layout == o.legend_layout && legend_size == o.legend_size && markers == o.markers && requests == o.requests && @@ -251,7 +294,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [custom_links, events, legend_size, markers, requests, right_yaxis, show_legend, time, title, title_align, title_size, type, yaxis].hash + [custom_links, events, legend_columns, legend_layout, legend_size, markers, requests, right_yaxis, show_legend, time, title, title_align, title_size, type, yaxis].hash end # Builds the object from hash diff --git a/lib/datadog_api_client/v1/models/timeseries_widget_legend_layout.rb b/lib/datadog_api_client/v1/models/timeseries_widget_legend_layout.rb new file mode 100644 index 000000000000..eb8fdcfec3ce --- /dev/null +++ b/lib/datadog_api_client/v1/models/timeseries_widget_legend_layout.rb @@ -0,0 +1,41 @@ +=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://openapi-generator.tech + + 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 TimeseriesWidgetLegendLayout + AUTO = "auto".freeze + HORIZONTAL = "horizontal".freeze + VERTICAL = "vertical".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TimeseriesWidgetLegendLayout.constants.select { |c| TimeseriesWidgetLegendLayout::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TimeseriesWidgetLegendLayout" if constantValues.empty? + value + end + end +end diff --git a/spec/v1/models/timeseries_widget_legend_layout_spec.rb b/spec/v1/models/timeseries_widget_legend_layout_spec.rb new file mode 100644 index 000000000000..c230bac9e3f1 --- /dev/null +++ b/spec/v1/models/timeseries_widget_legend_layout_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeseriesWidgetLegendLayout +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeseriesWidgetLegendLayout do + let(:instance) { DatadogAPIClient::V1::TimeseriesWidgetLegendLayout.new } + + describe 'test an instance of TimeseriesWidgetLegendLayout' do + it 'should create an instance of TimeseriesWidgetLegendLayout' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeseriesWidgetLegendLayout) + end + end +end