Skip to content

Commit fd5c93a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 335acc5 of spec repo
1 parent 01ab389 commit fd5c93a

5 files changed

Lines changed: 240 additions & 1 deletion

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,10 @@ components:
14431443
format: date-time
14441444
readOnly: true
14451445
type: string
1446+
default_timeframe:
1447+
allOf:
1448+
- $ref: "#/components/schemas/DashboardDefaultTimeframe"
1449+
description: The default timeframe applied when opening the dashboard. Set to `null` to clear the dashboard's default timeframe.
14461450
description:
14471451
description: Description of the dashboard.
14481452
nullable: true
@@ -1557,6 +1561,39 @@ components:
15571561
required:
15581562
- data
15591563
type: object
1564+
DashboardDefaultTimeframe:
1565+
description: The default timeframe applied when opening the dashboard.
1566+
nullable: true
1567+
properties:
1568+
from:
1569+
description: Start time in milliseconds since epoch. Required when `type` is `fixed`.
1570+
format: int64
1571+
type: integer
1572+
to:
1573+
description: End time in milliseconds since epoch. Required when `type` is `fixed`.
1574+
format: int64
1575+
type: integer
1576+
type:
1577+
$ref: "#/components/schemas/DashboardDefaultTimeframeType"
1578+
unit:
1579+
$ref: "#/components/schemas/WidgetLiveSpanUnit"
1580+
value:
1581+
description: Value of the live timeframe span. Required when `type` is `live`.
1582+
format: int64
1583+
type: integer
1584+
required:
1585+
- type
1586+
type: object
1587+
DashboardDefaultTimeframeType:
1588+
description: Type of timeframe.
1589+
enum:
1590+
- live
1591+
- fixed
1592+
example: live
1593+
type: string
1594+
x-enum-varnames:
1595+
- LIVE
1596+
- FIXED
15601597
DashboardDeleteResponse:
15611598
description: Response from the delete dashboard call.
15621599
properties:

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def overrides
8787
"v1.dashboard" => "Dashboard",
8888
"v1.dashboard_bulk_action_data" => "DashboardBulkActionData",
8989
"v1.dashboard_bulk_delete_request" => "DashboardBulkDeleteRequest",
90+
"v1.dashboard_default_timeframe" => "DashboardDefaultTimeframe",
91+
"v1.dashboard_default_timeframe_type" => "DashboardDefaultTimeframeType",
9092
"v1.dashboard_delete_response" => "DashboardDeleteResponse",
9193
"v1.dashboard_global_time" => "DashboardGlobalTime",
9294
"v1.dashboard_global_time_live_span" => "DashboardGlobalTimeLiveSpan",

lib/datadog_api_client/v1/models/dashboard.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class Dashboard
3131
# Creation date of the dashboard.
3232
attr_accessor :created_at
3333

34+
# The default timeframe applied when opening the dashboard. Set to `null` to clear the dashboard's default timeframe.
35+
attr_accessor :default_timeframe
36+
3437
# Description of the dashboard.
3538
attr_accessor :description
3639

@@ -89,6 +92,7 @@ def self.attribute_map
8992
:'author_handle' => :'author_handle',
9093
:'author_name' => :'author_name',
9194
:'created_at' => :'created_at',
95+
:'default_timeframe' => :'default_timeframe',
9296
:'description' => :'description',
9397
:'id' => :'id',
9498
:'is_read_only' => :'is_read_only',
@@ -114,6 +118,7 @@ def self.openapi_types
114118
:'author_handle' => :'String',
115119
:'author_name' => :'String',
116120
:'created_at' => :'Time',
121+
:'default_timeframe' => :'DashboardDefaultTimeframe',
117122
:'description' => :'String',
118123
:'id' => :'String',
119124
:'is_read_only' => :'Boolean',
@@ -176,6 +181,10 @@ def initialize(attributes = {})
176181
self.created_at = attributes[:'created_at']
177182
end
178183

