Skip to content

Commit b18a7dd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d890c19 of spec repo
1 parent 42f8411 commit b18a7dd

9 files changed

Lines changed: 531 additions & 4 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,8 @@ components:
14431443
format: date-time
14441444
readOnly: true
14451445
type: string
1446+
default_timeframe:
1447+
$ref: "#/components/schemas/DashboardDefaultTimeframeSetting"
14461448
description:
14471449
description: Description of the dashboard.
14481450
nullable: true
@@ -1557,13 +1559,55 @@ components:
15571559
required:
15581560
- data
15591561
type: object
1562+
DashboardDefaultTimeframeSetting:
1563+
description: The default timeframe applied when opening the dashboard. Set to `null` to clear the dashboard's default timeframe.
1564+
discriminator:
1565+
mapping:
1566+
fixed: "#/components/schemas/DashboardFixedTimeframe"
1567+
live: "#/components/schemas/DashboardLiveTimeframe"
1568+
propertyName: type
1569+
nullable: true
1570+
oneOf:
1571+
- $ref: "#/components/schemas/DashboardLiveTimeframe"
1572+
- $ref: "#/components/schemas/DashboardFixedTimeframe"
1573+
type: object
15601574
DashboardDeleteResponse:
15611575
description: Response from the delete dashboard call.
15621576
properties:
15631577
deleted_dashboard_id:
15641578
description: ID of the deleted dashboard.
15651579
type: string
15661580
type: object
1581+
DashboardFixedTimeframe:
1582+
description: A fixed dashboard timeframe.
1583+
properties:
1584+
from:
1585+
description: Start time in milliseconds since epoch.
1586+
example: 1712080128000
1587+
format: int64
1588+
minimum: 0
1589+
type: integer
1590+
to:
1591+
description: End time in milliseconds since epoch.
1592+
example: 1712083128000
1593+
format: int64
1594+
minimum: 0
1595+
type: integer
1596+
type:
1597+
$ref: "#/components/schemas/DashboardFixedTimeframeType"
1598+
required:
1599+
- type
1600+
- from
1601+
- to
1602+
type: object
1603+
DashboardFixedTimeframeType:
1604+
description: Type of fixed timeframe.
1605+
enum:
1606+
- fixed
1607+
example: fixed
1608+
type: string
1609+
x-enum-varnames:
1610+
- FIXED
15671611
DashboardGlobalTime:
15681612
description: Object containing the live span selection for the dashboard.
15691613
properties:
@@ -1672,6 +1716,32 @@ components:
16721716
$ref: "#/components/schemas/DashboardList"
16731717
type: array
16741718
type: object
1719+
DashboardLiveTimeframe:
1720+
description: A live dashboard timeframe.
1721+
properties:
1722+
type:
1723+
$ref: "#/components/schemas/DashboardLiveTimeframeType"
1724+
unit:
1725+
$ref: "#/components/schemas/WidgetLiveSpanUnit"
1726+
value:
1727+
description: Value of the live timeframe span.
1728+
example: 4
1729+
format: int64
1730+
minimum: 1
1731+
type: integer
1732+
required:
1733+
- type
1734+
- value
1735+
- unit
1736+
type: object
1737+
DashboardLiveTimeframeType:
1738+
description: Type of live timeframe.
1739+
enum:
1740+
- live
1741+
example: live
1742+
type: string
1743+
x-enum-varnames:
1744+
- LIVE
16751745
DashboardReflowType:
16761746
description: |-
16771747
Reflow type for a **new dashboard layout** dashboard. Set this only when layout type is 'ordered'.

