|
| 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 | + "resource_key": (str,), |
| 31 | + "resource_type": (MonitorAssetResourceType,), |
| 32 | + "url": (str,), |
| 33 | + } |
| 34 | + |
| 35 | + attribute_map = { |
| 36 | + "category": "category", |
| 37 | + "name": "name", |
| 38 | + "resource_key": "resource_key", |
| 39 | + "resource_type": "resource_type", |
| 40 | + "url": "url", |
| 41 | + } |
| 42 | + |
| 43 | + def __init__( |
| 44 | + self_, |
| 45 | + category: MonitorAssetCategory, |
| 46 | + name: str, |
| 47 | + url: str, |
| 48 | + resource_key: Union[str, UnsetType] = unset, |
| 49 | + resource_type: Union[MonitorAssetResourceType, UnsetType] = unset, |
| 50 | + **kwargs, |
| 51 | + ): |
| 52 | + """ |
| 53 | + Represents key links tied to a monitor to help users take action on alerts. |
| 54 | + This feature is in Preview and only available to users with the feature enabled. |
| 55 | +
|
| 56 | + :param category: Indicates the type of asset this entity represents on a monitor. |
| 57 | + :type category: MonitorAssetCategory |
| 58 | +
|
| 59 | + :param name: Name for the monitor asset |
| 60 | + :type name: str |
| 61 | +
|
| 62 | + :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. |
| 63 | + :type resource_key: str, optional |
| 64 | +
|
| 65 | + :param resource_type: Type of internal Datadog resource associated with a monitor asset. |
| 66 | + :type resource_type: MonitorAssetResourceType, optional |
| 67 | +
|
| 68 | + :param url: URL link for the asset. For links with an internal resource type set, this should be the relative path to where the Datadog domain is appended internally. For external links, this should be the full URL path. |
| 69 | + :type url: str |
| 70 | + """ |
| 71 | + if resource_key is not unset: |
| 72 | + kwargs["resource_key"] = resource_key |
| 73 | + if resource_type is not unset: |
| 74 | + kwargs["resource_type"] = resource_type |
| 75 | + super().__init__(kwargs) |
| 76 | + |
| 77 | + self_.category = category |
| 78 | + self_.name = name |
| 79 | + self_.url = url |
0 commit comments