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
18 changes: 18 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20118,9 +20118,27 @@ components:
description: Color palette to apply to the widget.
type: string
type: object
TimeseriesWidgetAnomalyDetection:
description: Anomaly detection configuration for a timeseries widget.
properties:
detection_sensitivity:
$ref: "#/components/schemas/TimeseriesWidgetAnomalyDetectionSensitivity"
required:
- detection_sensitivity
type: object
TimeseriesWidgetAnomalyDetectionSensitivity:
description: Sensitivity level for anomaly detection. Use `never_detect` to disable anomaly detection.
enum:
- never_detect
example: never_detect
type: string
x-enum-varnames:
- NEVER_DETECT
TimeseriesWidgetDefinition:
description: The timeseries visualization allows you to display the evolution of one or more metrics, log events, or Indexed Spans over time.
properties:
anomaly_detection:
$ref: "#/components/schemas/TimeseriesWidgetAnomalyDetection"
custom_links:
description: List of custom links.
items:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* 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;

/** Anomaly detection configuration for a timeseries widget. */
@JsonPropertyOrder({TimeseriesWidgetAnomalyDetection.JSON_PROPERTY_DETECTION_SENSITIVITY})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class TimeseriesWidgetAnomalyDetection {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_DETECTION_SENSITIVITY = "detection_sensitivity";
private TimeseriesWidgetAnomalyDetectionSensitivity detectionSensitivity;

public TimeseriesWidgetAnomalyDetection() {}

@JsonCreator
public TimeseriesWidgetAnomalyDetection(
@JsonProperty(required = true, value = JSON_PROPERTY_DETECTION_SENSITIVITY)
TimeseriesWidgetAnomalyDetectionSensitivity detectionSensitivity) {
this.detectionSensitivity = detectionSensitivity;
this.unparsed |= !detectionSensitivity.isValid();
}

public TimeseriesWidgetAnomalyDetection detectionSensitivity(
TimeseriesWidgetAnomalyDetectionSensitivity detectionSensitivity) {
this.detectionSensitivity = detectionSensitivity;
this.unparsed |= !detectionSensitivity.isValid();
return this;
}

/**
* Sensitivity level for anomaly detection. Use <code>never_detect</code> to disable anomaly
* detection.
*
* @return detectionSensitivity
*/
@JsonProperty(JSON_PROPERTY_DETECTION_SENSITIVITY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public TimeseriesWidgetAnomalyDetectionSensitivity getDetectionSensitivity() {
return detectionSensitivity;
}

public void setDetectionSensitivity(
TimeseriesWidgetAnomalyDetectionSensitivity detectionSensitivity) {
if (!detectionSensitivity.isValid()) {
this.unparsed = true;
}
this.detectionSensitivity = detectionSensitivity;
}

/**
* 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 TimeseriesWidgetAnomalyDetection
*/
@JsonAnySetter
public TimeseriesWidgetAnomalyDetection 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 TimeseriesWidgetAnomalyDetection object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TimeseriesWidgetAnomalyDetection timeseriesWidgetAnomalyDetection =
(TimeseriesWidgetAnomalyDetection) o;
return Objects.equals(
this.detectionSensitivity, timeseriesWidgetAnomalyDetection.detectionSensitivity)
&& Objects.equals(
this.additionalProperties, timeseriesWidgetAnomalyDetection.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(detectionSensitivity, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TimeseriesWidgetAnomalyDetection {\n");
sb.append(" detectionSensitivity: ")
.append(toIndentedString(detectionSensitivity))
.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 ");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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;

/**
* Sensitivity level for anomaly detection. Use <code>never_detect</code> to disable anomaly
* detection.
*/
@JsonSerialize(
using =
TimeseriesWidgetAnomalyDetectionSensitivity
.TimeseriesWidgetAnomalyDetectionSensitivitySerializer.class)
public class TimeseriesWidgetAnomalyDetectionSensitivity extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("never_detect"));

public static final TimeseriesWidgetAnomalyDetectionSensitivity NEVER_DETECT =
new TimeseriesWidgetAnomalyDetectionSensitivity("never_detect");

TimeseriesWidgetAnomalyDetectionSensitivity(String value) {
super(value, allowedValues);
}

public static class TimeseriesWidgetAnomalyDetectionSensitivitySerializer
extends StdSerializer<TimeseriesWidgetAnomalyDetectionSensitivity> {
public TimeseriesWidgetAnomalyDetectionSensitivitySerializer(
Class<TimeseriesWidgetAnomalyDetectionSensitivity> t) {
super(t);
}

public TimeseriesWidgetAnomalyDetectionSensitivitySerializer() {
this(null);
}

@Override
public void serialize(
TimeseriesWidgetAnomalyDetectionSensitivity value,
JsonGenerator jgen,
SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static TimeseriesWidgetAnomalyDetectionSensitivity fromValue(String value) {
return new TimeseriesWidgetAnomalyDetectionSensitivity(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* events, or Indexed Spans over time.
*/
@JsonPropertyOrder({
TimeseriesWidgetDefinition.JSON_PROPERTY_ANOMALY_DETECTION,
TimeseriesWidgetDefinition.JSON_PROPERTY_CUSTOM_LINKS,
TimeseriesWidgetDefinition.JSON_PROPERTY_DESCRIPTION,
TimeseriesWidgetDefinition.JSON_PROPERTY_EVENTS,
Expand All @@ -45,6 +46,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class TimeseriesWidgetDefinition {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ANOMALY_DETECTION = "anomaly_detection";
private TimeseriesWidgetAnomalyDetection anomalyDetection;

public static final String JSON_PROPERTY_CUSTOM_LINKS = "custom_links";
private List<WidgetCustomLink> customLinks = null;

Expand Down Expand Up @@ -106,6 +110,29 @@ public TimeseriesWidgetDefinition(
this.unparsed |= !type.isValid();
}

public TimeseriesWidgetDefinition anomalyDetection(
TimeseriesWidgetAnomalyDetection anomalyDetection) {
this.anomalyDetection = anomalyDetection;
this.unparsed |= anomalyDetection.unparsed;
return this;
}

/**
* Anomaly detection configuration for a timeseries widget.
*
* @return anomalyDetection
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ANOMALY_DETECTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TimeseriesWidgetAnomalyDetection getAnomalyDetection() {
return anomalyDetection;
}

public void setAnomalyDetection(TimeseriesWidgetAnomalyDetection anomalyDetection) {
this.anomalyDetection = anomalyDetection;
}

public TimeseriesWidgetDefinition customLinks(List<WidgetCustomLink> customLinks) {
this.customLinks = customLinks;
for (WidgetCustomLink item : customLinks) {
Expand Down Expand Up @@ -570,7 +597,8 @@ public boolean equals(Object o) {
return false;
}
TimeseriesWidgetDefinition timeseriesWidgetDefinition = (TimeseriesWidgetDefinition) o;
return Objects.equals(this.customLinks, timeseriesWidgetDefinition.customLinks)
return Objects.equals(this.anomalyDetection, timeseriesWidgetDefinition.anomalyDetection)
&& Objects.equals(this.customLinks, timeseriesWidgetDefinition.customLinks)
&& Objects.equals(this.description, timeseriesWidgetDefinition.description)
&& Objects.equals(this.events, timeseriesWidgetDefinition.events)
&& Objects.equals(this.legendColumns, timeseriesWidgetDefinition.legendColumns)
Expand All @@ -593,6 +621,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
anomalyDetection,
customLinks,
description,
events,
Expand All @@ -616,6 +645,7 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TimeseriesWidgetDefinition {\n");
sb.append(" anomalyDetection: ").append(toIndentedString(anomalyDetection)).append("\n");
sb.append(" customLinks: ").append(toIndentedString(customLinks)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" events: ").append(toIndentedString(events)).append("\n");
Expand Down
Loading