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
48 changes: 40 additions & 8 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61652,6 +61652,26 @@ components:
$ref: "#/components/schemas/MetricAssetResponseIncluded"
type: array
type: object
MetricAvailableAggrFunctions:
description: A single aggregation function used to query a metric.
enum:
- avg
- min
- max
- sum
- count
- stddev
- pxx
example: avg
type: string
x-enum-varnames:
- AVG
- MIN
- MAX
- SUM
- COUNT
- STDDEV
- PXX
MetricBulkConfigureTagsType:
default: metric_bulk_configure_tags
description: The metric bulk configure tags resource.
Expand Down Expand Up @@ -61830,14 +61850,26 @@ components:
MetricCustomAggregations:
description: |-
Deprecated. You no longer need to configure specific time and space aggregations for Metrics Without Limits.
example:
- space: sum
time: sum
- space: sum
time: count
items:
$ref: "#/components/schemas/MetricCustomAggregation"
type: array
oneOf:
- example:
- space: sum
time: sum
- space: sum
time: count
items:
$ref: "#/components/schemas/MetricCustomAggregation"
type: array
- example:
- avg
- min
- max
- sum
- count
- stddev
- pxx
items:
$ref: "#/components/schemas/MetricAvailableAggrFunctions"
type: array
MetricCustomSpaceAggregation:
description: A space aggregation for use in query.
enum:
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 @@ -25344,6 +25344,13 @@ datadog\_api\_client.v2.model.metric\_assets\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_available\_aggr\_functions module
-----------------------------------------------------------------------

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

datadog\_api\_client.v2.model.metric\_bulk\_configure\_tags\_type module
------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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 datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class MetricAvailableAggrFunctions(ModelSimple):
"""
A single aggregation function used to query a metric.

:param value: Must be one of ["avg", "min", "max", "sum", "count", "stddev", "pxx"].
:type value: str
"""

