diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e6d194c159..8649d25b16 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -34926,6 +34926,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: @@ -65303,6 +65318,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"] @@ -180091,6 +180112,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: diff --git a/src/datadog_api_client/v2/model/device_tags_by_source.py b/src/datadog_api_client/v2/model/device_tags_by_source.py new file mode 100644 index 0000000000..e0ada7a5c5 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_tags_by_source.py @@ -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) diff --git a/src/datadog_api_client/v2/model/list_tags_response_data_attributes.py b/src/datadog_api_client/v2/model/list_tags_response_data_attributes.py index 35c7e3b578..4f518fe8f9 100644 --- a/src/datadog_api_client/v2/model/list_tags_response_data_attributes.py +++ b/src/datadog_api_client/v2/model/list_tags_response_data_attributes.py @@ -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, @@ -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) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index d203176eda..264267cb47 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2639,6 +2639,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 @@ -13335,6 +13336,7 @@ "DetailedFindingType", "DeviceAttributes", "DeviceAttributesInterfaceStatuses", + "DeviceTagsBySource", "DevicesListData", "DnsMetricKey", "DomainAllowlist",