|
| 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 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.monitor_asset_category import MonitorAssetCategory |
| 18 | + from datadog_api_client.v1.model.monitor_asset_resource_type import MonitorAssetResourceType |
| 19 | + |
| 20 | + |
| 21 | +class MonitorAsset(ModelNormal): |
| 22 | + @cached_property |
| 23 | + def openapi_types(_): |
| 24 | + from datadog_api_client.v1.model.monitor_asset_category import MonitorAssetCategory |
| 25 | + from datadog_api_client.v1.model.monitor_asset_resource_type import MonitorAssetResourceType |
| 26 | + |
| 27 | + return { |
| 28 | + "category": (MonitorAssetCategory,), |
| 29 | + "name": (str,), |
| 30 | + "options": (dict,), |
| 31 | + "resource_key": (str,), |
| 32 | + "resource_type": (MonitorAssetResourceType,), |
| 33 | + "template_variables": (dict,), |
| 34 | + "url": (str,), |
| 35 | + } |
| 36 | + |
| 37 | + attribute_map = { |
| 38 | + "category": "category", |
| 39 | + "name": "name", |
| 40 | + "options": "options", |
| 41 | + "resource_key": "resource_key", |
| 42 | + "resource_type": "resource_type", |
| 43 | + "template_variables": "template_variables", |
| 44 | + "url": "url", |
| 45 | + } |
| 46 | + |
| 47 | + def __init__( |
| 48 | + self_, |
| 49 | + category: MonitorAssetCategory, |
| 50 | + name: str, |
| 51 | + url: str, |
| 52 | + options: Union[dict, UnsetType] = unset, |
| 53 | + resource_key: Union[str, UnsetType] = unset, |
| 54 | + resource_type: Union[MonitorAssetResourceType, UnsetType] = unset, |
| 55 | + template_variables: Union[dict, UnsetType] = unset, |
| 56 | + **kwargs, |
| 57 | + ): |
| 58 | + """ |
| 59 | + Represents key links tied to a monitor to help users take action on alerts (Runbooks, Dashboards, Workflows) |
| 60 | + This feature is in Preview and only available to users with the feature enabled. |
| 61 | +
|
| 62 | + :param category: Indicates the type of asset this entity represents on a monitor |
| 63 | + :type category: MonitorAssetCategory |
| 64 | +
|
| 65 | + :param name: Name for the monitor asset |
| 66 | + :type name: str |
| 67 | +
|
| 68 | + :param options: Additional options that you can set on a monitor asset. |
| 69 | + :type options: dict, optional |
| 70 | +
|
| 71 | + :param resource_key: Represents the identifier of the internal datadog resource that this asset represents. IDs in this field should be passed in as strings. |
| 72 | + :type resource_key: str, optional |
| 73 | +
|
| 74 | + :param resource_type: Type of internal datadog resource associated with a monitor asset |
| 75 | + :type resource_type: MonitorAssetResourceType, optional |
| 76 | +
|
| 77 | + :param template_variables: Allows you to parameterize the url for the monitor asset. |
| 78 | + :type template_variables: dict, optional |
| 79 | +
|
| 80 | + :param url: Url link for the asset |
| 81 | + :type url: str |
| 82 | + """ |
| 83 | + if options is not unset: |
| 84 | + kwargs["options"] = options |
| 85 | + if resource_key is not unset: |
| 86 | + kwargs["resource_key"] = resource_key |
| 87 | + if resource_type is not unset: |
| 88 | + kwargs["resource_type"] = resource_type |
| 89 | + if template_variables is not unset: |
| 90 | + kwargs["template_variables"] = template_variables |
| 91 | + super().__init__(kwargs) |
| 92 | + |
| 93 | + self_.category = category |
| 94 | + self_.name = name |
| 95 | + self_.url = url |
0 commit comments