Skip to content

Commit d50a2b7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6905dc7 of spec repo
1 parent b75003d commit d50a2b7

10 files changed

Lines changed: 379 additions & 3 deletions

.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'.

docs/datadog_api_client.v1.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,34 @@ datadog\_api\_client.v1.model.dashboard\_bulk\_delete\_request module
564564
:members:
565565
:show-inheritance:
566566

567+
datadog\_api\_client.v1.model.dashboard\_default\_timeframe\_setting module
568+
---------------------------------------------------------------------------
569+
570+
.. automodule:: datadog_api_client.v1.model.dashboard_default_timeframe_setting
571+
:members:
572+
:show-inheritance:
573+
567574
datadog\_api\_client.v1.model.dashboard\_delete\_response module
568575
----------------------------------------------------------------
569576

570577
.. automodule:: datadog_api_client.v1.model.dashboard_delete_response
571578
:members:
572579
:show-inheritance:
573580

581+
datadog\_api\_client.v1.model.dashboard\_fixed\_timeframe module
582+
----------------------------------------------------------------
583+
584+
.. automodule:: datadog_api_client.v1.model.dashboard_fixed_timeframe
585+
:members:
586+
:show-inheritance:
587+
588+
datadog\_api\_client.v1.model.dashboard\_fixed\_timeframe\_type module
589+
----------------------------------------------------------------------
590+
591+
.. automodule:: datadog_api_client.v1.model.dashboard_fixed_timeframe_type
592+
:members:
593+
:show-inheritance:
594+
574595
datadog\_api\_client.v1.model.dashboard\_global\_time module
575596
------------------------------------------------------------
576597

@@ -620,6 +641,20 @@ datadog\_api\_client.v1.model.dashboard\_list\_list\_response module
620641
:members:
621642
:show-inheritance:
622643

644+
datadog\_api\_client.v1.model.dashboard\_live\_timeframe module
645+
---------------------------------------------------------------
646+
647+
.. automodule:: datadog_api_client.v1.model.dashboard_live_timeframe
648+
:members:
649+
:show-inheritance:
650+
651+
datadog\_api\_client.v1.model.dashboard\_live\_timeframe\_type module
652+
---------------------------------------------------------------------
653+
654+
.. automodule:: datadog_api_client.v1.model.dashboard_live_timeframe_type
655+
:members:
656+
:show-inheritance:
657+
623658
datadog\_api\_client.v1.model.dashboard\_reflow\_type module
624659
------------------------------------------------------------
625660

src/datadog_api_client/v1/model/dashboard.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616

1717

1818
if TYPE_CHECKING:
19+
from datadog_api_client.v1.model.dashboard_default_timeframe_setting import DashboardDefaultTimeframeSetting
1920
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
2021
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType
2122
from datadog_api_client.v1.model.dashboard_tab import DashboardTab
2223
from datadog_api_client.v1.model.dashboard_template_variable_preset import DashboardTemplateVariablePreset
2324
from datadog_api_client.v1.model.dashboard_template_variable import DashboardTemplateVariable
2425
from datadog_api_client.v1.model.widget import Widget
26+
from datadog_api_client.v1.model.dashboard_live_timeframe import DashboardLiveTimeframe
27+
from datadog_api_client.v1.model.dashboard_fixed_timeframe import DashboardFixedTimeframe
2528

2629

2730
class Dashboard(ModelNormal):
@@ -36,6 +39,7 @@ class Dashboard(ModelNormal):
3639

