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
37 changes: 37 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/datadog/api/client/v1/model/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<String> description = JsonNullable.<String>undefined();

Expand Down Expand Up @@ -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 <code>null</code> 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.<String>of(description);
return this;
Expand Down Expand Up @@ -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)
Expand All @@ -702,6 +729,7 @@ public int hashCode() {
authorHandle,
authorName,
createdAt,
defaultTimeframe,
description,
id,
isReadOnly,
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <code>type</code> is <code>fixed</code>.
*
* @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 <code>type</code> is <code>fixed</code>.
*
* @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 <code>type</code> is <code>live</code>.
*
* @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<String, Object> 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<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> 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 ");
}
}
Loading
Loading