-
Notifications
You must be signed in to change notification settings - Fork 49
Add Get Tag Cardinalities Endpoint Spec #2644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"spec_repo_commit": "20279f4", | ||
"generated": "2025-07-18 10:23:04.096" | ||
"spec_repo_commit": "dc49df4", | ||
"generated": "2025-07-18 13:57:41.438" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Get tag key cardinality details returns "Success" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.metrics_api import MetricsApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = MetricsApi(api_client) | ||
response = api_instance.get_metric_tag_cardinality_details( | ||
metric_name="metric_name", | ||
) | ||
|
||
print(response) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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 Union | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
class MetricTagCardinalitiesMeta(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
return { | ||
"metric_name": (str,), | ||
} | ||
|
||
attribute_map = { | ||
"metric_name": "metric_name", | ||
} | ||
|
||
def __init__(self_, metric_name: Union[str, UnsetType] = unset, **kwargs): | ||
""" | ||
Response metadata object. | ||
|
||
:param metric_name: The name of metric for which the tag cardinalities are returned. | ||
This matches the metric name provided in the request. | ||
:type metric_name: str, optional | ||
""" | ||
if metric_name is not unset: | ||
kwargs["metric_name"] = metric_name | ||
super().__init__(kwargs) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||
# 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, TYPE_CHECKING | ||||||
|
||||||
from datadog_api_client.model_utils import ( | ||||||
ModelNormal, | ||||||
cached_property, | ||||||
unset, | ||||||
UnsetType, | ||||||
) | ||||||
|
||||||
|
||||||
if TYPE_CHECKING: | ||||||
from datadog_api_client.v2.model.metric_tag_cardinality import MetricTagCardinality | ||||||
from datadog_api_client.v2.model.metric_tag_cardinalities_meta import MetricTagCardinalitiesMeta | ||||||
|
||||||
|
||||||
class MetricTagCardinalitiesResponse(ModelNormal): | ||||||
@cached_property | ||||||
def openapi_types(_): | ||||||
from datadog_api_client.v2.model.metric_tag_cardinality import MetricTagCardinality | ||||||
from datadog_api_client.v2.model.metric_tag_cardinalities_meta import MetricTagCardinalitiesMeta | ||||||
|
||||||
return { | ||||||
"data": ([MetricTagCardinality],), | ||||||
"meta": (MetricTagCardinalitiesMeta,), | ||||||
} | ||||||
|
||||||
attribute_map = { | ||||||
"data": "data", | ||||||
"meta": "meta", | ||||||
} | ||||||
|
||||||
def __init__( | ||||||
self_, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Code Quality Violation
Suggested change
first parameter of a class function should be self (...read more)In a class method (that is not a class method nor a static method), the first argument must be Learn More |
||||||
data: Union[List[MetricTagCardinality], UnsetType] = unset, | ||||||
meta: Union[MetricTagCardinalitiesMeta, UnsetType] = unset, | ||||||
**kwargs, | ||||||
): | ||||||
""" | ||||||
Response object that includes an array of objects representing the cardinality details of a metric's tags. | ||||||
|
||||||
:param data: A list of tag cardinalities associated with the given metric. | ||||||
:type data: [MetricTagCardinality], optional | ||||||
|
||||||
:param meta: Response metadata object. | ||||||
:type meta: MetricTagCardinalitiesMeta, optional | ||||||
""" | ||||||
if data is not unset: | ||||||
kwargs["data"] = data | ||||||
if meta is not unset: | ||||||
kwargs["meta"] = meta | ||||||
super().__init__(kwargs) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,62 @@ | ||||||
# 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 Union, TYPE_CHECKING | ||||||
|
||||||
from datadog_api_client.model_utils import ( | ||||||
ModelNormal, | ||||||
cached_property, | ||||||
unset, | ||||||
UnsetType, | ||||||
) | ||||||
|
||||||
|
||||||
if TYPE_CHECKING: | ||||||
from datadog_api_client.v2.model.metric_tag_cardinality_attributes import MetricTagCardinalityAttributes | ||||||
|
||||||
|
||||||
class MetricTagCardinality(ModelNormal): | ||||||
@cached_property | ||||||
def openapi_types(_): | ||||||
from datadog_api_client.v2.model.metric_tag_cardinality_attributes import MetricTagCardinalityAttributes | ||||||
|
||||||
return { | ||||||
"attributes": (MetricTagCardinalityAttributes,), | ||||||
"id": (str,), | ||||||
"type": (str,), | ||||||
} | ||||||
|
||||||
attribute_map = { | ||||||
"attributes": "attributes", | ||||||
"id": "id", | ||||||
"type": "type", | ||||||
} | ||||||
|
||||||
def __init__( | ||||||
self_, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Code Quality Violation
Suggested change
first parameter of a class function should be self (...read more)In a class method (that is not a class method nor a static method), the first argument must be Learn More |
||||||
attributes: Union[MetricTagCardinalityAttributes, UnsetType] = unset, | ||||||
id: Union[str, UnsetType] = unset, | ||||||
type: Union[str, UnsetType] = unset, | ||||||
**kwargs, | ||||||
): | ||||||
""" | ||||||
Object containing metadata and attributes related to a specific tag key associated with the metric. | ||||||
|
||||||
:param attributes: An object containing properties related to the tag key | ||||||
:type attributes: MetricTagCardinalityAttributes, optional | ||||||
|
||||||
:param id: The name of the tag key. | ||||||
:type id: str, optional | ||||||
|
||||||
:param type: This describes the endpoint action. | ||||||
:type type: str, optional | ||||||
""" | ||||||
if attributes is not unset: | ||||||
kwargs["attributes"] = attributes | ||||||
if id is not unset: | ||||||
kwargs["id"] = id | ||||||
if type is not unset: | ||||||
kwargs["type"] = type | ||||||
super().__init__(kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Code Quality Violation
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be
self
by convention.Learn More