3740
@cached_property
3841
def openapi_types(_):
42+
from datadog_api_client.v1.model.dashboard_default_timeframe_setting import DashboardDefaultTimeframeSetting
3943
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
4044
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType
4145
from datadog_api_client.v1.model.dashboard_tab import DashboardTab
@@ -47,6 +51,7 @@ def openapi_types(_):
4751
"author_handle": (str,),
4852
"author_name": (str, none_type),
4953
"created_at": (datetime,),
54+
"default_timeframe": (DashboardDefaultTimeframeSetting,),
5055
"description": (str, none_type),
5156
"id": (str,),
5257
"is_read_only": (bool,),
@@ -68,6 +73,7 @@ def openapi_types(_):
6873
"author_handle": "author_handle",
6974
"author_name": "author_name",
7075
"created_at": "created_at",
76+
"default_timeframe": "default_timeframe",
7177
"description": "description",
7278
"id": "id",
7379
"is_read_only": "is_read_only",
@@ -101,6 +107,11 @@ def __init__(
101107
author_handle: Union[str, UnsetType] = unset,
102108
author_name: Union[str, none_type, UnsetType] = unset,
103109
created_at: Union[datetime, UnsetType] = unset,
110+
default_timeframe: Union[
111+
Union[DashboardDefaultTimeframeSetting, DashboardLiveTimeframe, DashboardFixedTimeframe],
112+
none_type,
113+
UnsetType,
114+
] = unset,
104115
description: Union[str, none_type, UnsetType] = unset,
105116
id: Union[str, UnsetType] = unset,
106117
is_read_only: Union[bool, UnsetType] = unset,
@@ -128,6 +139,9 @@ def __init__(
128139
:param created_at: Creation date of the dashboard.
129140
:type created_at: datetime, optional
130141
142+
:param default_timeframe: The default timeframe applied when opening the dashboard. Set to ``null`` to clear the dashboard's default timeframe.
143+
:type default_timeframe: DashboardDefaultTimeframeSetting, none_type, optional
144+
131145
:param description: Description of the dashboard.
132146
:type description: str, none_type, optional
133147
@@ -183,6 +197,8 @@ def __init__(
183197
kwargs["author_name"] = author_name
184198
if created_at is not unset:
185199
kwargs["created_at"] = created_at
200+
if default_timeframe is not unset:
201+
kwargs["default_timeframe"] = default_timeframe
186202
if description is not unset:
187203
kwargs["description"] = description
188204
if id is not unset:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelComposed,
9+
cached_property,
10+
)
11+
12+
13+
class DashboardDefaultTimeframeSetting(ModelComposed):
14+
_nullable = True
15+
16+
def __init__(self, **kwargs):
17+
"""
18+
The default timeframe applied when opening the dashboard. Set to ``null`` to clear the dashboard's default timeframe.
19+
20+
:param type: Type of live timeframe.
21+
:type type: DashboardLiveTimeframeType
22+
23+
:param unit: Unit of the time span.
24+
:type unit: WidgetLiveSpanUnit
25+
26+
:param value: Value of the live timeframe span.
27+
:type value: int
28+
29+
:param _from: Start time in milliseconds since epoch.
30+
:type _from: int
31+
32+
:param to: End time in milliseconds since epoch.
33+
:type to: int
34+
"""
35+
super().__init__(kwargs)
36+
37+
@cached_property
38+
def _composed_schemas(_):
39+
# we need this here to make our import statements work
40+
# we must store _composed_schemas in here so the code is only run
41+
# when we invoke this method. If we kept this at the class
42+
# level we would get an error because the class level
43+
# code would be run when this module is imported, and these composed
44+
# classes don't exist yet because their module has not finished
45+
# loading
46+
from datadog_api_client.v1.model.dashboard_live_timeframe import DashboardLiveTimeframe
47+
from datadog_api_client.v1.model.dashboard_fixed_timeframe import DashboardFixedTimeframe
48+
49+
return {
50+
"oneOf": [
51+
DashboardLiveTimeframe,
52+
DashboardFixedTimeframe,
53+
],
54+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v1.model.dashboard_fixed_timeframe_type import DashboardFixedTimeframeType
16+
17+
18+
class DashboardFixedTimeframe(ModelNormal):
19+
validations = {
20+
"_from": {
21+
"inclusive_minimum": 0,
22+
},
23+
"to": {
24+
"inclusive_minimum": 0,
25+
},
26+
}
27+
28+
@cached_property
29+
def openapi_types(_):
30+
from datadog_api_client.v1.model.dashboard_fixed_timeframe_type import DashboardFixedTimeframeType
31+
32+
return {
33+
"_from": (int,),
34+
"to": (int,),
35+
"type": (DashboardFixedTimeframeType,),
36+
}
37+
38+
attribute_map = {
39+
"_from": "from",
40+
"to": "to",
41+
"type": "type",
42+
}
43+
44+
def __init__(self_, _from: int, to: int, type: DashboardFixedTimeframeType, **kwargs):
45+
"""
46+
A fixed dashboard timeframe.
47+
48+
:param _from: Start time in milliseconds since epoch.
49+
:type _from: int
50+
51+
:param to: End time in milliseconds since epoch.
52+
:type to: int
53+
54+
:param type: Type of fixed timeframe.
55+
:type type: DashboardFixedTimeframeType
56+
"""
57+
super().__init__(kwargs)
58+
59+
self_._from = _from
60+
self_.to = to
61+
self_.type = type
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class DashboardFixedTimeframeType(ModelSimple):
16+
"""
17+
Type of fixed timeframe.
18+
19+
:param value: If omitted defaults to "fixed". Must be one of ["fixed"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"fixed",
25+
}
26+
FIXED: ClassVar["DashboardFixedTimeframeType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
DashboardFixedTimeframeType.FIXED = DashboardFixedTimeframeType("fixed")

0 commit comments

Comments
 (0)