From eb230d1b81190132252bef476b407744c3ef1a16 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 22 May 2026 15:42:08 +0000 Subject: [PATCH] Regenerate client from commit 6844f14 of spec repo --- .generator/schemas/v1/openapi.yaml | 86 +++++++++++++++++++ docs/datadog_api_client.v1.model.rst | 42 +++++++++ .../v1/model/comparison_custom_timeframe.py | 39 +++++++++ .../v1/model/comparison_duration.py | 56 ++++++++++++ .../v1/model/comparison_duration_type.py | 47 ++++++++++ .../v1/model/query_value_widget_comparison.py | 70 +++++++++++++++ ..._value_widget_comparison_directionality.py | 41 +++++++++ .../query_value_widget_comparison_type.py | 41 +++++++++ .../v1/model/query_value_widget_request.py | 10 +++ src/datadog_api_client/v1/models/__init__.py | 14 +++ 10 files changed, 446 insertions(+) create mode 100644 src/datadog_api_client/v1/model/comparison_custom_timeframe.py create mode 100644 src/datadog_api_client/v1/model/comparison_duration.py create mode 100644 src/datadog_api_client/v1/model/comparison_duration_type.py create mode 100644 src/datadog_api_client/v1/model/query_value_widget_comparison.py create mode 100644 src/datadog_api_client/v1/model/query_value_widget_comparison_directionality.py create mode 100644 src/datadog_api_client/v1/model/query_value_widget_comparison_type.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 51fe22bcea..6f46d5d6f9 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1345,6 +1345,50 @@ components: type: string x-enum-varnames: - COHORT + ComparisonCustomTimeframe: + description: Fixed time range for a `custom_timeframe` comparison. + properties: + from: + description: Start time in milliseconds since epoch. + example: 1779290190000 + format: int64 + type: integer + to: + description: End time in milliseconds since epoch. + example: 1779894990000 + format: int64 + type: integer + required: + - from + - to + type: object + ComparisonDuration: + description: The comparison period. Use a preset `type` value or set `type` to `custom_timeframe` and provide `custom_timeframe` with explicit Unix timestamp bounds. + properties: + custom_timeframe: + $ref: "#/components/schemas/ComparisonCustomTimeframe" + description: Required when `type` is `custom_timeframe`. Fixed time range to compare against. + type: + $ref: "#/components/schemas/ComparisonDurationType" + required: + - type + type: object + ComparisonDurationType: + description: "Comparison window: `previous_timeframe` (same-length window immediately before current), `previous_day`, `previous_week`, `previous_month`, or `custom_timeframe` (set this to enable the `custom_timeframe` field)." + enum: + - previous_timeframe + - custom_timeframe + - previous_day + - previous_week + - previous_month + example: previous_timeframe + type: string + x-enum-varnames: + - PREVIOUS_TIMEFRAME + - CUSTOM_TIMEFRAME + - PREVIOUS_DAY + - PREVIOUS_WEEK + - PREVIOUS_MONTH ContentEncoding: description: HTTP header used to compress the media-type. enum: @@ -12028,6 +12072,45 @@ components: x-enum-varnames: - ASC - DESC + QueryValueWidgetComparison: + description: A change indicator that compares the current value to a historical period. + properties: + directionality: + $ref: "#/components/schemas/QueryValueWidgetComparisonDirectionality" + description: Which direction of change is considered an improvement, determining the indicator color. + duration: + $ref: "#/components/schemas/ComparisonDuration" + description: The historical period to compare the current value against. + type: + $ref: "#/components/schemas/QueryValueWidgetComparisonType" + description: "How the delta is shown: as an absolute difference, a percentage, or both." + required: + - duration + type: object + QueryValueWidgetComparisonDirectionality: + default: neutral + description: "Color-coding direction: `increase_better` (green on rise), `decrease_better` (green on drop), or `neutral` (no color)." + enum: + - increase_better + - decrease_better + - neutral + type: string + x-enum-varnames: + - INCREASE_BETTER + - DECREASE_BETTER + - NEUTRAL + QueryValueWidgetComparisonType: + default: absolute + description: "How the delta is expressed: `absolute` (raw difference), `relative` (percentage), or `both`." + enum: + - absolute + - relative + - both + type: string + x-enum-varnames: + - ABSOLUTE + - RELATIVE + - BOTH QueryValueWidgetDefinition: description: Query values display the current value of a given metric, APM, or log query. properties: @@ -12099,6 +12182,9 @@ components: $ref: "#/components/schemas/LogQueryDefinition" deprecated: true description: Deprecated - Use `queries` and `formulas` instead. + comparison: + $ref: "#/components/schemas/QueryValueWidgetComparison" + description: Displays a change indicator showing a delta against a historical baseline. conditional_formats: description: List of conditional formats. items: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 06aa46270c..2a5028de22 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -501,6 +501,27 @@ datadog\_api\_client.v1.model.cohort\_widget\_definition\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.comparison\_custom\_timeframe module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.comparison_custom_timeframe + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.comparison\_duration module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.comparison_duration + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.comparison\_duration\_type module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.comparison_duration_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.content\_encoding module ------------------------------------------------------ @@ -3721,6 +3742,27 @@ datadog\_api\_client.v1.model.query\_sort\_order module :members: :show-inheritance: +datadog\_api\_client.v1.model.query\_value\_widget\_comparison module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.query_value_widget_comparison + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.query\_value\_widget\_comparison\_directionality module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.query_value_widget_comparison_directionality + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.query\_value\_widget\_comparison\_type module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.query_value_widget_comparison_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.query\_value\_widget\_definition module --------------------------------------------------------------------- diff --git a/src/datadog_api_client/v1/model/comparison_custom_timeframe.py b/src/datadog_api_client/v1/model/comparison_custom_timeframe.py new file mode 100644 index 0000000000..7e7e113cbe --- /dev/null +++ b/src/datadog_api_client/v1/model/comparison_custom_timeframe.py @@ -0,0 +1,39 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class ComparisonCustomTimeframe(ModelNormal): + @cached_property + def openapi_types(_): + return { + "_from": (int,), + "to": (int,), + } + + attribute_map = { + "_from": "from", + "to": "to", + } + + def __init__(self_, _from: int, to: int, **kwargs): + """ + Fixed time range for a ``custom_timeframe`` comparison. + + :param _from: Start time in milliseconds since epoch. + :type _from: int + + :param to: End time in milliseconds since epoch. + :type to: int + """ + super().__init__(kwargs) + + self_._from = _from + self_.to = to diff --git a/src/datadog_api_client/v1/model/comparison_duration.py b/src/datadog_api_client/v1/model/comparison_duration.py new file mode 100644 index 0000000000..4fdf09f47f --- /dev/null +++ b/src/datadog_api_client/v1/model/comparison_duration.py @@ -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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.comparison_custom_timeframe import ComparisonCustomTimeframe + from datadog_api_client.v1.model.comparison_duration_type import ComparisonDurationType + + +class ComparisonDuration(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.comparison_custom_timeframe import ComparisonCustomTimeframe + from datadog_api_client.v1.model.comparison_duration_type import ComparisonDurationType + + return { + "custom_timeframe": (ComparisonCustomTimeframe,), + "type": (ComparisonDurationType,), + } + + attribute_map = { + "custom_timeframe": "custom_timeframe", + "type": "type", + } + + def __init__( + self_, + type: ComparisonDurationType, + custom_timeframe: Union[ComparisonCustomTimeframe, UnsetType] = unset, + **kwargs, + ): + """ + The comparison period. Use a preset ``type`` value or set ``type`` to ``custom_timeframe`` and provide ``custom_timeframe`` with explicit Unix timestamp bounds. + + :param custom_timeframe: Fixed time range for a ``custom_timeframe`` comparison. + :type custom_timeframe: ComparisonCustomTimeframe, optional + + :param type: Comparison window: ``previous_timeframe`` (same-length window immediately before current), ``previous_day`` , ``previous_week`` , ``previous_month`` , or ``custom_timeframe`` (set this to enable the ``custom_timeframe`` field). + :type type: ComparisonDurationType + """ + if custom_timeframe is not unset: + kwargs["custom_timeframe"] = custom_timeframe + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v1/model/comparison_duration_type.py b/src/datadog_api_client/v1/model/comparison_duration_type.py new file mode 100644 index 0000000000..b21c527f6b --- /dev/null +++ b/src/datadog_api_client/v1/model/comparison_duration_type.py @@ -0,0 +1,47 @@ +# 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 ComparisonDurationType(ModelSimple): + """ + Comparison window: `previous_timeframe` (same-length window immediately before current), `previous_day`, `previous_week`, `previous_month`, or `custom_timeframe` (set this to enable the `custom_timeframe` field). + + :param value: Must be one of ["previous_timeframe", "custom_timeframe", "previous_day", "previous_week", "previous_month"]. + :type value: str + """ + + allowed_values = { + "previous_timeframe", + "custom_timeframe", + "previous_day", + "previous_week", + "previous_month", + } + PREVIOUS_TIMEFRAME: ClassVar["ComparisonDurationType"] + CUSTOM_TIMEFRAME: ClassVar["ComparisonDurationType"] + PREVIOUS_DAY: ClassVar["ComparisonDurationType"] + PREVIOUS_WEEK: ClassVar["ComparisonDurationType"] + PREVIOUS_MONTH: ClassVar["ComparisonDurationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ComparisonDurationType.PREVIOUS_TIMEFRAME = ComparisonDurationType("previous_timeframe") +ComparisonDurationType.CUSTOM_TIMEFRAME = ComparisonDurationType("custom_timeframe") +ComparisonDurationType.PREVIOUS_DAY = ComparisonDurationType("previous_day") +ComparisonDurationType.PREVIOUS_WEEK = ComparisonDurationType("previous_week") +ComparisonDurationType.PREVIOUS_MONTH = ComparisonDurationType("previous_month") diff --git a/src/datadog_api_client/v1/model/query_value_widget_comparison.py b/src/datadog_api_client/v1/model/query_value_widget_comparison.py new file mode 100644 index 0000000000..f1e0479b6d --- /dev/null +++ b/src/datadog_api_client/v1/model/query_value_widget_comparison.py @@ -0,0 +1,70 @@ +# 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.v1.model.query_value_widget_comparison_directionality import ( + QueryValueWidgetComparisonDirectionality, + ) + from datadog_api_client.v1.model.comparison_duration import ComparisonDuration + from datadog_api_client.v1.model.query_value_widget_comparison_type import QueryValueWidgetComparisonType + + +class QueryValueWidgetComparison(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.query_value_widget_comparison_directionality import ( + QueryValueWidgetComparisonDirectionality, + ) + from datadog_api_client.v1.model.comparison_duration import ComparisonDuration + from datadog_api_client.v1.model.query_value_widget_comparison_type import QueryValueWidgetComparisonType + + return { + "directionality": (QueryValueWidgetComparisonDirectionality,), + "duration": (ComparisonDuration,), + "type": (QueryValueWidgetComparisonType,), + } + + attribute_map = { + "directionality": "directionality", + "duration": "duration", + "type": "type", + } + + def __init__( + self_, + duration: ComparisonDuration, + directionality: Union[QueryValueWidgetComparisonDirectionality, UnsetType] = unset, + type: Union[QueryValueWidgetComparisonType, UnsetType] = unset, + **kwargs, + ): + """ + A change indicator that compares the current value to a historical period. + + :param directionality: Color-coding direction: ``increase_better`` (green on rise), ``decrease_better`` (green on drop), or ``neutral`` (no color). + :type directionality: QueryValueWidgetComparisonDirectionality, optional + + :param duration: The comparison period. Use a preset ``type`` value or set ``type`` to ``custom_timeframe`` and provide ``custom_timeframe`` with explicit Unix timestamp bounds. + :type duration: ComparisonDuration + + :param type: How the delta is expressed: ``absolute`` (raw difference), ``relative`` (percentage), or ``both``. + :type type: QueryValueWidgetComparisonType, optional + """ + if directionality is not unset: + kwargs["directionality"] = directionality + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) + + self_.duration = duration diff --git a/src/datadog_api_client/v1/model/query_value_widget_comparison_directionality.py b/src/datadog_api_client/v1/model/query_value_widget_comparison_directionality.py new file mode 100644 index 0000000000..19861246ff --- /dev/null +++ b/src/datadog_api_client/v1/model/query_value_widget_comparison_directionality.py @@ -0,0 +1,41 @@ +# 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 QueryValueWidgetComparisonDirectionality(ModelSimple): + """ + Color-coding direction: `increase_better` (green on rise), `decrease_better` (green on drop), or `neutral` (no color). + + :param value: If omitted defaults to "neutral". Must be one of ["increase_better", "decrease_better", "neutral"]. + :type value: str + """ + + allowed_values = { + "increase_better", + "decrease_better", + "neutral", + } + INCREASE_BETTER: ClassVar["QueryValueWidgetComparisonDirectionality"] + DECREASE_BETTER: ClassVar["QueryValueWidgetComparisonDirectionality"] + NEUTRAL: ClassVar["QueryValueWidgetComparisonDirectionality"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +QueryValueWidgetComparisonDirectionality.INCREASE_BETTER = QueryValueWidgetComparisonDirectionality("increase_better") +QueryValueWidgetComparisonDirectionality.DECREASE_BETTER = QueryValueWidgetComparisonDirectionality("decrease_better") +QueryValueWidgetComparisonDirectionality.NEUTRAL = QueryValueWidgetComparisonDirectionality("neutral") diff --git a/src/datadog_api_client/v1/model/query_value_widget_comparison_type.py b/src/datadog_api_client/v1/model/query_value_widget_comparison_type.py new file mode 100644 index 0000000000..af5b162e0e --- /dev/null +++ b/src/datadog_api_client/v1/model/query_value_widget_comparison_type.py @@ -0,0 +1,41 @@ +# 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 QueryValueWidgetComparisonType(ModelSimple): + """ + How the delta is expressed: `absolute` (raw difference), `relative` (percentage), or `both`. + + :param value: If omitted defaults to "absolute". Must be one of ["absolute", "relative", "both"]. + :type value: str + """ + + allowed_values = { + "absolute", + "relative", + "both", + } + ABSOLUTE: ClassVar["QueryValueWidgetComparisonType"] + RELATIVE: ClassVar["QueryValueWidgetComparisonType"] + BOTH: ClassVar["QueryValueWidgetComparisonType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +QueryValueWidgetComparisonType.ABSOLUTE = QueryValueWidgetComparisonType("absolute") +QueryValueWidgetComparisonType.RELATIVE = QueryValueWidgetComparisonType("relative") +QueryValueWidgetComparisonType.BOTH = QueryValueWidgetComparisonType("both") diff --git a/src/datadog_api_client/v1/model/query_value_widget_request.py b/src/datadog_api_client/v1/model/query_value_widget_request.py index 9a45603bfe..d6b86eff61 100644 --- a/src/datadog_api_client/v1/model/query_value_widget_request.py +++ b/src/datadog_api_client/v1/model/query_value_widget_request.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from datadog_api_client.v1.model.widget_aggregator import WidgetAggregator from datadog_api_client.v1.model.log_query_definition import LogQueryDefinition + from datadog_api_client.v1.model.query_value_widget_comparison import QueryValueWidgetComparison from datadog_api_client.v1.model.widget_conditional_format import WidgetConditionalFormat from datadog_api_client.v1.model.widget_formula import WidgetFormula from datadog_api_client.v1.model.process_query_definition import ProcessQueryDefinition @@ -61,6 +62,7 @@ class QueryValueWidgetRequest(ModelNormal): def openapi_types(_): from datadog_api_client.v1.model.widget_aggregator import WidgetAggregator from datadog_api_client.v1.model.log_query_definition import LogQueryDefinition + from datadog_api_client.v1.model.query_value_widget_comparison import QueryValueWidgetComparison from datadog_api_client.v1.model.widget_conditional_format import WidgetConditionalFormat from datadog_api_client.v1.model.widget_formula import WidgetFormula from datadog_api_client.v1.model.process_query_definition import ProcessQueryDefinition @@ -71,6 +73,7 @@ def openapi_types(_): "aggregator": (WidgetAggregator,), "apm_query": (LogQueryDefinition,), "audit_query": (LogQueryDefinition,), + "comparison": (QueryValueWidgetComparison,), "conditional_formats": ([WidgetConditionalFormat],), "event_query": (LogQueryDefinition,), "formulas": ([WidgetFormula],), @@ -89,6 +92,7 @@ def openapi_types(_): "aggregator": "aggregator", "apm_query": "apm_query", "audit_query": "audit_query", + "comparison": "comparison", "conditional_formats": "conditional_formats", "event_query": "event_query", "formulas": "formulas", @@ -108,6 +112,7 @@ def __init__( aggregator: Union[WidgetAggregator, UnsetType] = unset, apm_query: Union[LogQueryDefinition, UnsetType] = unset, audit_query: Union[LogQueryDefinition, UnsetType] = unset, + comparison: Union[QueryValueWidgetComparison, UnsetType] = unset, conditional_formats: Union[List[WidgetConditionalFormat], UnsetType] = unset, event_query: Union[LogQueryDefinition, UnsetType] = unset, formulas: Union[List[WidgetFormula], UnsetType] = unset, @@ -152,6 +157,9 @@ def __init__( :param audit_query: The log query. :type audit_query: LogQueryDefinition, optional + :param comparison: A change indicator that compares the current value to a historical period. + :type comparison: QueryValueWidgetComparison, optional + :param conditional_formats: List of conditional formats. :type conditional_formats: [WidgetConditionalFormat], optional @@ -194,6 +202,8 @@ def __init__( kwargs["apm_query"] = apm_query if audit_query is not unset: kwargs["audit_query"] = audit_query + if comparison is not unset: + kwargs["comparison"] = comparison if conditional_formats is not unset: kwargs["conditional_formats"] = conditional_formats if event_query is not unset: diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 26d0a7e242..2ac857c57c 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -69,6 +69,9 @@ from datadog_api_client.v1.model.check_status_widget_definition_type import CheckStatusWidgetDefinitionType from datadog_api_client.v1.model.cohort_widget_definition import CohortWidgetDefinition from datadog_api_client.v1.model.cohort_widget_definition_type import CohortWidgetDefinitionType +from datadog_api_client.v1.model.comparison_custom_timeframe import ComparisonCustomTimeframe +from datadog_api_client.v1.model.comparison_duration import ComparisonDuration +from datadog_api_client.v1.model.comparison_duration_type import ComparisonDurationType from datadog_api_client.v1.model.content_encoding import ContentEncoding from datadog_api_client.v1.model.creator import Creator from datadog_api_client.v1.model.dashboard import Dashboard @@ -667,6 +670,11 @@ ProductAnalyticsFunnelWidgetDefinition, ) from datadog_api_client.v1.model.query_sort_order import QuerySortOrder +from datadog_api_client.v1.model.query_value_widget_comparison import QueryValueWidgetComparison +from datadog_api_client.v1.model.query_value_widget_comparison_directionality import ( + QueryValueWidgetComparisonDirectionality, +) +from datadog_api_client.v1.model.query_value_widget_comparison_type import QueryValueWidgetComparisonType from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition from datadog_api_client.v1.model.query_value_widget_definition_type import QueryValueWidgetDefinitionType from datadog_api_client.v1.model.query_value_widget_request import QueryValueWidgetRequest @@ -1436,6 +1444,9 @@ "CheckStatusWidgetDefinitionType", "CohortWidgetDefinition", "CohortWidgetDefinitionType", + "ComparisonCustomTimeframe", + "ComparisonDuration", + "ComparisonDurationType", "ContentEncoding", "Creator", "Dashboard", @@ -1896,6 +1907,9 @@ "ProductAnalyticsFunnelRequestType", "ProductAnalyticsFunnelWidgetDefinition", "QuerySortOrder", + "QueryValueWidgetComparison", + "QueryValueWidgetComparisonDirectionality", + "QueryValueWidgetComparisonType", "QueryValueWidgetDefinition", "QueryValueWidgetDefinitionType", "QueryValueWidgetRequest",