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
43 changes: 42 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions examples/v2/bits-ai/TriggerInvestigation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String> 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
* <code>start_time</code>, 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
* <code>end_time</code>, 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<String> 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<String> getTags() {
return tags;
}

public void setTags(List<String> 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<String, Object> 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<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> 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 ");
}
}
Loading
Loading