diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fd91a63251b..a903bf6b8f3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4978,7 +4978,7 @@ components: example: ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b type: string criteria: - $ref: '#/components/schemas/AggregatedWaterfallPerformanceCriteria' + $ref: '#/components/schemas/AggregatedLongTasksResponseAttributesCriteria' from: description: Start of the analyzed time range as a Unix timestamp in seconds. example: 1762437564 @@ -5017,9 +5017,29 @@ components: - view_count - from - to + - criteria - sampled_view_ids - long_tasks_by_invoker_type type: object + AggregatedLongTasksResponseAttributesCriteria: + description: Performance criteria used to filter view instances by a metric threshold, or null if no criteria were applied. + nullable: true + properties: + max: + description: Maximum threshold in seconds (inclusive). + example: 5.0 + format: double + type: number + metric: + $ref: '#/components/schemas/AggregatedWaterfallPerformanceCriteriaMetric' + min: + description: Minimum threshold in seconds (inclusive). + example: 2.5 + format: double + type: number + required: + - metric + type: object AggregatedLongTasksResponseData: description: Data envelope for an aggregated long tasks response. properties: @@ -121786,7 +121806,6 @@ components: type: integer required: - invoker - - file - view_occurrences - stats_per_view type: object @@ -197270,6 +197289,7 @@ paths: data: attributes: application_id: ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b + criteria: from: 1762437564 long_tasks_by_invoker_type: - impact_score: 0.4 diff --git a/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributes.java index 8805bd9f6d2..494dcfe664e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributes.java @@ -38,7 +38,7 @@ public class AggregatedLongTasksResponseAttributes { private String applicationId; public static final String JSON_PROPERTY_CRITERIA = "criteria"; - private AggregatedWaterfallPerformanceCriteria criteria; + private AggregatedLongTasksResponseAttributesCriteria criteria; public static final String JSON_PROPERTY_FROM = "from"; private Long from; @@ -64,6 +64,8 @@ public AggregatedLongTasksResponseAttributes() {} @JsonCreator public AggregatedLongTasksResponseAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_APPLICATION_ID) String applicationId, + @JsonProperty(required = true, value = JSON_PROPERTY_CRITERIA) + AggregatedLongTasksResponseAttributesCriteria criteria, @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, @JsonProperty(required = true, value = JSON_PROPERTY_LONG_TASKS_BY_INVOKER_TYPE) List longTasksByInvokerType, @@ -73,6 +75,10 @@ public AggregatedLongTasksResponseAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_COUNT) Integer viewCount, @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_NAME) String viewName) { this.applicationId = applicationId; + this.criteria = criteria; + if (criteria != null) { + this.unparsed |= criteria.unparsed; + } this.from = from; this.longTasksByInvokerType = longTasksByInvokerType; for (AggregatedLongTasksByInvokerType item : longTasksByInvokerType) { @@ -105,25 +111,28 @@ public void setApplicationId(String applicationId) { } public AggregatedLongTasksResponseAttributes criteria( - AggregatedWaterfallPerformanceCriteria criteria) { + AggregatedLongTasksResponseAttributesCriteria criteria) { this.criteria = criteria; - this.unparsed |= criteria.unparsed; + if (criteria != null) { + this.unparsed |= criteria.unparsed; + } return this; } /** - * Performance criteria to filter view instances by a metric threshold. + * Performance criteria used to filter view instances by a metric threshold, or null if no + * criteria were applied. * * @return criteria */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CRITERIA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AggregatedWaterfallPerformanceCriteria getCriteria() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AggregatedLongTasksResponseAttributesCriteria getCriteria() { return criteria; } - public void setCriteria(AggregatedWaterfallPerformanceCriteria criteria) { + public void setCriteria(AggregatedLongTasksResponseAttributesCriteria criteria) { this.criteria = criteria; if (criteria != null) { this.unparsed |= criteria.unparsed; diff --git a/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributesCriteria.java b/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributesCriteria.java new file mode 100644 index 00000000000..fe5584228cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AggregatedLongTasksResponseAttributesCriteria.java @@ -0,0 +1,213 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Performance criteria used to filter view instances by a metric threshold, or null if no criteria + * were applied. + */ +@JsonPropertyOrder({ + AggregatedLongTasksResponseAttributesCriteria.JSON_PROPERTY_MAX, + AggregatedLongTasksResponseAttributesCriteria.JSON_PROPERTY_METRIC, + AggregatedLongTasksResponseAttributesCriteria.JSON_PROPERTY_MIN +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AggregatedLongTasksResponseAttributesCriteria { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MAX = "max"; + private Double max; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private AggregatedWaterfallPerformanceCriteriaMetric metric; + + public static final String JSON_PROPERTY_MIN = "min"; + private Double min; + + public AggregatedLongTasksResponseAttributesCriteria() {} + + @JsonCreator + public AggregatedLongTasksResponseAttributesCriteria( + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC) + AggregatedWaterfallPerformanceCriteriaMetric metric) { + this.metric = metric; + this.unparsed |= !metric.isValid(); + } + + public AggregatedLongTasksResponseAttributesCriteria max(Double max) { + this.max = max; + return this; + } + + /** + * Maximum threshold in seconds (inclusive). + * + * @return max + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMax() { + return max; + } + + public void setMax(Double max) { + this.max = max; + } + + public AggregatedLongTasksResponseAttributesCriteria metric( + AggregatedWaterfallPerformanceCriteriaMetric metric) { + this.metric = metric; + this.unparsed |= !metric.isValid(); + return this; + } + + /** + * Performance metric used to filter view instances by threshold. + * + * @return metric + */ + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AggregatedWaterfallPerformanceCriteriaMetric getMetric() { + return metric; + } + + public void setMetric(AggregatedWaterfallPerformanceCriteriaMetric metric) { + if (!metric.isValid()) { + this.unparsed = true; + } + this.metric = metric; + } + + public AggregatedLongTasksResponseAttributesCriteria min(Double min) { + this.min = min; + return this; + } + + /** + * Minimum threshold in seconds (inclusive). + * + * @return min + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMin() { + return min; + } + + public void setMin(Double min) { + this.min = min; + } + + /** + * 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 AggregatedLongTasksResponseAttributesCriteria + */ + @JsonAnySetter + public AggregatedLongTasksResponseAttributesCriteria 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 AggregatedLongTasksResponseAttributesCriteria object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AggregatedLongTasksResponseAttributesCriteria aggregatedLongTasksResponseAttributesCriteria = + (AggregatedLongTasksResponseAttributesCriteria) o; + return Objects.equals(this.max, aggregatedLongTasksResponseAttributesCriteria.max) + && Objects.equals(this.metric, aggregatedLongTasksResponseAttributesCriteria.metric) + && Objects.equals(this.min, aggregatedLongTasksResponseAttributesCriteria.min) + && Objects.equals( + this.additionalProperties, + aggregatedLongTasksResponseAttributesCriteria.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(max, metric, min, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AggregatedLongTasksResponseAttributesCriteria {\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).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/TopLongTaskInvoker.java b/src/main/java/com/datadog/api/client/v2/model/TopLongTaskInvoker.java index 2be57296807..083007f97e3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TopLongTaskInvoker.java +++ b/src/main/java/com/datadog/api/client/v2/model/TopLongTaskInvoker.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** A top long task invoker within an invoker type. */ @JsonPropertyOrder({ @@ -34,7 +35,7 @@ public class TopLongTaskInvoker { private Integer criteriaViewOccurrences; public static final String JSON_PROPERTY_FILE = "file"; - private String file; + private JsonNullable file = JsonNullable.undefined(); public static final String JSON_PROPERTY_IMPACT_SCORE = "impact_score"; private Double impactScore; @@ -52,14 +53,11 @@ public TopLongTaskInvoker() {} @JsonCreator public TopLongTaskInvoker( - @JsonProperty(required = true, value = JSON_PROPERTY_FILE) String file, @JsonProperty(required = true, value = JSON_PROPERTY_INVOKER) String invoker, @JsonProperty(required = true, value = JSON_PROPERTY_STATS_PER_VIEW) LongTaskStatsPerView statsPerView, @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_OCCURRENCES) Integer viewOccurrences) { - this.file = file; - if (file != null) {} this.invoker = invoker; this.statsPerView = statsPerView; this.unparsed |= statsPerView.unparsed; @@ -89,8 +87,7 @@ public void setCriteriaViewOccurrences(Integer criteriaViewOccurrences) { } public TopLongTaskInvoker file(String file) { - this.file = file; - if (file != null) {} + this.file = JsonNullable.of(file); return this; } @@ -100,16 +97,26 @@ public TopLongTaskInvoker file(String file) { * @return file */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonIgnore public String getFile() { + return file.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFile_JsonNullable() { return file; } - public void setFile(String file) { + @JsonProperty(JSON_PROPERTY_FILE) + public void setFile_JsonNullable(JsonNullable file) { this.file = file; } + public void setFile(String file) { + this.file = JsonNullable.of(file); + } + public TopLongTaskInvoker impactScore(Double impactScore) { this.impactScore = impactScore; return this;