184+
if attributes.key?(:'default_timeframe')
185+
self.default_timeframe = attributes[:'default_timeframe']
186+
end
187+
179188
if attributes.key?(:'description')
180189
self.description = attributes[:'description']
181190
end
@@ -342,6 +351,7 @@ def ==(o)
342351
author_handle == o.author_handle &&
343352
author_name == o.author_name &&
344353
created_at == o.created_at &&
354+
default_timeframe == o.default_timeframe &&
345355
description == o.description &&
346356
id == o.id &&
347357
is_read_only == o.is_read_only &&
@@ -364,7 +374,7 @@ def ==(o)
364374
# @return [Integer] Hash code
365375
# @!visibility private
366376
def hash
367-
[author_handle, author_name, created_at, description, id, is_read_only, layout_type, modified_at, notify_list, reflow_type, restricted_roles, tabs, tags, template_variable_presets, template_variables, title, url, widgets, additional_properties].hash
377+
[author_handle, author_name, created_at, default_timeframe, description, id, is_read_only, layout_type, modified_at, notify_list, reflow_type, restricted_roles, tabs, tags, template_variable_presets, template_variables, title, url, widgets, additional_properties].hash
368378
end
369379
end
370380
end
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
# The default timeframe applied when opening the dashboard.
21+
class DashboardDefaultTimeframe
22+
include BaseGenericModel
23+
24+
# Start time in milliseconds since epoch. Required when `type` is `fixed`.
25+
attr_accessor :from
26+
27+
# End time in milliseconds since epoch. Required when `type` is `fixed`.
28+
attr_accessor :to
29+
30+
# Type of timeframe.
31+
attr_reader :type
32+
33+
# Unit of the time span.
34+
attr_accessor :unit
35+
36+
# Value of the live timeframe span. Required when `type` is `live`.
37+
attr_accessor :value
38+
39+
attr_accessor :additional_properties
40+
41+
# Attribute mapping from ruby-style variable name to JSON key.
42+
# @!visibility private
43+
def self.attribute_map
44+
{
45+
:'from' => :'from',
46+
:'to' => :'to',
47+
:'type' => :'type',
48+
:'unit' => :'unit',
49+
:'value' => :'value'
50+
}
51+
end
52+
53+
# Attribute type mapping.
54+
# @!visibility private
55+
def self.openapi_types
56+
{
57+
:'from' => :'Integer',
58+
:'to' => :'Integer',
59+
:'type' => :'DashboardDefaultTimeframeType',
60+
:'unit' => :'WidgetLiveSpanUnit',
61+
:'value' => :'Integer'
62+
}
63+
end
64+
65+
# Initializes the object
66+
# @param attributes [Hash] Model attributes in the form of hash
67+
# @!visibility private
68+
def initialize(attributes = {})
69+
if (!attributes.is_a?(Hash))
70+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::DashboardDefaultTimeframe` initialize method"
71+
end
72+
73+
self.additional_properties = {}
74+
# check to see if the attribute exists and convert string to symbol for hash key
75+
attributes = attributes.each_with_object({}) { |(k, v), h|
76+
if (!self.class.attribute_map.key?(k.to_sym))
77+
self.additional_properties[k.to_sym] = v
78+
else
79+
h[k.to_sym] = v
80+
end
81+
}
82+
83+
if attributes.key?(:'from')
84+
self.from = attributes[:'from']
85+
end
86+
87+
if attributes.key?(:'to')
88+
self.to = attributes[:'to']
89+
end
90+
91+
if attributes.key?(:'type')
92+
self.type = attributes[:'type']
93+
end
94+
95+
if attributes.key?(:'unit')
96+
self.unit = attributes[:'unit']
97+
end
98+
99+
if attributes.key?(:'value')
100+
self.value = attributes[:'value']
101+
end
102+
end
103+
104+
# Check to see if the all the properties in the model are valid
105+
# @return true if the model is valid
106+
# @!visibility private
107+
def valid?
108+
return false if @type.nil?
109+
true
110+
end
111+
112+
# Custom attribute writer method with validation
113+
# @param type [Object] Object to be assigned
114+
# @!visibility private
115+
def type=(type)
116+
if type.nil?
117+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
118+
end
119+
@type = type
120+
end
121+
122+
# Returns the object in the form of hash, with additionalProperties support.
123+
# @return [Hash] Returns the object in the form of hash
124+
# @!visibility private
125+
def to_hash
126+
hash = {}
127+
self.class.attribute_map.each_pair do |attr, param|
128+
value = self.send(attr)
129+
if value.nil?
130+
is_nullable = self.class.openapi_nullable.include?(attr)
131+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
132+
end
133+
134+
hash[param] = _to_hash(value)
135+
end
136+
self.additional_properties.each_pair do |attr, value|
137+
hash[attr] = value
138+
end
139+
hash
140+
end
141+
142+
# Checks equality by comparing each attribute.
143+
# @param o [Object] Object to be compared
144+
# @!visibility private
145+
def ==(o)
146+
return true if self.equal?(o)
147+
self.class == o.class &&
148+
from == o.from &&
149+
to == o.to &&
150+
type == o.type &&
151+
unit == o.unit &&
152+
value == o.value &&
153+
additional_properties == o.additional_properties
154+
end
155+
156+
# Calculates hash code according to all attributes.
157+
# @return [Integer] Hash code
158+
# @!visibility private
159+
def hash
160+
[from, to, type, unit, value, additional_properties].hash
161+
end
162+
end
163+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
# Type of timeframe.
21+
class DashboardDefaultTimeframeType
22+
include BaseEnumModel
23+
24+
LIVE = "live".freeze
25+
FIXED = "fixed".freeze
26+
end
27+
end

0 commit comments

Comments
 (0)