From da5d1603d28219f0cf9255e47683c10395052aef Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 25 Sep 2026 16:51:09 +0000 Subject: [PATCH] Regenerate client from commit c27beef of spec repo --- .generator/schemas/v2/openapi.yaml | 124 ++++++- .../datadog/api/client/v2/api/BitsAiApi.java | 5 +- .../model/GeneralInvestigationAttributes.java | 316 ++++++++++++++++++ ...InvestigationAttributesWithTimeBounds.java | 186 +++++++++++ ...estigationAttributesWithoutTimeBounds.java | 131 ++++++++ .../v2/model/GeneralInvestigationTrigger.java | 135 ++++++++ .../GeneralInvestigationTriggerType.java | 58 ++++ .../client/v2/model/MonitorAlertTrigger.java | 133 ++++++++ .../v2/model/MonitorAlertTriggerType.java | 57 ++++ .../client/v2/model/TriggerAttributes.java | 52 ++- .../api/client/v2/model/TriggerType.java | 3 +- 11 files changed, 1178 insertions(+), 22 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithTimeBounds.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithoutTimeBounds.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTrigger.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTriggerType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MonitorAlertTrigger.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 12847a964d0..6cb8857f920 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/main/java/com/datadog/api/client/v2/api/BitsAiApi.java b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java index 1bf282587a1..004af647bd6 100644 --- a/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java @@ -507,8 +507,9 @@ public CompletableFuture triggerInvestigationAsync } /** - * Trigger a new Bits AI investigation based on a monitor alert. The monitors_read - * permission is required when the trigger type is monitor_alert_trigger. + * 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. (required) * @return ApiResponse<TriggerInvestigationResponse> 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..2ea2024c4da --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributes.java @@ -0,0 +1,316 @@ +/* + * 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.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = GeneralInvestigationAttributes.GeneralInvestigationAttributesDeserializer.class) +@JsonSerialize( + using = GeneralInvestigationAttributes.GeneralInvestigationAttributesSerializer.class) +public class GeneralInvestigationAttributes extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(GeneralInvestigationAttributes.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class GeneralInvestigationAttributesSerializer + extends StdSerializer { + public GeneralInvestigationAttributesSerializer(Class t) { + super(t); + } + + public GeneralInvestigationAttributesSerializer() { + this(null); + } + + @Override + public void serialize( + GeneralInvestigationAttributes value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class GeneralInvestigationAttributesDeserializer + extends StdDeserializer { + public GeneralInvestigationAttributesDeserializer() { + this(GeneralInvestigationAttributes.class); + } + + public GeneralInvestigationAttributesDeserializer(Class vc) { + super(vc); + } + + @Override + public GeneralInvestigationAttributes deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize GeneralInvestigationAttributesWithoutTimeBounds + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Integer.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Long.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Float.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Double.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Boolean.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Integer.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Float.class) + || GeneralInvestigationAttributesWithoutTimeBounds.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (GeneralInvestigationAttributesWithoutTimeBounds.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (GeneralInvestigationAttributesWithoutTimeBounds.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(GeneralInvestigationAttributesWithoutTimeBounds.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((GeneralInvestigationAttributesWithoutTimeBounds) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'GeneralInvestigationAttributesWithoutTimeBounds'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'GeneralInvestigationAttributesWithoutTimeBounds'", + e); + } + + // deserialize GeneralInvestigationAttributesWithTimeBounds + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GeneralInvestigationAttributesWithTimeBounds.class.equals(Integer.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Long.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Float.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Double.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Boolean.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((GeneralInvestigationAttributesWithTimeBounds.class.equals(Integer.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((GeneralInvestigationAttributesWithTimeBounds.class.equals(Float.class) + || GeneralInvestigationAttributesWithTimeBounds.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (GeneralInvestigationAttributesWithTimeBounds.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (GeneralInvestigationAttributesWithTimeBounds.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(GeneralInvestigationAttributesWithTimeBounds.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((GeneralInvestigationAttributesWithTimeBounds) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'GeneralInvestigationAttributesWithTimeBounds'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'GeneralInvestigationAttributesWithTimeBounds'", + e); + } + + GeneralInvestigationAttributes ret = new GeneralInvestigationAttributes(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public GeneralInvestigationAttributes getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "GeneralInvestigationAttributes cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GeneralInvestigationAttributes() { + super("oneOf", Boolean.FALSE); + } + + public GeneralInvestigationAttributes(GeneralInvestigationAttributesWithoutTimeBounds o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GeneralInvestigationAttributes(GeneralInvestigationAttributesWithTimeBounds o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "GeneralInvestigationAttributesWithoutTimeBounds", + new GenericType() {}); + schemas.put( + "GeneralInvestigationAttributesWithTimeBounds", + new GenericType() {}); + JSON.registerDescendants( + GeneralInvestigationAttributes.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return GeneralInvestigationAttributes.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: GeneralInvestigationAttributesWithoutTimeBounds, + * GeneralInvestigationAttributesWithTimeBounds + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + GeneralInvestigationAttributesWithoutTimeBounds.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + GeneralInvestigationAttributesWithTimeBounds.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be GeneralInvestigationAttributesWithoutTimeBounds," + + " GeneralInvestigationAttributesWithTimeBounds"); + } + + /** + * Get the actual instance, which can be the following: + * GeneralInvestigationAttributesWithoutTimeBounds, GeneralInvestigationAttributesWithTimeBounds + * + * @return The actual instance (GeneralInvestigationAttributesWithoutTimeBounds, + * GeneralInvestigationAttributesWithTimeBounds) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GeneralInvestigationAttributesWithoutTimeBounds`. If the actual + * instance is not `GeneralInvestigationAttributesWithoutTimeBounds`, the ClassCastException will + * be thrown. + * + * @return The actual instance of `GeneralInvestigationAttributesWithoutTimeBounds` + * @throws ClassCastException if the instance is not + * `GeneralInvestigationAttributesWithoutTimeBounds` + */ + public GeneralInvestigationAttributesWithoutTimeBounds + getGeneralInvestigationAttributesWithoutTimeBounds() throws ClassCastException { + return (GeneralInvestigationAttributesWithoutTimeBounds) super.getActualInstance(); + } + + /** + * Get the actual instance of `GeneralInvestigationAttributesWithTimeBounds`. If the actual + * instance is not `GeneralInvestigationAttributesWithTimeBounds`, the ClassCastException will be + * thrown. + * + * @return The actual instance of `GeneralInvestigationAttributesWithTimeBounds` + * @throws ClassCastException if the instance is not + * `GeneralInvestigationAttributesWithTimeBounds` + */ + public GeneralInvestigationAttributesWithTimeBounds + getGeneralInvestigationAttributesWithTimeBounds() throws ClassCastException { + return (GeneralInvestigationAttributesWithTimeBounds) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithTimeBounds.java b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithTimeBounds.java new file mode 100644 index 00000000000..0612dde5ebb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithTimeBounds.java @@ -0,0 +1,186 @@ +/* + * 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.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.List; +import java.util.Objects; + +/** Attributes for a general investigation with an explicit time window. */ +@JsonPropertyOrder({ + GeneralInvestigationAttributesWithTimeBounds.JSON_PROPERTY_DESCRIPTION, + GeneralInvestigationAttributesWithTimeBounds.JSON_PROPERTY_END_TIME, + GeneralInvestigationAttributesWithTimeBounds.JSON_PROPERTY_START_TIME, + GeneralInvestigationAttributesWithTimeBounds.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneralInvestigationAttributesWithTimeBounds { + @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 GeneralInvestigationAttributesWithTimeBounds() {} + + @JsonCreator + public GeneralInvestigationAttributesWithTimeBounds( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_END_TIME) Long endTime, + @JsonProperty(required = true, value = JSON_PROPERTY_START_TIME) Long startTime) { + this.description = description; + this.endTime = endTime; + this.startTime = startTime; + } + + public GeneralInvestigationAttributesWithTimeBounds description(String description) { + this.description = description; + return this; + } + + /** + * A free-form description of what to investigate, up to 4,096 characters. + * + * @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 GeneralInvestigationAttributesWithTimeBounds endTime(Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * The end of the investigation window, in Unix milliseconds. + * + * @return endTime + */ + @JsonProperty(JSON_PROPERTY_END_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEndTime() { + return endTime; + } + + public void setEndTime(Long endTime) { + this.endTime = endTime; + } + + public GeneralInvestigationAttributesWithTimeBounds startTime(Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * The start of the investigation window, in Unix milliseconds. + * + * @return startTime + */ + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStartTime() { + return startTime; + } + + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public GeneralInvestigationAttributesWithTimeBounds tags(List tags) { + this.tags = tags; + return this; + } + + public GeneralInvestigationAttributesWithTimeBounds addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags that scope 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; + } + + /** Return true if this GeneralInvestigationAttributesWithTimeBounds object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralInvestigationAttributesWithTimeBounds generalInvestigationAttributesWithTimeBounds = + (GeneralInvestigationAttributesWithTimeBounds) o; + return Objects.equals( + this.description, generalInvestigationAttributesWithTimeBounds.description) + && Objects.equals(this.endTime, generalInvestigationAttributesWithTimeBounds.endTime) + && Objects.equals(this.startTime, generalInvestigationAttributesWithTimeBounds.startTime) + && Objects.equals(this.tags, generalInvestigationAttributesWithTimeBounds.tags); + } + + @Override + public int hashCode() { + return Objects.hash(description, endTime, startTime, tags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralInvestigationAttributesWithTimeBounds {\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('}'); + 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/GeneralInvestigationAttributesWithoutTimeBounds.java b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithoutTimeBounds.java new file mode 100644 index 00000000000..bf0fe4b3840 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationAttributesWithoutTimeBounds.java @@ -0,0 +1,131 @@ +/* + * 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.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.List; +import java.util.Objects; + +/** Attributes for a general investigation without an explicit time window. */ +@JsonPropertyOrder({ + GeneralInvestigationAttributesWithoutTimeBounds.JSON_PROPERTY_DESCRIPTION, + GeneralInvestigationAttributesWithoutTimeBounds.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneralInvestigationAttributesWithoutTimeBounds { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public GeneralInvestigationAttributesWithoutTimeBounds() {} + + @JsonCreator + public GeneralInvestigationAttributesWithoutTimeBounds( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public GeneralInvestigationAttributesWithoutTimeBounds description(String description) { + this.description = description; + return this; + } + + /** + * A free-form description of what to investigate, up to 4,096 characters. + * + * @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 GeneralInvestigationAttributesWithoutTimeBounds tags(List tags) { + this.tags = tags; + return this; + } + + public GeneralInvestigationAttributesWithoutTimeBounds addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags that scope 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; + } + + /** Return true if this GeneralInvestigationAttributesWithoutTimeBounds object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralInvestigationAttributesWithoutTimeBounds + generalInvestigationAttributesWithoutTimeBounds = + (GeneralInvestigationAttributesWithoutTimeBounds) o; + return Objects.equals( + this.description, generalInvestigationAttributesWithoutTimeBounds.description) + && Objects.equals(this.tags, generalInvestigationAttributesWithoutTimeBounds.tags); + } + + @Override + public int hashCode() { + return Objects.hash(description, tags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralInvestigationAttributesWithoutTimeBounds {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/GeneralInvestigationTrigger.java b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTrigger.java new file mode 100644 index 00000000000..790e014f9f3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTrigger.java @@ -0,0 +1,135 @@ +/* + * 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.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.Objects; + +/** A trigger created from a general investigation request. */ +@JsonPropertyOrder({ + GeneralInvestigationTrigger.JSON_PROPERTY_GENERAL_INVESTIGATION, + GeneralInvestigationTrigger.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneralInvestigationTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GENERAL_INVESTIGATION = "general_investigation"; + private GeneralInvestigationAttributes generalInvestigation; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GeneralInvestigationTriggerType type; + + public GeneralInvestigationTrigger() {} + + @JsonCreator + public GeneralInvestigationTrigger( + @JsonProperty(required = true, value = JSON_PROPERTY_GENERAL_INVESTIGATION) + GeneralInvestigationAttributes generalInvestigation, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GeneralInvestigationTriggerType type) { + this.generalInvestigation = generalInvestigation; + this.unparsed |= generalInvestigation.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GeneralInvestigationTrigger 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 + */ + @JsonProperty(JSON_PROPERTY_GENERAL_INVESTIGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneralInvestigationAttributes getGeneralInvestigation() { + return generalInvestigation; + } + + public void setGeneralInvestigation(GeneralInvestigationAttributes generalInvestigation) { + this.generalInvestigation = generalInvestigation; + if (generalInvestigation != null) { + this.unparsed |= generalInvestigation.unparsed; + } + } + + public GeneralInvestigationTrigger type(GeneralInvestigationTriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of general investigation trigger. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneralInvestigationTriggerType getType() { + return type; + } + + public void setType(GeneralInvestigationTriggerType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this GeneralInvestigationTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralInvestigationTrigger generalInvestigationTrigger = (GeneralInvestigationTrigger) o; + return Objects.equals( + this.generalInvestigation, generalInvestigationTrigger.generalInvestigation) + && Objects.equals(this.type, generalInvestigationTrigger.type); + } + + @Override + public int hashCode() { + return Objects.hash(generalInvestigation, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralInvestigationTrigger {\n"); + sb.append(" generalInvestigation: ") + .append(toIndentedString(generalInvestigation)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/GeneralInvestigationTriggerType.java b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTriggerType.java new file mode 100644 index 00000000000..2862c1f647a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneralInvestigationTriggerType.java @@ -0,0 +1,58 @@ +/* + * 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.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of general investigation trigger. */ +@JsonSerialize( + using = GeneralInvestigationTriggerType.GeneralInvestigationTriggerTypeSerializer.class) +public class GeneralInvestigationTriggerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("general_investigation")); + + public static final GeneralInvestigationTriggerType GENERAL_INVESTIGATION = + new GeneralInvestigationTriggerType("general_investigation"); + + GeneralInvestigationTriggerType(String value) { + super(value, allowedValues); + } + + public static class GeneralInvestigationTriggerTypeSerializer + extends StdSerializer { + public GeneralInvestigationTriggerTypeSerializer(Class t) { + super(t); + } + + public GeneralInvestigationTriggerTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GeneralInvestigationTriggerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GeneralInvestigationTriggerType fromValue(String value) { + return new GeneralInvestigationTriggerType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTrigger.java b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTrigger.java new file mode 100644 index 00000000000..cd63317359e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTrigger.java @@ -0,0 +1,133 @@ +/* + * 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.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.Objects; + +/** A trigger created from a monitor alert. */ +@JsonPropertyOrder({ + MonitorAlertTrigger.JSON_PROPERTY_MONITOR_ALERT_TRIGGER, + MonitorAlertTrigger.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorAlertTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MONITOR_ALERT_TRIGGER = "monitor_alert_trigger"; + private MonitorAlertTriggerAttributes monitorAlertTrigger; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MonitorAlertTriggerType type; + + public MonitorAlertTrigger() {} + + @JsonCreator + public MonitorAlertTrigger( + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + MonitorAlertTriggerAttributes monitorAlertTrigger, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MonitorAlertTriggerType type) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MonitorAlertTrigger monitorAlertTrigger( + MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + return this; + } + + /** + * Attributes for a monitor alert trigger. + * + * @return monitorAlertTrigger + */ + @JsonProperty(JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MonitorAlertTriggerAttributes getMonitorAlertTrigger() { + return monitorAlertTrigger; + } + + public void setMonitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + if (monitorAlertTrigger != null) { + this.unparsed |= monitorAlertTrigger.unparsed; + } + } + + public MonitorAlertTrigger type(MonitorAlertTriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of monitor alert trigger. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MonitorAlertTriggerType getType() { + return type; + } + + public void setType(MonitorAlertTriggerType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this MonitorAlertTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorAlertTrigger monitorAlertTrigger = (MonitorAlertTrigger) o; + return Objects.equals(this.monitorAlertTrigger, monitorAlertTrigger.monitorAlertTrigger) + && Objects.equals(this.type, monitorAlertTrigger.type); + } + + @Override + public int hashCode() { + return Objects.hash(monitorAlertTrigger, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorAlertTrigger {\n"); + sb.append(" monitorAlertTrigger: ") + .append(toIndentedString(monitorAlertTrigger)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/MonitorAlertTriggerType.java b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerType.java new file mode 100644 index 00000000000..e12d34a1a6e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerType.java @@ -0,0 +1,57 @@ +/* + * 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.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of monitor alert trigger. */ +@JsonSerialize(using = MonitorAlertTriggerType.MonitorAlertTriggerTypeSerializer.class) +public class MonitorAlertTriggerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("monitor_alert_trigger")); + + public static final MonitorAlertTriggerType MONITOR_ALERT_TRIGGER = + new MonitorAlertTriggerType("monitor_alert_trigger"); + + MonitorAlertTriggerType(String value) { + super(value, allowedValues); + } + + public static class MonitorAlertTriggerTypeSerializer + extends StdSerializer { + public MonitorAlertTriggerTypeSerializer(Class t) { + super(t); + } + + public MonitorAlertTriggerTypeSerializer() { + this(null); + } + + @Override + public void serialize( + MonitorAlertTriggerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MonitorAlertTriggerType fromValue(String value) { + return new MonitorAlertTriggerType(value); + } +} 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..9d13edc9135 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 @@ -8,7 +8,6 @@ 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; @@ -19,6 +18,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,23 +26,39 @@ 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; public static final String JSON_PROPERTY_TYPE = "type"; private TriggerType type; - public TriggerAttributes() {} + public TriggerAttributes generalInvestigation( + GeneralInvestigationAttributes generalInvestigation) { + this.generalInvestigation = generalInvestigation; + this.unparsed |= generalInvestigation.unparsed; + return this; + } - @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(); + /** + * 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) { @@ -56,8 +72,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; } @@ -80,8 +97,9 @@ public TriggerAttributes type(TriggerType type) { * * @return type */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public TriggerType getType() { return type; } @@ -149,20 +167,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);