From 856d68f525fcc40595e0219f45fe8d1874b9ce4b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 3 Jun 2026 06:09:58 +0000 Subject: [PATCH] Regenerate client from commit aae4d03 of spec repo --- .generator/schemas/v1/openapi.yaml | 37 +++ .../api/client/v1/model/Dashboard.java | 29 ++ .../v1/model/DashboardDefaultTimeframe.java | 264 ++++++++++++++++++ .../model/DashboardDefaultTimeframeType.java | 59 ++++ .../v1/model/DashboarddefaultTimeframe.java | 110 ++++++++ 5 files changed, 499 insertions(+) create mode 100644 src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframe.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframeType.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/DashboarddefaultTimeframe.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 0040506a554..e33c520e69e 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1443,6 +1443,10 @@ components: format: date-time readOnly: true type: string + default_timeframe: + allOf: + - $ref: "#/components/schemas/DashboardDefaultTimeframe" + description: The default timeframe applied when opening the dashboard. Set to `null` to reset after it has been configured. description: description: Description of the dashboard. nullable: true @@ -1557,6 +1561,39 @@ components: required: - data type: object + DashboardDefaultTimeframe: + description: The default timeframe applied when opening the dashboard. + nullable: true + properties: + from: + description: Start time in milliseconds since epoch. Required when `type` is `fixed`. + format: int64 + type: integer + to: + description: End time in milliseconds since epoch. Required when `type` is `fixed`. + format: int64 + type: integer + type: + $ref: "#/components/schemas/DashboardDefaultTimeframeType" + unit: + $ref: "#/components/schemas/WidgetLiveSpanUnit" + value: + description: Value of the live timeframe span. Required when `type` is `live`. + format: int64 + type: integer + required: + - type + type: object + DashboardDefaultTimeframeType: + description: Type of timeframe. + enum: + - live + - fixed + example: live + type: string + x-enum-varnames: + - LIVE + - FIXED DashboardDeleteResponse: description: Response from the delete dashboard call. properties: diff --git a/src/main/java/com/datadog/api/client/v1/model/Dashboard.java b/src/main/java/com/datadog/api/client/v1/model/Dashboard.java index eed5de68911..77640e96074 100644 --- a/src/main/java/com/datadog/api/client/v1/model/Dashboard.java +++ b/src/main/java/com/datadog/api/client/v1/model/Dashboard.java @@ -29,6 +29,7 @@ Dashboard.JSON_PROPERTY_AUTHOR_HANDLE, Dashboard.JSON_PROPERTY_AUTHOR_NAME, Dashboard.JSON_PROPERTY_CREATED_AT, + Dashboard.JSON_PROPERTY_DEFAULT_TIMEFRAME, Dashboard.JSON_PROPERTY_DESCRIPTION, Dashboard.JSON_PROPERTY_ID, Dashboard.JSON_PROPERTY_IS_READ_ONLY, @@ -58,6 +59,9 @@ public class Dashboard { public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_DEFAULT_TIMEFRAME = "default_timeframe"; + private Object defaultTimeframe = null; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private JsonNullable description = JsonNullable.undefined(); @@ -169,6 +173,28 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + public Dashboard defaultTimeframe(Object defaultTimeframe) { + this.defaultTimeframe = defaultTimeframe; + return this; + } + + /** + * The default timeframe applied when opening the dashboard. Set to null to reset + * after it has been configured. + * + * @return defaultTimeframe + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_TIMEFRAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getDefaultTimeframe() { + return defaultTimeframe; + } + + public void setDefaultTimeframe(Object defaultTimeframe) { + this.defaultTimeframe = defaultTimeframe; + } + public Dashboard description(String description) { this.description = JsonNullable.of(description); return this; @@ -678,6 +704,7 @@ public boolean equals(Object o) { return Objects.equals(this.authorHandle, dashboard.authorHandle) && Objects.equals(this.authorName, dashboard.authorName) && Objects.equals(this.createdAt, dashboard.createdAt) + && Objects.equals(this.defaultTimeframe, dashboard.defaultTimeframe) && Objects.equals(this.description, dashboard.description) && Objects.equals(this.id, dashboard.id) && Objects.equals(this.isReadOnly, dashboard.isReadOnly) @@ -702,6 +729,7 @@ public int hashCode() { authorHandle, authorName, createdAt, + defaultTimeframe, description, id, isReadOnly, @@ -727,6 +755,7 @@ public String toString() { sb.append(" authorHandle: ").append(toIndentedString(authorHandle)).append("\n"); sb.append(" authorName: ").append(toIndentedString(authorName)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" defaultTimeframe: ").append(toIndentedString(defaultTimeframe)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" isReadOnly: ").append(toIndentedString(isReadOnly)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframe.java b/src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframe.java new file mode 100644 index 00000000000..1c49f1423d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframe.java @@ -0,0 +1,264 @@ +/* + * 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.v1.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; + +/** The default timeframe applied when opening the dashboard. */ +@JsonPropertyOrder({ + DashboardDefaultTimeframe.JSON_PROPERTY_FROM, + DashboardDefaultTimeframe.JSON_PROPERTY_TO, + DashboardDefaultTimeframe.JSON_PROPERTY_TYPE, + DashboardDefaultTimeframe.JSON_PROPERTY_UNIT, + DashboardDefaultTimeframe.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardDefaultTimeframe { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DashboardDefaultTimeframeType type; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private WidgetLiveSpanUnit unit; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public DashboardDefaultTimeframe() {} + + @JsonCreator + public DashboardDefaultTimeframe( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DashboardDefaultTimeframeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DashboardDefaultTimeframe from(Long from) { + this.from = from; + return this; + } + + /** + * Start time in milliseconds since epoch. Required when type is fixed. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public DashboardDefaultTimeframe to(Long to) { + this.to = to; + return this; + } + + /** + * End time in milliseconds since epoch. Required when type is fixed. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + public DashboardDefaultTimeframe type(DashboardDefaultTimeframeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of timeframe. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardDefaultTimeframeType getType() { + return type; + } + + public void setType(DashboardDefaultTimeframeType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public DashboardDefaultTimeframe unit(WidgetLiveSpanUnit unit) { + this.unit = unit; + this.unparsed |= !unit.isValid(); + return this; + } + + /** + * Unit of the time span. + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetLiveSpanUnit getUnit() { + return unit; + } + + public void setUnit(WidgetLiveSpanUnit unit) { + if (!unit.isValid()) { + this.unparsed = true; + } + this.unit = unit; + } + + public DashboardDefaultTimeframe value(Long value) { + this.value = value; + return this; + } + + /** + * Value of the live timeframe span. Required when type is live. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + /** + * 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 DashboardDefaultTimeframe + */ + @JsonAnySetter + public DashboardDefaultTimeframe 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 DashboardDefaultTimeframe object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardDefaultTimeframe dashboardDefaultTimeframe = (DashboardDefaultTimeframe) o; + return Objects.equals(this.from, dashboardDefaultTimeframe.from) + && Objects.equals(this.to, dashboardDefaultTimeframe.to) + && Objects.equals(this.type, dashboardDefaultTimeframe.type) + && Objects.equals(this.unit, dashboardDefaultTimeframe.unit) + && Objects.equals(this.value, dashboardDefaultTimeframe.value) + && Objects.equals( + this.additionalProperties, dashboardDefaultTimeframe.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, type, unit, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardDefaultTimeframe {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/v1/model/DashboardDefaultTimeframeType.java b/src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframeType.java new file mode 100644 index 00000000000..c0caa4f5e43 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/DashboardDefaultTimeframeType.java @@ -0,0 +1,59 @@ +/* + * 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.v1.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; + +/** Type of timeframe. */ +@JsonSerialize(using = DashboardDefaultTimeframeType.DashboardDefaultTimeframeTypeSerializer.class) +public class DashboardDefaultTimeframeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("live", "fixed")); + + public static final DashboardDefaultTimeframeType LIVE = + new DashboardDefaultTimeframeType("live"); + public static final DashboardDefaultTimeframeType FIXED = + new DashboardDefaultTimeframeType("fixed"); + + DashboardDefaultTimeframeType(String value) { + super(value, allowedValues); + } + + public static class DashboardDefaultTimeframeTypeSerializer + extends StdSerializer { + public DashboardDefaultTimeframeTypeSerializer(Class t) { + super(t); + } + + public DashboardDefaultTimeframeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DashboardDefaultTimeframeType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DashboardDefaultTimeframeType fromValue(String value) { + return new DashboardDefaultTimeframeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/DashboarddefaultTimeframe.java b/src/main/java/com/datadog/api/client/v1/model/DashboarddefaultTimeframe.java new file mode 100644 index 00000000000..d2feea37fc8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/DashboarddefaultTimeframe.java @@ -0,0 +1,110 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The default timeframe applied when opening the dashboard. Set to null to reset after + * it has been configured. + */ +@JsonPropertyOrder({}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboarddefaultTimeframe { + @JsonIgnore public boolean unparsed = false; + + /** + * 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 DashboarddefaultTimeframe + */ + @JsonAnySetter + public DashboarddefaultTimeframe 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 DashboarddefaultTimeframe object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboarddefaultTimeframe {\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 "); + } +}