|
| 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 List, Union, TYPE_CHECKING |
| 7 | + |
| 8 | +from datadog_api_client.model_utils import ( |
| 9 | + ModelNormal, |
| 10 | + cached_property, |
| 11 | + unset, |
| 12 | + UnsetType, |
| 13 | +) |
| 14 | + |
| 15 | + |
| 16 | +if TYPE_CHECKING: |
| 17 | + from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink |
| 18 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_overlay import CloudcraftWidgetDefinitionOverlay |
| 19 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_projection import CloudcraftWidgetDefinitionProjection |
| 20 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_provider import CloudcraftWidgetDefinitionProvider |
| 21 | + from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign |
| 22 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_type import CloudcraftWidgetDefinitionType |
| 23 | + |
| 24 | + |
| 25 | +class CloudcraftWidgetDefinition(ModelNormal): |
| 26 | + @cached_property |
| 27 | + def openapi_types(_): |
| 28 | + from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink |
| 29 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_overlay import CloudcraftWidgetDefinitionOverlay |
| 30 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_projection import ( |
| 31 | + CloudcraftWidgetDefinitionProjection, |
| 32 | + ) |
| 33 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_provider import CloudcraftWidgetDefinitionProvider |
| 34 | + from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign |
| 35 | + from datadog_api_client.v1.model.cloudcraft_widget_definition_type import CloudcraftWidgetDefinitionType |
| 36 | + |
| 37 | + return { |
| 38 | + "custom_links": ([WidgetCustomLink],), |
| 39 | + "description": (str,), |
| 40 | + "group_by": ([str],), |
| 41 | + "highlighted": (str,), |
| 42 | + "overlay": (CloudcraftWidgetDefinitionOverlay,), |
| 43 | + "overlay_filter": (str,), |
| 44 | + "projection": (CloudcraftWidgetDefinitionProjection,), |
| 45 | + "provider": (CloudcraftWidgetDefinitionProvider,), |
| 46 | + "query_string": (str,), |
| 47 | + "show_empty_groups": (bool,), |
| 48 | + "title": (str,), |
| 49 | + "title_align": (WidgetTextAlign,), |
| 50 | + "title_size": (str,), |
| 51 | + "type": (CloudcraftWidgetDefinitionType,), |
| 52 | + } |
| 53 | + |
| 54 | + attribute_map = { |
| 55 | + "custom_links": "custom_links", |
| 56 | + "description": "description", |
| 57 | + "group_by": "group_by", |
| 58 | + "highlighted": "highlighted", |
| 59 | + "overlay": "overlay", |
| 60 | + "overlay_filter": "overlay_filter", |
| 61 | + "projection": "projection", |
| 62 | + "provider": "provider", |
| 63 | + "query_string": "query_string", |
| 64 | + "show_empty_groups": "show_empty_groups", |
| 65 | + "title": "title", |
| 66 | + "title_align": "title_align", |
| 67 | + "title_size": "title_size", |
| 68 | + "type": "type", |
| 69 | + } |
| 70 | + |
| 71 | + def __init__( |
| 72 | + self_, |
| 73 | + group_by: List[str], |
| 74 | + highlighted: str, |
| 75 | + overlay: CloudcraftWidgetDefinitionOverlay, |
| 76 | + overlay_filter: str, |
| 77 | + projection: CloudcraftWidgetDefinitionProjection, |
| 78 | + provider: CloudcraftWidgetDefinitionProvider, |
| 79 | + query_string: str, |
| 80 | + show_empty_groups: bool, |
| 81 | + type: CloudcraftWidgetDefinitionType, |
| 82 | + custom_links: Union[List[WidgetCustomLink], UnsetType] = unset, |
| 83 | + description: Union[str, UnsetType] = unset, |
| 84 | + title: Union[str, UnsetType] = unset, |
| 85 | + title_align: Union[WidgetTextAlign, UnsetType] = unset, |
| 86 | + title_size: Union[str, UnsetType] = unset, |
| 87 | + **kwargs, |
| 88 | + ): |
| 89 | + """ |
| 90 | + This widget displays a Cloudcraft topology of cloud resources for the selected provider. |
| 91 | +
|
| 92 | + :param custom_links: List of custom links. |
| 93 | + :type custom_links: [WidgetCustomLink], optional |
| 94 | +
|
| 95 | + :param description: The description of the widget. |
| 96 | + :type description: str, optional |
| 97 | +
|
| 98 | + :param group_by: List of tags or attributes used to group the cloud resources in the widget. |
| 99 | + :type group_by: [str] |
| 100 | +
|
| 101 | + :param highlighted: Search query that visually highlights matching resources in the diagram. |
| 102 | + :type highlighted: str |
| 103 | +
|
| 104 | + :param overlay: Overlay applied on top of the Cloudcraft topology. |
| 105 | + :type overlay: CloudcraftWidgetDefinitionOverlay |
| 106 | +
|
| 107 | + :param overlay_filter: Filter applied to the selected overlay. |
| 108 | + :type overlay_filter: str |
| 109 | +
|
| 110 | + :param projection: Projection used to render the Cloudcraft topology. |
| 111 | + :type projection: CloudcraftWidgetDefinitionProjection |
| 112 | +
|
| 113 | + :param provider: Cloud provider for the Cloudcraft widget. |
| 114 | + :type provider: CloudcraftWidgetDefinitionProvider |
| 115 | +
|
| 116 | + :param query_string: Query string used to filter the cloud resources displayed in the widget. |
| 117 | + :type query_string: str |
| 118 | +
|
| 119 | + :param show_empty_groups: Whether to show empty outline groups in the diagram. |
| 120 | + :type show_empty_groups: bool |
| 121 | +
|
| 122 | + :param title: Title of your widget. |
| 123 | + :type title: str, optional |
| 124 | +
|
| 125 | + :param title_align: How to align the text on the widget. |
| 126 | + :type title_align: WidgetTextAlign, optional |
| 127 | +
|
| 128 | + :param title_size: Size of the title. |
| 129 | + :type title_size: str, optional |
| 130 | +
|
| 131 | + :param type: Type of the Cloudcraft widget. |
| 132 | + :type type: CloudcraftWidgetDefinitionType |
| 133 | + """ |
| 134 | + if custom_links is not unset: |
| 135 | + kwargs["custom_links"] = custom_links |
| 136 | + if description is not unset: |
| 137 | + kwargs["description"] = description |
| 138 | + if title is not unset: |
| 139 | + kwargs["title"] = title |
| 140 | + if title_align is not unset: |
| 141 | + kwargs["title_align"] = title_align |
| 142 | + if title_size is not unset: |
| 143 | + kwargs["title_size"] = title_size |
| 144 | + super().__init__(kwargs) |
| 145 | + |
| 146 | + self_.group_by = group_by |
| 147 | + self_.highlighted = highlighted |
| 148 | + self_.overlay = overlay |
| 149 | + self_.overlay_filter = overlay_filter |
| 150 | + self_.projection = projection |
| 151 | + self_.provider = provider |
| 152 | + self_.query_string = query_string |
| 153 | + self_.show_empty_groups = show_empty_groups |
| 154 | + self_.type = type |
0 commit comments