From 8bd2cac3c77f743bd96b88f684b1ba21821c01d9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 17 Sep 2026 14:39:00 +0000 Subject: [PATCH] Regenerate client from commit 25c7640 of spec repo --- .generator/schemas/v2/openapi.yaml | 43 +++- examples/v2/bits-ai/TriggerInvestigation.java | 10 + .../model/GeneralInvestigationAttributes.java | 240 ++++++++++++++++++ .../client/v2/model/TriggerAttributes.java | 45 +++- .../api/client/v2/model/TriggerType.java | 3 +- .../datadog/api/client/v2/api/bits_ai.feature | 4 +- 6 files changed, 334 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bfb67197915..e174a8fb1ed 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -45860,6 +45860,33 @@ components: required: - type type: object + GeneralInvestigationAttributes: + description: Attributes for a general investigation, not tied to a specific monitor alert. + properties: + description: + description: A free-form description of the problem to investigate. + example: "Checkout latency has been elevated for the past hour." + type: string + end_time: + description: The end of the investigation window, in Unix milliseconds. Must be provided together with `start_time`, or both omitted. + example: 1700003600000 + format: int64 + type: integer + start_time: + description: The start of the investigation window, in Unix milliseconds. Must be provided together with `end_time`, or both omitted. + example: 1700000000000 + format: int64 + type: integer + tags: + description: Tags scoping the investigation. + example: + - "service:checkout" + items: + type: string + type: array + required: + - description + type: object GenerateCostTagDescriptionResponse: description: Response wrapping an AI-generated Cloud Cost Management tag key description. example: @@ -123048,13 +123075,14 @@ components: TriggerAttributes: description: The trigger definition for starting an investigation. 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. @@ -123160,10 +123188,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: @@ -135873,6 +135903,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/examples/v2/bits-ai/TriggerInvestigation.java b/examples/v2/bits-ai/TriggerInvestigation.java index fc5ea035d8a..596557d95aa 100644 --- a/examples/v2/bits-ai/TriggerInvestigation.java +++ b/examples/v2/bits-ai/TriggerInvestigation.java @@ -3,6 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.GeneralInvestigationAttributes; import com.datadog.api.client.v2.model.MonitorAlertTriggerAttributes; import com.datadog.api.client.v2.model.TriggerAttributes; import com.datadog.api.client.v2.model.TriggerInvestigationRequest; @@ -11,6 +12,7 @@ import com.datadog.api.client.v2.model.TriggerInvestigationRequestType; import com.datadog.api.client.v2.model.TriggerInvestigationResponse; import com.datadog.api.client.v2.model.TriggerType; +import java.util.Collections; public class Example { public static void main(String[] args) { @@ -26,6 +28,14 @@ public static void main(String[] args) { new TriggerInvestigationRequestDataAttributes() .trigger( new TriggerAttributes() + .generalInvestigation( + new GeneralInvestigationAttributes() + .description( + "Checkout latency has been elevated for the past" + + " hour.") + .endTime(1700003600000L) + .startTime(1700000000000L) + .tags(Collections.singletonList("service:checkout"))) .monitorAlertTrigger( new MonitorAlertTriggerAttributes() .eventId("1234567890123456789") diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java new file mode 100644 index 00000000000..17f4c9cea2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java @@ -0,0 +1,240 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for a general investigation, not tied to a specific monitor alert. */ +@JsonPropertyOrder({ + GeneralInvestigationAttributes.JSON_PROPERTY_DESCRIPTION, + GeneralInvestigationAttributes.JSON_PROPERTY_END_TIME, + GeneralInvestigationAttributes.JSON_PROPERTY_START_TIME, + GeneralInvestigationAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneralInvestigationAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_END_TIME = "end_time"; + private Long endTime; + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public GeneralInvestigationAttributes() {} + + @JsonCreator + public GeneralInvestigationAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public GeneralInvestigationAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A free-form description of the problem to investigate. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GeneralInvestigationAttributes endTime(Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * The end of the investigation window, in Unix milliseconds. Must be provided together with + * start_time, or both omitted. + * + * @return endTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEndTime() { + return endTime; + } + + public void setEndTime(Long endTime) { + this.endTime = endTime; + } + + public GeneralInvestigationAttributes startTime(Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * The start of the investigation window, in Unix milliseconds. Must be provided together with + * end_time, or both omitted. + * + * @return startTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTime() { + return startTime; + } + + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public GeneralInvestigationAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public GeneralInvestigationAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags scoping the investigation. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GeneralInvestigationAttributes + */ + @JsonAnySetter + public GeneralInvestigationAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GeneralInvestigationAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralInvestigationAttributes generalInvestigationAttributes = + (GeneralInvestigationAttributes) o; + return Objects.equals(this.description, generalInvestigationAttributes.description) + && Objects.equals(this.endTime, generalInvestigationAttributes.endTime) + && Objects.equals(this.startTime, generalInvestigationAttributes.startTime) + && Objects.equals(this.tags, generalInvestigationAttributes.tags) + && Objects.equals( + this.additionalProperties, generalInvestigationAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, endTime, startTime, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralInvestigationAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java index db8fa9a43eb..9e4cc22ec04 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java @@ -19,6 +19,7 @@ /** The trigger definition for starting an investigation. */ @JsonPropertyOrder({ + TriggerAttributes.JSON_PROPERTY_GENERAL_INVESTIGATION, TriggerAttributes.JSON_PROPERTY_MONITOR_ALERT_TRIGGER, TriggerAttributes.JSON_PROPERTY_TYPE }) @@ -26,6 +27,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class TriggerAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GENERAL_INVESTIGATION = "general_investigation"; + private GeneralInvestigationAttributes generalInvestigation; + public static final String JSON_PROPERTY_MONITOR_ALERT_TRIGGER = "monitor_alert_trigger"; private MonitorAlertTriggerAttributes monitorAlertTrigger; @@ -36,15 +40,37 @@ public TriggerAttributes() {} @JsonCreator public TriggerAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ALERT_TRIGGER) - MonitorAlertTriggerAttributes monitorAlertTrigger, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TriggerType type) { - this.monitorAlertTrigger = monitorAlertTrigger; - this.unparsed |= monitorAlertTrigger.unparsed; this.type = type; this.unparsed |= !type.isValid(); } + public TriggerAttributes generalInvestigation( + GeneralInvestigationAttributes generalInvestigation) { + this.generalInvestigation = generalInvestigation; + this.unparsed |= generalInvestigation.unparsed; + return this; + } + + /** + * Attributes for a general investigation, not tied to a specific monitor alert. + * + * @return generalInvestigation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GENERAL_INVESTIGATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GeneralInvestigationAttributes getGeneralInvestigation() { + return generalInvestigation; + } + + public void setGeneralInvestigation(GeneralInvestigationAttributes generalInvestigation) { + this.generalInvestigation = generalInvestigation; + if (generalInvestigation != null) { + this.unparsed |= generalInvestigation.unparsed; + } + } + public TriggerAttributes monitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { this.monitorAlertTrigger = monitorAlertTrigger; this.unparsed |= monitorAlertTrigger.unparsed; @@ -56,8 +82,9 @@ public TriggerAttributes monitorAlertTrigger(MonitorAlertTriggerAttributes monit * * @return monitorAlertTrigger */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MONITOR_ALERT_TRIGGER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public MonitorAlertTriggerAttributes getMonitorAlertTrigger() { return monitorAlertTrigger; } @@ -149,20 +176,24 @@ public boolean equals(Object o) { return false; } TriggerAttributes triggerAttributes = (TriggerAttributes) o; - return Objects.equals(this.monitorAlertTrigger, triggerAttributes.monitorAlertTrigger) + return Objects.equals(this.generalInvestigation, triggerAttributes.generalInvestigation) + && Objects.equals(this.monitorAlertTrigger, triggerAttributes.monitorAlertTrigger) && Objects.equals(this.type, triggerAttributes.type) && Objects.equals(this.additionalProperties, triggerAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(monitorAlertTrigger, type, additionalProperties); + return Objects.hash(generalInvestigation, monitorAlertTrigger, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TriggerAttributes {\n"); + sb.append(" generalInvestigation: ") + .append(toIndentedString(generalInvestigation)) + .append("\n"); sb.append(" monitorAlertTrigger: ") .append(toIndentedString(monitorAlertTrigger)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java index ad95927b728..37160d724f9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TriggerType.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java @@ -23,9 +23,10 @@ public class TriggerType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("monitor_alert_trigger")); + new HashSet(Arrays.asList("monitor_alert_trigger", "general_investigation")); public static final TriggerType MONITOR_ALERT_TRIGGER = new TriggerType("monitor_alert_trigger"); + public static final TriggerType GENERAL_INVESTIGATION = new TriggerType("general_investigation"); TriggerType(String value) { super(value, allowedValues); diff --git a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature index bc5ec941d8f..ddf575cf059 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature @@ -56,7 +56,7 @@ Feature: Bits AI Scenario: Trigger a Bits AI investigation returns "Bad Request" response Given operation "TriggerInvestigation" enabled And new "TriggerInvestigation" request - And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + And body with value {"data": {"attributes": {"trigger": {"general_investigation": {"description": "Checkout latency has been elevated for the past hour.", "end_time": 1700003600000, "start_time": 1700000000000, "tags": ["service:checkout"]}, "monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} When the request is sent Then the response status is 400 Bad Request @@ -64,6 +64,6 @@ Feature: Bits AI Scenario: Trigger a Bits AI investigation returns "OK" response Given operation "TriggerInvestigation" enabled And new "TriggerInvestigation" request - And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + And body with value {"data": {"attributes": {"trigger": {"general_investigation": {"description": "Checkout latency has been elevated for the past hour.", "end_time": 1700003600000, "start_time": 1700000000000, "tags": ["service:checkout"]}, "monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} When the request is sent Then the response status is 200 OK