diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c680cd9d1d4..d5dff5c717e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -135317,6 +135317,10 @@ components: properties: attributes: $ref: "#/components/schemas/TimeseriesResponseAttributes" + id: + description: The identifier of the timeseries response resource. + example: "0" + type: string type: $ref: "#/components/schemas/TimeseriesFormulaResponseType" type: object @@ -136175,24 +136179,29 @@ components: properties: family: description: Unit family, allows for conversion between units of the same family, for scaling. - example: time + example: percentage type: string + id: + description: The identifier of the unit. + example: 17 + format: int64 + type: integer name: - description: Unit name - example: minute + description: Unit name. + example: percent type: string plural: description: Plural form of the unit name. - example: minutes + example: percent type: string scale_factor: description: Factor for scaling between units of the same family. - example: 60.0 + example: 1.0 format: double type: number short_name: description: Abbreviation of the unit. - example: min + example: "%" type: string type: object UnitCostCreateRequest: diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesResponse.java index 1fe210d27ed..5a02cf10fd6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimeseriesResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesResponse.java @@ -19,6 +19,7 @@ /** A message containing the response to a timeseries query. */ @JsonPropertyOrder({ TimeseriesResponse.JSON_PROPERTY_ATTRIBUTES, + TimeseriesResponse.JSON_PROPERTY_ID, TimeseriesResponse.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( @@ -28,6 +29,9 @@ public class TimeseriesResponse { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private TimeseriesResponseAttributes attributes; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + public static final String JSON_PROPERTY_TYPE = "type"; private TimeseriesFormulaResponseType type = TimeseriesFormulaResponseType.TIMESERIES_RESPONSE; @@ -56,6 +60,27 @@ public void setAttributes(TimeseriesResponseAttributes attributes) { } } + public TimeseriesResponse id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the timeseries response resource. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + public TimeseriesResponse type(TimeseriesFormulaResponseType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -138,13 +163,14 @@ public boolean equals(Object o) { } TimeseriesResponse timeseriesResponse = (TimeseriesResponse) o; return Objects.equals(this.attributes, timeseriesResponse.attributes) + && Objects.equals(this.id, timeseriesResponse.id) && Objects.equals(this.type, timeseriesResponse.type) && Objects.equals(this.additionalProperties, timeseriesResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(attributes, type, additionalProperties); + return Objects.hash(attributes, id, type, additionalProperties); } @Override @@ -152,6 +178,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TimeseriesResponse {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/Unit.java b/src/main/java/com/datadog/api/client/v2/model/Unit.java index 0665bba9c2f..a0c714fecaa 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Unit.java +++ b/src/main/java/com/datadog/api/client/v2/model/Unit.java @@ -19,6 +19,7 @@ /** Object containing the metric unit family, scale factor, name, and short name. */ @JsonPropertyOrder({ Unit.JSON_PROPERTY_FAMILY, + Unit.JSON_PROPERTY_ID, Unit.JSON_PROPERTY_NAME, Unit.JSON_PROPERTY_PLURAL, Unit.JSON_PROPERTY_SCALE_FACTOR, @@ -31,6 +32,9 @@ public class Unit { public static final String JSON_PROPERTY_FAMILY = "family"; private String family; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -64,13 +68,34 @@ public void setFamily(String family) { this.family = family; } + public Unit id(Long id) { + this.id = id; + return this; + } + + /** + * The identifier of the unit. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public Unit name(String name) { this.name = name; return this; } /** - * Unit name + * Unit name. * * @return name */ @@ -205,6 +230,7 @@ public boolean equals(Object o) { } Unit unit = (Unit) o; return Objects.equals(this.family, unit.family) + && Objects.equals(this.id, unit.id) && Objects.equals(this.name, unit.name) && Objects.equals(this.plural, unit.plural) && Objects.equals(this.scaleFactor, unit.scaleFactor) @@ -214,7 +240,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(family, name, plural, scaleFactor, shortName, additionalProperties); + return Objects.hash(family, id, name, plural, scaleFactor, shortName, additionalProperties); } @Override @@ -222,6 +248,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Unit {\n"); sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" plural: ").append(toIndentedString(plural)).append("\n"); sb.append(" scaleFactor: ").append(toIndentedString(scaleFactor)).append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/metrics.feature b/src/test/resources/com/datadog/api/client/v2/api/metrics.feature index f4078974f84..59973467f40 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/metrics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/metrics.feature @@ -980,6 +980,7 @@ Feature: Metrics And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:datadog.estimated_usage.metrics.custom{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} When the request is sent Then the response status is 200 OK + And the response "data.id" is equal to "0" And the response "data.type" is equal to "timeseries_response" @skip-validation @team:ddoghq/timeseries-query