allowed_values = {
"avg",
"min",
"max",
"sum",
"count",
"stddev",
"pxx",
}
AVG: ClassVar["MetricAvailableAggrFunctions"]
MIN: ClassVar["MetricAvailableAggrFunctions"]
MAX: ClassVar["MetricAvailableAggrFunctions"]
SUM: ClassVar["MetricAvailableAggrFunctions"]
COUNT: ClassVar["MetricAvailableAggrFunctions"]
STDDEV: ClassVar["MetricAvailableAggrFunctions"]
PXX: ClassVar["MetricAvailableAggrFunctions"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


MetricAvailableAggrFunctions.AVG = MetricAvailableAggrFunctions("avg")
MetricAvailableAggrFunctions.MIN = MetricAvailableAggrFunctions("min")
MetricAvailableAggrFunctions.MAX = MetricAvailableAggrFunctions("max")
MetricAvailableAggrFunctions.SUM = MetricAvailableAggrFunctions("sum")
MetricAvailableAggrFunctions.COUNT = MetricAvailableAggrFunctions("count")
MetricAvailableAggrFunctions.STDDEV = MetricAvailableAggrFunctions("stddev")
MetricAvailableAggrFunctions.PXX = MetricAvailableAggrFunctions("pxx")
30 changes: 20 additions & 10 deletions src/datadog_api_client/v2/model/metric_custom_aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@


from datadog_api_client.model_utils import (
ModelSimple,
ModelComposed,
cached_property,
)


class MetricCustomAggregations(ModelSimple):
"""
Deprecated. You no longer need to configure specific time and space aggregations for Metrics Without Limits.


:type value: [MetricCustomAggregation]
"""
class MetricCustomAggregations(ModelComposed):
def __init__(self, **kwargs):
"""
Deprecated. You no longer need to configure specific time and space aggregations for Metrics Without Limits.
"""
super().__init__(kwargs)

@cached_property
def openapi_types(_):
def _composed_schemas(_):
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error because the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
from datadog_api_client.v2.model.metric_custom_aggregation import MetricCustomAggregation
from datadog_api_client.v2.model.metric_available_aggr_functions import MetricAvailableAggrFunctions

return {
"value": ([MetricCustomAggregation],),
"oneOf": [
[MetricCustomAggregation],
[MetricAvailableAggrFunctions],
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
if TYPE_CHECKING:
from datadog_api_client.v2.model.metric_custom_aggregations import MetricCustomAggregations
from datadog_api_client.v2.model.metric_tag_configuration_metric_types import MetricTagConfigurationMetricTypes
from datadog_api_client.v2.model.metric_custom_aggregation import MetricCustomAggregation
from datadog_api_client.v2.model.metric_available_aggr_functions import MetricAvailableAggrFunctions


class MetricTagConfigurationAttributes(ModelNormal):
Expand Down Expand Up @@ -47,7 +49,9 @@ def openapi_types(_):

def __init__(
self_,
aggregations: Union[MetricCustomAggregations, UnsetType] = unset,
aggregations: Union[
MetricCustomAggregations, List[MetricCustomAggregation], List[MetricAvailableAggrFunctions], UnsetType
] = unset,
created_at: Union[datetime, UnsetType] = unset,
exclude_tags_mode: Union[bool, UnsetType] = unset,
include_percentiles: Union[bool, UnsetType] = unset,
Expand Down
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 Union, TYPE_CHECKING
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -16,6 +16,8 @@
if TYPE_CHECKING:
from datadog_api_client.v2.model.metric_custom_aggregations import MetricCustomAggregations
from datadog_api_client.v2.model.metric_tag_configuration_metric_types import MetricTagConfigurationMetricTypes
from datadog_api_client.v2.model.metric_custom_aggregation import MetricCustomAggregation
from datadog_api_client.v2.model.metric_available_aggr_functions import MetricAvailableAggrFunctions


class MetricTagConfigurationCreateAttributes(ModelNormal):
Expand Down Expand Up @@ -43,7 +45,9 @@ def openapi_types(_):
def __init__(
self_,
metric_type: MetricTagConfigurationMetricTypes,
aggregations: Union[MetricCustomAggregations, UnsetType] = unset,
aggregations: Union[
MetricCustomAggregations, List[MetricCustomAggregation], List[MetricAvailableAggrFunctions], UnsetType
] = unset,
exclude_tags_mode: Union[bool, UnsetType] = unset,
include_percentiles: Union[bool, UnsetType] = unset,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

if TYPE_CHECKING:
from datadog_api_client.v2.model.metric_custom_aggregations import MetricCustomAggregations
from datadog_api_client.v2.model.metric_custom_aggregation import MetricCustomAggregation
from datadog_api_client.v2.model.metric_available_aggr_functions import MetricAvailableAggrFunctions


class MetricTagConfigurationUpdateAttributes(ModelNormal):
Expand All @@ -38,7 +40,9 @@ def openapi_types(_):

def __init__(
self_,
aggregations: Union[MetricCustomAggregations, UnsetType] = unset,
aggregations: Union[
MetricCustomAggregations, List[MetricCustomAggregation], List[MetricAvailableAggrFunctions], UnsetType
] = unset,
exclude_tags_mode: Union[bool, UnsetType] = unset,
include_percentiles: Union[bool, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
Expand Down
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 @@ -4730,6 +4730,7 @@
from datadog_api_client.v2.model.metric_asset_slo_relationship import MetricAssetSLORelationship
from datadog_api_client.v2.model.metric_asset_slo_relationships import MetricAssetSLORelationships
from datadog_api_client.v2.model.metric_assets_response import MetricAssetsResponse
from datadog_api_client.v2.model.metric_available_aggr_functions import MetricAvailableAggrFunctions
from datadog_api_client.v2.model.metric_bulk_configure_tags_type import MetricBulkConfigureTagsType
from datadog_api_client.v2.model.metric_bulk_tag_config_create import MetricBulkTagConfigCreate
from datadog_api_client.v2.model.metric_bulk_tag_config_create_attributes import MetricBulkTagConfigCreateAttributes
Expand Down Expand Up @@ -13632,6 +13633,7 @@
"MetricAssetSLORelationship",
"MetricAssetSLORelationships",
"MetricAssetsResponse",
"MetricAvailableAggrFunctions",
"MetricBulkConfigureTagsType",
"MetricBulkTagConfigCreate",
"MetricBulkTagConfigCreateAttributes",
Expand Down
Loading