-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathtopology_map_widget_definition.py
More file actions
97 lines (80 loc) · 3.31 KB
/
topology_map_widget_definition.py
File metadata and controls
97 lines (80 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations
from typing import List, Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
from datadog_api_client.v1.model.topology_request import TopologyRequest
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
from datadog_api_client.v1.model.topology_map_widget_definition_type import TopologyMapWidgetDefinitionType
class TopologyMapWidgetDefinition(ModelNormal):
validations = {
"requests": {
"min_items": 1,
},
}
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
from datadog_api_client.v1.model.topology_request import TopologyRequest
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
from datadog_api_client.v1.model.topology_map_widget_definition_type import TopologyMapWidgetDefinitionType
return {
"custom_links": ([WidgetCustomLink],),
"requests": ([TopologyRequest],),
"title": (str,),
"title_align": (WidgetTextAlign,),
"title_size": (str,),
"type": (TopologyMapWidgetDefinitionType,),
}
attribute_map = {
"custom_links": "custom_links",
"requests": "requests",
"title": "title",
"title_align": "title_align",
"title_size": "title_size",
"type": "type",
}
def __init__(
self_,
requests: List[TopologyRequest],
type: TopologyMapWidgetDefinitionType,
custom_links: Union[List[WidgetCustomLink], UnsetType] = unset,
title: Union[str, UnsetType] = unset,
title_align: Union[WidgetTextAlign, UnsetType] = unset,
title_size: Union[str, UnsetType] = unset,
**kwargs,
):
"""
This widget displays a topology of nodes and edges for different data sources. It replaces the service map widget.
:param custom_links: List of custom links.
:type custom_links: [WidgetCustomLink], optional
:param requests: One Topology request.
:type requests: [TopologyRequest]
:param title: Title of your widget.
:type title: str, optional
:param title_align: How to align the text on the widget.
:type title_align: WidgetTextAlign, optional
:param title_size: Size of the title.
:type title_size: str, optional
:param type: Type of the topology map widget.
:type type: TopologyMapWidgetDefinitionType
"""
if custom_links is not unset:
kwargs["custom_links"] = custom_links
if title is not unset:
kwargs["title"] = title
if title_align is not unset:
kwargs["title_align"] = title_align
if title_size is not unset:
kwargs["title_size"] = title_size
super().__init__(kwargs)
self_.requests = requests
self_.type = type