Skip to content

Commit 9b01974

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document top list widget style (#1733)
* Regenerate client from commit c1794418 of spec repo * pre-commit fixes --------- Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 977b5d7 commit 9b01974

17 files changed

+528
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-11-03 08:42:28.004910",
8-
"spec_repo_commit": "73969482"
7+
"regenerated": "2023-11-06 14:30:03.814912",
8+
"spec_repo_commit": "c1794418"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-11-03 08:42:28.019072",
13-
"spec_repo_commit": "73969482"
12+
"regenerated": "2023-11-06 14:30:03.837958",
13+
"spec_repo_commit": "c1794418"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16097,6 +16097,8 @@ components:
1609716097
items:
1609816098
$ref: '#/components/schemas/ToplistWidgetRequest'
1609916099
type: array
16100+
style:
16101+
$ref: '#/components/schemas/ToplistWidgetStyle'
1610016102
time:
1610116103
$ref: '#/components/schemas/WidgetTime'
1610216104
title:
@@ -16122,6 +16124,40 @@ components:
1612216124
type: string
1612316125
x-enum-varnames:
1612416126
- TOPLIST
16127+
ToplistWidgetDisplay:
16128+
description: Top list widget display options.
16129+
oneOf:
16130+
- $ref: '#/components/schemas/ToplistWidgetStacked'
16131+
- $ref: '#/components/schemas/ToplistWidgetFlat'
16132+
ToplistWidgetFlat:
16133+
description: Top list widget flat display.
16134+
properties:
16135+
type:
16136+
$ref: '#/components/schemas/ToplistWidgetFlatType'
16137+
required:
16138+
- type
16139+
type: object
16140+
ToplistWidgetFlatType:
16141+
default: flat
16142+
description: Top list widget flat display type.
16143+
enum:
16144+
- flat
16145+
example: flat
16146+
type: string
16147+
x-enum-varnames:
16148+
- FLAT
16149+
ToplistWidgetLegend:
16150+
description: Top list widget stacked legend behavior.
16151+
enum:
16152+
- automatic
16153+
- inline
16154+
- none
16155+
example: automatic
16156+
type: string
16157+
x-enum-varnames:
16158+
- AUTOMATIC
16159+
- INLINE
16160+
- NONE
1612516161
ToplistWidgetRequest:
1612616162
description: Updated top list widget.
1612716163
properties:
@@ -16171,6 +16207,43 @@ components:
1617116207
style:
1617216208
$ref: '#/components/schemas/WidgetRequestStyle'
1617316209
type: object
16210+
ToplistWidgetScaling:
16211+
description: Top list widget scaling definition.
16212+
enum:
16213+
- absolute
16214+
- relative
16215+
type: string
16216+
x-enum-varnames:
16217+
- ABSOLUTE
16218+
- RELATIVE
16219+
ToplistWidgetStacked:
16220+
description: Top list widget stacked display options.
16221+
properties:
16222+
legend:
16223+
$ref: '#/components/schemas/ToplistWidgetLegend'
16224+
type:
16225+
$ref: '#/components/schemas/ToplistWidgetStackedType'
16226+
required:
16227+
- type
16228+
- legend
16229+
type: object
16230+
ToplistWidgetStackedType:
16231+
default: stacked
16232+
description: Top list widget stacked display type.
16233+
enum:
16234+
- stacked
16235+
example: stacked
16236+
type: string
16237+
x-enum-varnames:
16238+
- STACKED
16239+
ToplistWidgetStyle:
16240+
description: Style customization for a top list widget.
16241+
properties:
16242+
display:
16243+
$ref: '#/components/schemas/ToplistWidgetDisplay'
16244+
scaling:
16245+
$ref: '#/components/schemas/ToplistWidgetScaling'
16246+
type: object
1617416247
TopologyMapWidgetDefinition:
1617516248
description: This widget displays a topology of nodes and edges for different
1617616249
data sources. It replaces the service map widget.

docs/datadog_api_client.v1.model.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4747,13 +4747,69 @@ toplist\_widget\_definition\_type
47474747
:members:
47484748
:show-inheritance:
47494749

4750+
toplist\_widget\_display
4751+
------------------------
4752+
4753+
.. automodule:: datadog_api_client.v1.model.toplist_widget_display
4754+
:members:
4755+
:show-inheritance:
4756+
4757+
toplist\_widget\_flat
4758+
---------------------
4759+
4760+
.. automodule:: datadog_api_client.v1.model.toplist_widget_flat
4761+
:members:
4762+
:show-inheritance:
4763+
4764+
toplist\_widget\_flat\_type
4765+
---------------------------
4766+
4767+
.. automodule:: datadog_api_client.v1.model.toplist_widget_flat_type
4768+
:members:
4769+
:show-inheritance:
4770+
4771+
toplist\_widget\_legend
4772+
-----------------------
4773+
4774+
.. automodule:: datadog_api_client.v1.model.toplist_widget_legend
4775+
:members:
4776+
:show-inheritance:
4777+
47504778
toplist\_widget\_request
47514779
------------------------
47524780

47534781
.. automodule:: datadog_api_client.v1.model.toplist_widget_request
47544782
:members:
47554783
:show-inheritance:
47564784

4785+
toplist\_widget\_scaling
4786+
------------------------
4787+
4788+
.. automodule:: datadog_api_client.v1.model.toplist_widget_scaling
4789+
:members:
4790+
:show-inheritance:
4791+
4792+
toplist\_widget\_stacked
4793+
------------------------
4794+
4795+
.. automodule:: datadog_api_client.v1.model.toplist_widget_stacked
4796+
:members:
4797+
:show-inheritance:
4798+
4799+
toplist\_widget\_stacked\_type
4800+
------------------------------
4801+
4802+
.. automodule:: datadog_api_client.v1.model.toplist_widget_stacked_type
4803+
:members:
4804+
:show-inheritance:
4805+
4806+
toplist\_widget\_style
4807+
----------------------
4808+
4809+
.. automodule:: datadog_api_client.v1.model.toplist_widget_style
4810+
:members:
4811+
:show-inheritance:
4812+
47574813
topology\_map\_widget\_definition
47584814
---------------------------------
47594815

examples/v1/dashboards/CreateDashboard_1213075383.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
from datadog_api_client.v1.model.query_sort_order import QuerySortOrder
1616
from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition
1717
from datadog_api_client.v1.model.toplist_widget_definition_type import ToplistWidgetDefinitionType
18+
from datadog_api_client.v1.model.toplist_widget_legend import ToplistWidgetLegend
1819
from datadog_api_client.v1.model.toplist_widget_request import ToplistWidgetRequest
20+
from datadog_api_client.v1.model.toplist_widget_scaling import ToplistWidgetScaling
21+
from datadog_api_client.v1.model.toplist_widget_stacked import ToplistWidgetStacked
22+
from datadog_api_client.v1.model.toplist_widget_stacked_type import ToplistWidgetStackedType
23+
from datadog_api_client.v1.model.toplist_widget_style import ToplistWidgetStyle
1924
from datadog_api_client.v1.model.widget import Widget
2025
from datadog_api_client.v1.model.widget_formula import WidgetFormula
2126
from datadog_api_client.v1.model.widget_formula_limit import WidgetFormulaLimit
@@ -39,6 +44,13 @@
3944
title_size="16",
4045
title_align=WidgetTextAlign.LEFT,
4146
time=WidgetTime(),
47+
style=ToplistWidgetStyle(
48+
display=ToplistWidgetStacked(
49+
type=ToplistWidgetStackedType.STACKED,
50+
legend=ToplistWidgetLegend.INLINE,
51+
),
52+
scaling=ToplistWidgetScaling.RELATIVE,
53+
),
4254
type=ToplistWidgetDefinitionType.TOPLIST,
4355
requests=[
4456
ToplistWidgetRequest(

src/datadog_api_client/v1/model/toplist_widget_definition.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
if TYPE_CHECKING:
1717
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
1818
from datadog_api_client.v1.model.toplist_widget_request import ToplistWidgetRequest
19+
from datadog_api_client.v1.model.toplist_widget_style import ToplistWidgetStyle
1920
from datadog_api_client.v1.model.widget_time import WidgetTime
2021
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
2122
from datadog_api_client.v1.model.toplist_widget_definition_type import ToplistWidgetDefinitionType
@@ -26,13 +27,15 @@ class ToplistWidgetDefinition(ModelNormal):
2627
def openapi_types(_):
2728
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
2829
from datadog_api_client.v1.model.toplist_widget_request import ToplistWidgetRequest
30+
from datadog_api_client.v1.model.toplist_widget_style import ToplistWidgetStyle
2931
from datadog_api_client.v1.model.widget_time import WidgetTime
3032
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
3133
from datadog_api_client.v1.model.toplist_widget_definition_type import ToplistWidgetDefinitionType
3234

3335
return {
3436
"custom_links": ([WidgetCustomLink],),
3537
"requests": ([ToplistWidgetRequest],),
38+
"style": (ToplistWidgetStyle,),
3639
"time": (WidgetTime,),
3740
"title": (str,),
3841
"title_align": (WidgetTextAlign,),
@@ -43,6 +46,7 @@ def openapi_types(_):
4346
attribute_map = {
4447
"custom_links": "custom_links",
4548
"requests": "requests",
49+
"style": "style",
4650
"time": "time",
4751
"title": "title",
4852
"title_align": "title_align",
@@ -55,6 +59,7 @@ def __init__(
5559
requests: List[ToplistWidgetRequest],
5660
type: ToplistWidgetDefinitionType,
5761
custom_links: Union[List[WidgetCustomLink], UnsetType] = unset,
62+
style: Union[ToplistWidgetStyle, UnsetType] = unset,
5863
time: Union[WidgetTime, UnsetType] = unset,
5964
title: Union[str, UnsetType] = unset,
6065
title_align: Union[WidgetTextAlign, UnsetType] = unset,
@@ -70,6 +75,9 @@ def __init__(
7075
:param requests: List of top list widget requests.
7176
:type requests: [ToplistWidgetRequest]
7277
78+
:param style: Style customization for a top list widget.
79+
:type style: ToplistWidgetStyle, optional
80+
7381
:param time: Time setting for the widget.
7482
:type time: WidgetTime, optional
7583
@@ -87,6 +95,8 @@ def __init__(
8795
"""
8896
if custom_links is not unset:
8997
kwargs["custom_links"] = custom_links
98+
if style is not unset:
99+
kwargs["style"] = style
90100
if time is not unset:
91101
kwargs["time"] = time
92102
if title is not unset:
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 ToplistWidgetDisplay(ModelComposed):
14+
def __init__(self, **kwargs):
15+
"""
16+
Top list widget display options.
17+
18+
:param legend: Top list widget stacked legend behavior.
19+
:type legend: ToplistWidgetLegend
20+
21+
:param type: Top list widget stacked display type.
22+
:type type: ToplistWidgetStackedType
23+
"""
24+
super().__init__(kwargs)
25+
26+
@cached_property
27+
def _composed_schemas(_):
28+
# we need this here to make our import statements work
29+
# we must store _composed_schemas in here so the code is only run
30+
# when we invoke this method. If we kept this at the class
31+
# level we would get an error because the class level
32+
# code would be run when this module is imported, and these composed
33+
# classes don't exist yet because their module has not finished
34+
# loading
35+
from datadog_api_client.v1.model.toplist_widget_stacked import ToplistWidgetStacked
36+
from datadog_api_client.v1.model.toplist_widget_flat import ToplistWidgetFlat
37+
38+
return {
39+
"oneOf": [
40+
ToplistWidgetStacked,
41+
ToplistWidgetFlat,
42+
],
43+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.toplist_widget_flat_type import ToplistWidgetFlatType
16+
17+
18+
class ToplistWidgetFlat(ModelNormal):
19+
@cached_property
20+
def openapi_types(_):
21+
from datadog_api_client.v1.model.toplist_widget_flat_type import ToplistWidgetFlatType
22+
23+
return {
24+
"type": (ToplistWidgetFlatType,),
25+
}
26+
27+
attribute_map = {
28+
"type": "type",
29+
}
30+
31+
def __init__(self_, type: ToplistWidgetFlatType, **kwargs):
32+
"""
33+
Top list widget flat display.
34+
35+
:param type: Top list widget flat display type.
36+
:type type: ToplistWidgetFlatType
37+
"""
38+
super().__init__(kwargs)
39+
40+
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 ToplistWidgetFlatType(ModelSimple):
16+
"""
17+
Top list widget flat display type.
18+
19+
:param value: If omitted defaults to "flat". Must be one of ["flat"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"flat",
25+
}
26+
FLAT: ClassVar["ToplistWidgetFlatType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
ToplistWidgetFlatType.FLAT = ToplistWidgetFlatType("flat")

0 commit comments

Comments
 (0)