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
21 changes: 15 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -138,20 +163,22 @@ 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
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))
Expand Down
31 changes: 29 additions & 2 deletions src/main/java/com/datadog/api/client/v2/model/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)
Expand All @@ -214,14 +240,15 @@ 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
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading