Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33935,6 +33935,21 @@ components:
format: int64
type: integer
type: object
DeviceTagsBySource:
description: Tags associated with a device from a specific source.
properties:
source:
description: The source of the tags.
example: user
type: string
tags:
description: The list of tags for the source.
example: ["tag:test", "tag:testbis"]
items:
description: A tag string in `key:value` format.
type: string
type: array
type: object
DevicesListData:
description: The devices list data
properties:
Expand Down Expand Up @@ -63468,6 +63483,12 @@ components:
ListTagsResponseDataAttributes:
description: The definition of ListTagsResponseDataAttributes object.
properties:
by_source:
description: The list of device tags grouped by source.
items:
$ref: "#/components/schemas/DeviceTagsBySource"
readOnly: true
type: array
tags:
description: The list of tags
example: ["tag:test", "tag:testbis"]
Expand Down Expand Up @@ -173995,6 +174016,20 @@ paths:
content:
application/json:
examples:
by_source:
value:
data:
attributes:
by_source:
- source: user
tags:
- "tag:test"
- "tag:testbis"
- source: snmp
tags:
- "device_ip:1.2.3.4"
id: foiwf7rgw38fh
type: tags
default:
value:
data:
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13129,6 +13129,13 @@ datadog\_api\_client.v2.model.device\_attributes\_interface\_statuses module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.device\_tags\_by\_source module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.device_tags_by_source
:members:
:show-inheritance:

datadog\_api\_client.v2.model.devices\_list\_data module
--------------------------------------------------------

Expand Down
43 changes: 43 additions & 0 deletions src/datadog_api_client/v2/model/device_tags_by_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class DeviceTagsBySource(ModelNormal):
@cached_property
def openapi_types(_):
return {
"source": (str,),
"tags": ([str],),
}

attribute_map = {
"source": "source",
"tags": "tags",
}

def __init__(self_, source: Union[str, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, **kwargs):
"""
Tags associated with a device from a specific source.

:param source: The source of the tags.
:type source: str, optional

:param tags: The list of tags for the source.
:type tags: [str], optional
"""
if source is not unset:
kwargs["source"] = source
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -13,24 +13,45 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.device_tags_by_source import DeviceTagsBySource


class ListTagsResponseDataAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.device_tags_by_source import DeviceTagsBySource

return {
"by_source": ([DeviceTagsBySource],),
"tags": ([str],),
}

attribute_map = {
"by_source": "by_source",
"tags": "tags",
}
read_only_vars = {
"by_source",
}

def __init__(self_, tags: Union[List[str], UnsetType] = unset, **kwargs):
def __init__(
self_,
by_source: Union[List[DeviceTagsBySource], UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
The definition of ListTagsResponseDataAttributes object.

:param by_source: The list of device tags grouped by source.
:type by_source: [DeviceTagsBySource], optional

:param tags: The list of tags
:type tags: [str], optional
"""
if by_source is not unset:
kwargs["by_source"] = by_source
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2595,6 +2595,7 @@
from datadog_api_client.v2.model.detailed_finding_type import DetailedFindingType
from datadog_api_client.v2.model.device_attributes import DeviceAttributes
from datadog_api_client.v2.model.device_attributes_interface_statuses import DeviceAttributesInterfaceStatuses
from datadog_api_client.v2.model.device_tags_by_source import DeviceTagsBySource
from datadog_api_client.v2.model.devices_list_data import DevicesListData
from datadog_api_client.v2.model.dns_metric_key import DnsMetricKey
from datadog_api_client.v2.model.domain_allowlist import DomainAllowlist
Expand Down Expand Up @@ -12874,6 +12875,7 @@
"DetailedFindingType",
"DeviceAttributes",
"DeviceAttributesInterfaceStatuses",
"DeviceTagsBySource",
"DevicesListData",
"DnsMetricKey",
"DomainAllowlist",
Expand Down
Loading