features/v1/dashboards.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Feature: Dashboards
9090
@generated @skip @team:DataDog/dashboards-backend
9191
Scenario: Create a new dashboard returns "Bad Request" response
9292
Given new "CreateDashboard" request
93-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
93+
And body with value {"default_timeframe": {"type": "live", "unit": "minute", "value": 4}, "description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
9494
When the request is sent
9595
Then the response status is 400 Bad Request
9696

@@ -1463,15 +1463,15 @@ Feature: Dashboards
14631463
Scenario: Update a dashboard returns "Bad Request" response
14641464
Given new "UpdateDashboard" request
14651465
And request contains "dashboard_id" parameter from "REPLACE.ME"
1466-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
1466+
And body with value {"default_timeframe": {"type": "live", "unit": "minute", "value": 4}, "description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
14671467
When the request is sent
14681468
Then the response status is 400 Bad Request
14691469

14701470
@generated @skip @team:DataDog/dashboards-backend
14711471
Scenario: Update a dashboard returns "Item Not Found" response
14721472
Given new "UpdateDashboard" request
14731473
And request contains "dashboard_id" parameter from "REPLACE.ME"
1474-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
1474+
And body with value {"default_timeframe": {"type": "live", "unit": "minute", "value": 4}, "description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
14751475
When the request is sent
14761476
Then the response status is 404 Item Not Found
14771477

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,19 @@ 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_setting" => "DashboardDefaultTimeframeSetting",
9091
"v1.dashboard_delete_response" => "DashboardDeleteResponse",
92+
"v1.dashboard_fixed_timeframe" => "DashboardFixedTimeframe",
93+
"v1.dashboard_fixed_timeframe_type" => "DashboardFixedTimeframeType",
9194
"v1.dashboard_global_time" => "DashboardGlobalTime",
9295
"v1.dashboard_global_time_live_span" => "DashboardGlobalTimeLiveSpan",
9396
"v1.dashboard_invite_type" => "DashboardInviteType",
9497
"v1.dashboard_layout_type" => "DashboardLayoutType",
9598
"v1.dashboard_list" => "DashboardList",
9699
"v1.dashboard_list_delete_response" => "DashboardListDeleteResponse",
97100
"v1.dashboard_list_list_response" => "DashboardListListResponse",
101+
"v1.dashboard_live_timeframe" => "DashboardLiveTimeframe",
102+
"v1.dashboard_live_timeframe_type" => "DashboardLiveTimeframeType",
98103
"v1.dashboard_reflow_type" => "DashboardReflowType",
99104
"v1.dashboard_resource_type" => "DashboardResourceType",
100105
"v1.dashboard_restore_request" => "DashboardRestoreRequest",

lib/datadog_api_client/v1/models/dashboard.rb

Lines changed: 12 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' => :'DashboardDefaultTimeframeSetting',
117122
:'description' => :'String',
118123
:'id' => :'String',
119124
:'is_read_only' => :'Boolean',
@@ -137,6 +142,7 @@ def self.openapi_types
137142
def self.openapi_nullable
138143
Set.new([
139144
:'author_name',
145+
:'default_timeframe',
140146
:'description',
141147
:'notify_list',
142148
:'tabs',
@@ -176,6 +182,10 @@ def initialize(attributes = {})
176182
self.created_at = attributes[:'created_at']
177183
end
178184

185+
if attributes.key?(:'default_timeframe')
186+
self.default_timeframe = attributes[:'default_timeframe']
187+
end
188+
179189
if attributes.key?(:'description')
180190
self.description = attributes[:'description']
181191
end
@@ -342,6 +352,7 @@ def ==(o)
342352
author_handle == o.author_handle &&
343353
author_name == o.author_name &&
344354
created_at == o.created_at &&
355+
default_timeframe == o.default_timeframe &&
345356
description == o.description &&
346357
id == o.id &&
347358
is_read_only == o.is_read_only &&
@@ -364,7 +375,7 @@ def ==(o)
364375
# @return [Integer] Hash code
365376
# @!visibility private
366377
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
378+
[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
368379
end
369380
end
370381
end
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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. Set to `null` to clear the dashboard's default timeframe.
21+
module DashboardDefaultTimeframeSetting
22+
class << self
23+
include BaseOneOfModel
24+
25+
# List of class defined in oneOf (OpenAPI v3)
26+
def openapi_one_of
27+
[
28+
:'DashboardLiveTimeframe',
29+
:'DashboardFixedTimeframe'
30+
]
31+
end
32+
# Discriminator's property name (OpenAPI v3)
33+
def openapi_discriminator_name
34+
:'type'
35+
end
36+
37+
# Builds the object
38+
# @param data [Mixed] Data to be matched against the list of oneOf items
39+
# @return [Object] Returns the model or the data itself
40+
def build(data)
41+
discriminator_value = data[openapi_discriminator_name]
42+
return nil unless discriminator_value
43+
44+
end
45+
end
46+
end
47+
end

0 commit comments

Comments
 (0)