Skip to content

Commit 142fa71

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 0895ae7 of spec repo (DataDog#3377)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 86b3627 commit 142fa71

11 files changed

Lines changed: 608 additions & 15 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,50 @@ components:
13451345
type: string
13461346
x-enum-varnames:
13471347
- COHORT
1348+
ComparisonCustomTimeframe:
1349+
description: Fixed time range for a `custom_timeframe` comparison.
1350+
properties:
1351+
from:
1352+
description: Start time in milliseconds since epoch.
1353+
example: 1779290190000
1354+
format: int64
1355+
type: integer
1356+
to:
1357+
description: End time in milliseconds since epoch.
1358+
example: 1779894990000
1359+
format: int64
1360+
type: integer
1361+
required:
1362+
- from
1363+
- to
1364+
type: object
1365+
ComparisonDuration:
1366+
description: The comparison period. Use a preset `type` value or set `type` to `custom_timeframe` and provide `custom_timeframe` with explicit millisecond epoch bounds.
1367+
properties:
1368+
custom_timeframe:
1369+
$ref: "#/components/schemas/ComparisonCustomTimeframe"
1370+
description: Required when `type` is `custom_timeframe`. Fixed time range to compare against.
1371+
type:
1372+
$ref: "#/components/schemas/ComparisonDurationType"
1373+
required:
1374+
- type
1375+
type: object
1376+
ComparisonDurationType:
1377+
description: "The comparison window type."
1378+
enum:
1379+
- previous_timeframe
1380+
- custom_timeframe
1381+
- previous_day
1382+
- previous_week
1383+
- previous_month
1384+
example: previous_timeframe
1385+
type: string
1386+
x-enum-varnames:
1387+
- PREVIOUS_TIMEFRAME
1388+
- CUSTOM_TIMEFRAME
1389+
- PREVIOUS_DAY
1390+
- PREVIOUS_WEEK
1391+
- PREVIOUS_MONTH
13481392
ContentEncoding:
13491393
description: HTTP header used to compress the media-type.
13501394
enum:
@@ -12064,6 +12108,43 @@ components:
1206412108
x-enum-varnames:
1206512109
- ASC
1206612110
- DESC
12111+
QueryValueWidgetComparison:
12112+
description: A change indicator that compares the current value to a historical period.
12113+
properties:
12114+
directionality:
12115+
$ref: "#/components/schemas/QueryValueWidgetComparisonDirectionality"
12116+
description: Which direction of change is considered an improvement, determining the indicator color.
12117+
duration:
12118+
$ref: "#/components/schemas/ComparisonDuration"
12119+
type:
12120+
$ref: "#/components/schemas/QueryValueWidgetComparisonType"
12121+
required:
12122+
- duration
12123+
type: object
12124+
QueryValueWidgetComparisonDirectionality:
12125+
default: neutral
12126+
description: "Color-coding direction: `increase_better` (green on rise), `decrease_better` (green on drop), or `neutral` (no color)."
12127+
enum:
12128+
- increase_better
12129+
- decrease_better
12130+
- neutral
12131+
type: string
12132+
x-enum-varnames:
12133+
- INCREASE_BETTER
12134+
- DECREASE_BETTER
12135+
- NEUTRAL
12136+
QueryValueWidgetComparisonType:
12137+
default: absolute
12138+
description: "How the delta is expressed: `absolute` (raw difference), `relative` (percentage), or `both`."
12139+
enum:
12140+
- absolute
12141+
- relative
12142+
- both
12143+
type: string
12144+
x-enum-varnames:
12145+
- ABSOLUTE
12146+
- RELATIVE
12147+
- BOTH
1206712148
QueryValueWidgetDefinition:
1206812149
description: Query values display the current value of a given metric, APM, or log query.
1206912150
properties:
@@ -12135,6 +12216,9 @@ components:
1213512216
$ref: "#/components/schemas/LogQueryDefinition"
1213612217
deprecated: true
1213712218
description: Deprecated - Use `queries` and `formulas` instead.
12219+
comparison:
12220+
$ref: "#/components/schemas/QueryValueWidgetComparison"
12221+
description: Displays a change indicator showing a delta against a historical baseline.
1213812222
conditional_formats:
1213912223
description: List of conditional formats.
1214012224
items:

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66681,9 +66681,6 @@ components:
6668166681
filter:
6668266682
description: Filter expression applied to the recommendations.
6668366683
type: string
66684-
scope:
66685-
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
66686-
type: string
6668766684
sort:
6668866685
description: Ordered list of sort clauses applied to the result set.
6668966686
items:

lib/datadog_api_client/inflector.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def overrides
7979
"v1.check_status_widget_definition_type" => "CheckStatusWidgetDefinitionType",
8080
"v1.cohort_widget_definition" => "CohortWidgetDefinition",
8181
"v1.cohort_widget_definition_type" => "CohortWidgetDefinitionType",
82+
"v1.comparison_custom_timeframe" => "ComparisonCustomTimeframe",
83+
"v1.comparison_duration" => "ComparisonDuration",
84+
"v1.comparison_duration_type" => "ComparisonDurationType",
8285
"v1.content_encoding" => "ContentEncoding",
8386
"v1.creator" => "Creator",
8487
"v1.dashboard" => "Dashboard",
@@ -533,6 +536,9 @@ def overrides
533536
"v1.product_analytics_funnel_request_type" => "ProductAnalyticsFunnelRequestType",
534537
"v1.product_analytics_funnel_widget_definition" => "ProductAnalyticsFunnelWidgetDefinition",
535538
"v1.query_sort_order" => "QuerySortOrder",
539+
"v1.query_value_widget_comparison" => "QueryValueWidgetComparison",
540+
"v1.query_value_widget_comparison_directionality" => "QueryValueWidgetComparisonDirectionality",
541+
"v1.query_value_widget_comparison_type" => "QueryValueWidgetComparisonType",
536542
"v1.query_value_widget_definition" => "QueryValueWidgetDefinition",
537543
"v1.query_value_widget_definition_type" => "QueryValueWidgetDefinitionType",
538544
"v1.query_value_widget_request" => "QueryValueWidgetRequest",
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# Fixed time range for a `custom_timeframe` comparison.
21+
class ComparisonCustomTimeframe
22+
include BaseGenericModel
23+
24+
# Start time in milliseconds since epoch.
25+
attr_reader :from
26+
27+
# End time in milliseconds since epoch.
28+
attr_reader :to
29+
30+
attr_accessor :additional_properties
31+
32+
# Attribute mapping from ruby-style variable name to JSON key.
33+
# @!visibility private
34+
def self.attribute_map
35+
{
36+
:'from' => :'from',
37+
:'to' => :'to'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'from' => :'Integer',
46+
:'to' => :'Integer'
47+
}
48+
end
49+
50+
# Initializes the object
51+
# @param attributes [Hash] Model attributes in the form of hash
52+
# @!visibility private
53+
def initialize(attributes = {})
54+
if (!attributes.is_a?(Hash))
55+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::ComparisonCustomTimeframe` initialize method"
56+
end
57+
58+
self.additional_properties = {}
59+
# check to see if the attribute exists and convert string to symbol for hash key
60+
attributes = attributes.each_with_object({}) { |(k, v), h|
61+
if (!self.class.attribute_map.key?(k.to_sym))
62+
self.additional_properties[k.to_sym] = v
63+
else
64+
h[k.to_sym] = v
65+
end
66+
}
67+
68+
if attributes.key?(:'from')
69+
self.from = attributes[:'from']
70+
end
71+
72+
if attributes.key?(:'to')
73+
self.to = attributes[:'to']
74+
end
75+
end
76+
77+
# Check to see if the all the properties in the model are valid
78+
# @return true if the model is valid
79+
# @!visibility private
80+
def valid?
81+
return false if @from.nil?
82+
return false if @to.nil?
83+
true
84+
end
85+
86+
# Custom attribute writer method with validation
87+
# @param from [Object] Object to be assigned
88+
# @!visibility private
89+
def from=(from)
90+
if from.nil?
91+
fail ArgumentError, 'invalid value for "from", from cannot be nil.'
92+
end
93+
@from = from
94+
end
95+
96+
# Custom attribute writer method with validation
97+
# @param to [Object] Object to be assigned
98+
# @!visibility private
99+
def to=(to)
100+
if to.nil?
101+
fail ArgumentError, 'invalid value for "to", to cannot be nil.'
102+
end
103+
@to = to
104+
end
105+
106+
# Returns the object in the form of hash, with additionalProperties support.
107+
# @return [Hash] Returns the object in the form of hash
108+
# @!visibility private
109+
def to_hash
110+
hash = {}
111+
self.class.attribute_map.each_pair do |attr, param|
112+
value = self.send(attr)
113+
if value.nil?
114+
is_nullable = self.class.openapi_nullable.include?(attr)
115+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
116+
end
117+
118+
hash[param] = _to_hash(value)
119+
end
120+
self.additional_properties.each_pair do |attr, value|
121+
hash[attr] = value
122+
end
123+
hash
124+
end
125+
126+
# Checks equality by comparing each attribute.
127+
# @param o [Object] Object to be compared
128+
# @!visibility private
129+
def ==(o)
130+
return true if self.equal?(o)
131+
self.class == o.class &&
132+
from == o.from &&
133+
to == o.to &&
134+
additional_properties == o.additional_properties
135+
end
136+
137+
# Calculates hash code according to all attributes.
138+
# @return [Integer] Hash code
139+
# @!visibility private
140+
def hash
141+
[from, to, additional_properties].hash
142+
end
143+
end
144+
end

0 commit comments

Comments
 (0)