From cb598e5eac56e4f033ed32c806f73c3ab5a756a4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 25 Sep 2026 16:48:25 +0000 Subject: [PATCH] Regenerate client from commit c27beef of spec repo --- .generator/schemas/v2/openapi.yaml | 124 +++++++++++++++++- src/datadog_api_client/v2/api/bits_ai_api.py | 2 +- .../model/general_investigation_attributes.py | 53 ++++++++ ...vestigation_attributes_with_time_bounds.py | 67 ++++++++++ ...tigation_attributes_without_time_bounds.py | 53 ++++++++ .../v2/model/trigger_attributes.py | 43 +++++- .../v2/model/trigger_type.py | 5 +- src/datadog_api_client/v2/models/__init__.py | 10 ++ 8 files changed, 344 insertions(+), 13 deletions(-) create mode 100644 src/datadog_api_client/v2/model/general_investigation_attributes.py create mode 100644 src/datadog_api_client/v2/model/general_investigation_attributes_with_time_bounds.py create mode 100644 src/datadog_api_client/v2/model/general_investigation_attributes_without_time_bounds.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 12847a964d..6cb8857f92 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -46574,6 +46574,81 @@ components: required: - type type: object + GeneralInvestigationAttributes: + description: Attributes for a general investigation, not tied to a specific monitor alert. + oneOf: + - $ref: "#/components/schemas/GeneralInvestigationAttributesWithoutTimeBounds" + - $ref: "#/components/schemas/GeneralInvestigationAttributesWithTimeBounds" + GeneralInvestigationAttributesWithTimeBounds: + additionalProperties: false + description: Attributes for a general investigation with an explicit time window. + properties: + description: + description: A free-form description of what to investigate, up to 4,096 characters. + example: "Checkout latency has been elevated for the past hour." + maxLength: 4096 + type: string + end_time: + description: The end of the investigation window, in Unix milliseconds. + example: 1700003600000 + format: int64 + type: integer + start_time: + description: The start of the investigation window, in Unix milliseconds. + example: 1700000000000 + format: int64 + type: integer + tags: + description: Tags that scope the investigation. + example: + - "service:checkout" + items: + type: string + type: array + required: + - description + - start_time + - end_time + type: object + GeneralInvestigationAttributesWithoutTimeBounds: + additionalProperties: false + description: Attributes for a general investigation without an explicit time window. + properties: + description: + description: A free-form description of what to investigate, up to 4,096 characters. + example: "Checkout latency has been elevated for the past hour." + maxLength: 4096 + type: string + tags: + description: Tags that scope the investigation. + example: + - "service:checkout" + items: + type: string + type: array + required: + - description + type: object + GeneralInvestigationTrigger: + additionalProperties: false + description: A trigger created from a general investigation request. + properties: + general_investigation: + $ref: "#/components/schemas/GeneralInvestigationAttributes" + type: + $ref: "#/components/schemas/GeneralInvestigationTriggerType" + required: + - type + - general_investigation + type: object + GeneralInvestigationTriggerType: + description: The type of general investigation trigger. + enum: + - general_investigation + example: general_investigation + type: string + x-enum-varnames: + - GENERAL_INVESTIGATION GenerateCostTagDescriptionResponse: description: Response wrapping an AI-generated Cloud Cost Management tag key description. example: @@ -72350,6 +72425,18 @@ components: - key - value type: object + MonitorAlertTrigger: + additionalProperties: false + description: A trigger created from a monitor alert. + properties: + monitor_alert_trigger: + $ref: "#/components/schemas/MonitorAlertTriggerAttributes" + type: + $ref: "#/components/schemas/MonitorAlertTriggerType" + required: + - type + - monitor_alert_trigger + type: object MonitorAlertTriggerAttributes: description: Attributes for a monitor alert trigger. properties: @@ -72372,6 +72459,14 @@ components: - event_id - event_ts type: object + MonitorAlertTriggerType: + description: The type of monitor alert trigger. + enum: + - monitor_alert_trigger + example: monitor_alert_trigger + type: string + x-enum-varnames: + - MONITOR_ALERT_TRIGGER MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -124722,15 +124817,23 @@ components: - $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper" - $ref: "#/components/schemas/WorkflowTriggerWrapper" TriggerAttributes: + anyOf: + - $ref: "#/components/schemas/MonitorAlertTrigger" + - $ref: "#/components/schemas/GeneralInvestigationTrigger" description: The trigger definition for starting an investigation. + example: + monitor_alert_trigger: + event_id: "1234567890123456789" + event_ts: 1700000000000 + monitor_id: 12345678 + type: monitor_alert_trigger properties: + general_investigation: + $ref: "#/components/schemas/GeneralInvestigationAttributes" monitor_alert_trigger: $ref: "#/components/schemas/MonitorAlertTriggerAttributes" type: $ref: "#/components/schemas/TriggerType" - required: - - type - - monitor_alert_trigger type: object TriggerInvestigationRequest: description: Request to trigger a new investigation. @@ -124836,10 +124939,12 @@ components: description: The type of trigger for the investigation. enum: - monitor_alert_trigger + - general_investigation example: monitor_alert_trigger type: string x-enum-varnames: - MONITOR_ALERT_TRIGGER + - GENERAL_INVESTIGATION TriggerWorkflowAutomationAction: description: "Triggers a Workflow Automation." properties: @@ -137627,7 +137732,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- - Trigger a new Bits AI investigation based on a monitor alert. + Trigger a Bits AI investigation from a monitor alert or a general investigation. The `monitors_read` permission is required when the trigger type is `monitor_alert_trigger`. operationId: TriggerInvestigation requestBody: @@ -137645,6 +137750,17 @@ paths: monitor_id: 12345678 type: monitor_alert_trigger type: trigger_investigation_request + general_investigation: + value: + data: + attributes: + trigger: + general_investigation: + description: "Checkout latency has been elevated for the past hour." + tags: + - "service:checkout" + type: general_investigation + type: trigger_investigation_request schema: $ref: "#/components/schemas/TriggerInvestigationRequest" description: Trigger investigation request body. diff --git a/src/datadog_api_client/v2/api/bits_ai_api.py b/src/datadog_api_client/v2/api/bits_ai_api.py index b19bbc5825..023bc3f18a 100644 --- a/src/datadog_api_client/v2/api/bits_ai_api.py +++ b/src/datadog_api_client/v2/api/bits_ai_api.py @@ -206,7 +206,7 @@ def trigger_investigation( ) -> TriggerInvestigationResponse: """Trigger a Bits AI investigation. - Trigger a new Bits AI investigation based on a monitor alert. + Trigger a Bits AI investigation from a monitor alert or a general investigation. The ``monitors_read`` permission is required when the trigger type is ``monitor_alert_trigger``. :param body: Trigger investigation request body. diff --git a/src/datadog_api_client/v2/model/general_investigation_attributes.py b/src/datadog_api_client/v2/model/general_investigation_attributes.py new file mode 100644 index 0000000000..c368395891 --- /dev/null +++ b/src/datadog_api_client/v2/model/general_investigation_attributes.py @@ -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 ( + ModelComposed, + cached_property, +) + + +class GeneralInvestigationAttributes(ModelComposed): + def __init__(self, **kwargs): + """ + Attributes for a general investigation, not tied to a specific monitor alert. + + :param description: A free-form description of what to investigate, up to 4,096 characters. + :type description: str + + :param tags: Tags that scope the investigation. + :type tags: [str], optional + + :param end_time: The end of the investigation window, in Unix milliseconds. + :type end_time: int + + :param start_time: The start of the investigation window, in Unix milliseconds. + :type start_time: int + """ + super().__init__(kwargs) + + @cached_property + 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.general_investigation_attributes_without_time_bounds import ( + GeneralInvestigationAttributesWithoutTimeBounds, + ) + from datadog_api_client.v2.model.general_investigation_attributes_with_time_bounds import ( + GeneralInvestigationAttributesWithTimeBounds, + ) + + return { + "oneOf": [ + GeneralInvestigationAttributesWithoutTimeBounds, + GeneralInvestigationAttributesWithTimeBounds, + ], + } diff --git a/src/datadog_api_client/v2/model/general_investigation_attributes_with_time_bounds.py b/src/datadog_api_client/v2/model/general_investigation_attributes_with_time_bounds.py new file mode 100644 index 0000000000..ddb8b92762 --- /dev/null +++ b/src/datadog_api_client/v2/model/general_investigation_attributes_with_time_bounds.py @@ -0,0 +1,67 @@ +# 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 GeneralInvestigationAttributesWithTimeBounds(ModelNormal): + validations = { + "description": { + "max_length": 4096, + }, + } + + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + return { + "description": (str,), + "end_time": (int,), + "start_time": (int,), + "tags": ([str],), + } + + attribute_map = { + "description": "description", + "end_time": "end_time", + "start_time": "start_time", + "tags": "tags", + } + + def __init__( + self_, description: str, end_time: int, start_time: int, tags: Union[List[str], UnsetType] = unset, **kwargs + ): + """ + Attributes for a general investigation with an explicit time window. + + :param description: A free-form description of what to investigate, up to 4,096 characters. + :type description: str + + :param end_time: The end of the investigation window, in Unix milliseconds. + :type end_time: int + + :param start_time: The start of the investigation window, in Unix milliseconds. + :type start_time: int + + :param tags: Tags that scope the investigation. + :type tags: [str], optional + """ + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.description = description + self_.end_time = end_time + self_.start_time = start_time diff --git a/src/datadog_api_client/v2/model/general_investigation_attributes_without_time_bounds.py b/src/datadog_api_client/v2/model/general_investigation_attributes_without_time_bounds.py new file mode 100644 index 0000000000..bc0ba4eb38 --- /dev/null +++ b/src/datadog_api_client/v2/model/general_investigation_attributes_without_time_bounds.py @@ -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 typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GeneralInvestigationAttributesWithoutTimeBounds(ModelNormal): + validations = { + "description": { + "max_length": 4096, + }, + } + + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + return { + "description": (str,), + "tags": ([str],), + } + + attribute_map = { + "description": "description", + "tags": "tags", + } + + def __init__(self_, description: str, tags: Union[List[str], UnsetType] = unset, **kwargs): + """ + Attributes for a general investigation without an explicit time window. + + :param description: A free-form description of what to investigate, up to 4,096 characters. + :type description: str + + :param tags: Tags that scope the investigation. + :type tags: [str], optional + """ + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.description = description diff --git a/src/datadog_api_client/v2/model/trigger_attributes.py b/src/datadog_api_client/v2/model/trigger_attributes.py index 9fee09f879..3ed87c1f75 100644 --- a/src/datadog_api_client/v2/model/trigger_attributes.py +++ b/src/datadog_api_client/v2/model/trigger_attributes.py @@ -3,46 +3,75 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import TYPE_CHECKING +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.general_investigation_attributes import GeneralInvestigationAttributes from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes from datadog_api_client.v2.model.trigger_type import TriggerType + from datadog_api_client.v2.model.general_investigation_attributes_without_time_bounds import ( + GeneralInvestigationAttributesWithoutTimeBounds, + ) + from datadog_api_client.v2.model.general_investigation_attributes_with_time_bounds import ( + GeneralInvestigationAttributesWithTimeBounds, + ) class TriggerAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.general_investigation_attributes import GeneralInvestigationAttributes from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes from datadog_api_client.v2.model.trigger_type import TriggerType return { + "general_investigation": (GeneralInvestigationAttributes,), "monitor_alert_trigger": (MonitorAlertTriggerAttributes,), "type": (TriggerType,), } attribute_map = { + "general_investigation": "general_investigation", "monitor_alert_trigger": "monitor_alert_trigger", "type": "type", } - def __init__(self_, monitor_alert_trigger: MonitorAlertTriggerAttributes, type: TriggerType, **kwargs): + def __init__( + self_, + general_investigation: Union[ + GeneralInvestigationAttributes, + GeneralInvestigationAttributesWithoutTimeBounds, + GeneralInvestigationAttributesWithTimeBounds, + UnsetType, + ] = unset, + monitor_alert_trigger: Union[MonitorAlertTriggerAttributes, UnsetType] = unset, + type: Union[TriggerType, UnsetType] = unset, + **kwargs, + ): """ The trigger definition for starting an investigation. + :param general_investigation: Attributes for a general investigation, not tied to a specific monitor alert. + :type general_investigation: GeneralInvestigationAttributes, optional + :param monitor_alert_trigger: Attributes for a monitor alert trigger. - :type monitor_alert_trigger: MonitorAlertTriggerAttributes + :type monitor_alert_trigger: MonitorAlertTriggerAttributes, optional :param type: The type of trigger for the investigation. - :type type: TriggerType + :type type: TriggerType, optional """ + if general_investigation is not unset: + kwargs["general_investigation"] = general_investigation + if monitor_alert_trigger is not unset: + kwargs["monitor_alert_trigger"] = monitor_alert_trigger + if type is not unset: + kwargs["type"] = type super().__init__(kwargs) - - self_.monitor_alert_trigger = monitor_alert_trigger - self_.type = type diff --git a/src/datadog_api_client/v2/model/trigger_type.py b/src/datadog_api_client/v2/model/trigger_type.py index 6e0885aaa5..b40117a0de 100644 --- a/src/datadog_api_client/v2/model/trigger_type.py +++ b/src/datadog_api_client/v2/model/trigger_type.py @@ -16,14 +16,16 @@ class TriggerType(ModelSimple): """ The type of trigger for the investigation. - :param value: If omitted defaults to "monitor_alert_trigger". Must be one of ["monitor_alert_trigger"]. + :param value: Must be one of ["monitor_alert_trigger", "general_investigation"]. :type value: str """ allowed_values = { "monitor_alert_trigger", + "general_investigation", } MONITOR_ALERT_TRIGGER: ClassVar["TriggerType"] + GENERAL_INVESTIGATION: ClassVar["TriggerType"] @cached_property def openapi_types(_): @@ -33,3 +35,4 @@ def openapi_types(_): TriggerType.MONITOR_ALERT_TRIGGER = TriggerType("monitor_alert_trigger") +TriggerType.GENERAL_INVESTIGATION = TriggerType("general_investigation") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a8fbacf823..54a2130d19 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3600,6 +3600,13 @@ from datadog_api_client.v2.model.gemini_integration import GeminiIntegration from datadog_api_client.v2.model.gemini_integration_type import GeminiIntegrationType from datadog_api_client.v2.model.gemini_integration_update import GeminiIntegrationUpdate +from datadog_api_client.v2.model.general_investigation_attributes import GeneralInvestigationAttributes +from datadog_api_client.v2.model.general_investigation_attributes_with_time_bounds import ( + GeneralInvestigationAttributesWithTimeBounds, +) +from datadog_api_client.v2.model.general_investigation_attributes_without_time_bounds import ( + GeneralInvestigationAttributesWithoutTimeBounds, +) from datadog_api_client.v2.model.generate_cost_tag_description_response import GenerateCostTagDescriptionResponse from datadog_api_client.v2.model.generated_cost_tag_description import GeneratedCostTagDescription from datadog_api_client.v2.model.generated_cost_tag_description_attributes import GeneratedCostTagDescriptionAttributes @@ -14517,6 +14524,9 @@ "GeminiIntegration", "GeminiIntegrationType", "GeminiIntegrationUpdate", + "GeneralInvestigationAttributes", + "GeneralInvestigationAttributesWithTimeBounds", + "GeneralInvestigationAttributesWithoutTimeBounds", "GenerateCostTagDescriptionResponse", "GeneratedCostTagDescription", "GeneratedCostTagDescriptionAttributes",