Skip to content

Commit e79602a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e0406ea of spec repo
1 parent 666304d commit e79602a

18 files changed

Lines changed: 1648 additions & 22 deletions

‎.generator/schemas/v1/openapi.yaml‎

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4612,10 +4612,14 @@ components:
46124612
- $ref: "#/components/schemas/HeatgridThemeColors"
46134613
HeatgridColorBin:
46144614
additionalProperties: false
4615-
description: A color and optional lower threshold for a discrete bin.
4615+
description: A color, optional lower threshold, and optional label for a discrete bin.
46164616
properties:
46174617
color:
46184618
$ref: "#/components/schemas/HeatgridColor"
4619+
label:
4620+
description: Name of the bin.
4621+
maxLength: 255
4622+
type: string
46194623
lower_bound:
46204624
description: Inclusive lower bound. Omit for the first bin.
46214625
format: double
@@ -4749,12 +4753,15 @@ components:
47494753
type: object
47504754
HeatgridLabelColumn:
47514755
additionalProperties: false
4752-
description: Configuration of the group label column.
4756+
description: Configuration of the group label column. Its width is sized automatically when omitted.
47534757
properties:
4758+
text_formats:
4759+
description: Ordered string replacement rules for the group labels.
4760+
items:
4761+
$ref: "#/components/schemas/HeatgridTextFormatRule"
4762+
type: array
47544763
width:
47554764
$ref: "#/components/schemas/HeatgridLabelColumnWidth"
4756-
required:
4757-
- width
47584765
type: object
47594766
HeatgridLabelColumnWidth:
47604767
description: Width of the label column.
@@ -4880,6 +4887,107 @@ components:
48804887
x-enum-varnames:
48814888
- ASC
48824889
- DESC
4890+
HeatgridTextFormatMatch:
4891+
additionalProperties: false
4892+
description: Match a group label against a string.
4893+
properties:
4894+
type:
4895+
$ref: "#/components/schemas/HeatgridTextFormatMatchType"
4896+
value:
4897+
description: String to compare with the group label.
4898+
example: ""
4899+
maxLength: 255
4900+
type: string
4901+
required:
4902+
- type
4903+
- value
4904+
type: object
4905+
HeatgridTextFormatMatchType:
4906+
description: Comparison used to match a group label.
4907+
enum:
4908+
- is
4909+
- is_not
4910+
- contains
4911+
- does_not_contain
4912+
- starts_with
4913+
- ends_with
4914+
example: is
4915+
type: string
4916+
x-enum-varnames:
4917+
- IS
4918+
- IS_NOT
4919+
- CONTAINS
4920+
- DOES_NOT_CONTAIN
4921+
- STARTS_WITH
4922+
- ENDS_WITH
4923+
HeatgridTextFormatReplace:
4924+
description: Replace all or part of a matching group label.
4925+
oneOf:
4926+
- $ref: "#/components/schemas/HeatgridTextFormatReplaceAll"
4927+
- $ref: "#/components/schemas/HeatgridTextFormatReplaceSubstring"
4928+
HeatgridTextFormatReplaceAll:
4929+
additionalProperties: false
4930+
description: Replace the entire matching group label.
4931+
properties:
4932+
type:
4933+
$ref: "#/components/schemas/HeatgridTextFormatReplaceAllType"
4934+
with:
4935+
description: Replacement string.
4936+
example: ""
4937+
maxLength: 255
4938+
type: string
4939+
required:
4940+
- type
4941+
- with
4942+
type: object
4943+
HeatgridTextFormatReplaceAllType:
4944+
description: Replace the entire matching group label.
4945+
enum:
4946+
- all
4947+
example: all
4948+
type: string
4949+
x-enum-varnames:
4950+
- ALL
4951+
HeatgridTextFormatReplaceSubstring:
4952+
additionalProperties: false
4953+
description: Replace a substring of the matching group label.
4954+
properties:
4955+
substring:
4956+
description: Substring to replace.
4957+
example: ""
4958+
maxLength: 255
4959+
type: string
4960+
type:
4961+
$ref: "#/components/schemas/HeatgridTextFormatReplaceSubstringType"
4962+
with:
4963+
description: Replacement string.
4964+
example: ""
4965+
maxLength: 255
4966+
type: string
4967+
required:
4968+
- type
4969+
- substring
4970+
- with
4971+
type: object
4972+
HeatgridTextFormatReplaceSubstringType:
4973+
description: Replace a substring of a matching group label.
4974+
enum:
4975+
- substring
4976+
example: substring
4977+
type: string
4978+
x-enum-varnames:
4979+
- SUBSTRING
4980+
HeatgridTextFormatRule:
4981+
additionalProperties: false
4982+
description: A rule for matching and optionally replacing a group label.
4983+
properties:
4984+
match:
4985+
$ref: "#/components/schemas/HeatgridTextFormatMatch"
4986+
replace:
4987+
$ref: "#/components/schemas/HeatgridTextFormatReplace"
4988+
required:
4989+
- match
4990+
type: object
48834991
HeatgridThemeColors:
48844992
description: Two color strings for the light and dark themes, in that order.
48854993
example: ["#FFFFFF", "#000000"]
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
// Create a heatgrid widget with bin labels and formatted row labels
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v1.api.DashboardsApi;
6+
import com.datadog.api.client.v1.model.Dashboard;
7+
import com.datadog.api.client.v1.model.DashboardLayoutType;
8+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource;
9+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition;
10+
import com.datadog.api.client.v1.model.FormulaAndFunctionQueryDefinition;
11+
import com.datadog.api.client.v1.model.HeatgridColor;
12+
import com.datadog.api.client.v1.model.HeatgridColorBin;
13+
import com.datadog.api.client.v1.model.HeatgridColorConfig;
14+
import com.datadog.api.client.v1.model.HeatgridCustomColorSource;
15+
import com.datadog.api.client.v1.model.HeatgridDiscreteCustomColor;
16+
import com.datadog.api.client.v1.model.HeatgridDiscreteMode;
17+
import com.datadog.api.client.v1.model.HeatgridLabelColumn;
18+
import com.datadog.api.client.v1.model.HeatgridNestingDisplay;
19+
import com.datadog.api.client.v1.model.HeatgridSort;
20+
import com.datadog.api.client.v1.model.HeatgridSortBy;
21+
import com.datadog.api.client.v1.model.HeatgridSortByLabel;
22+
import com.datadog.api.client.v1.model.HeatgridSortByLabelProperty;
23+
import com.datadog.api.client.v1.model.HeatgridSortOrder;
24+
import com.datadog.api.client.v1.model.HeatgridTextFormatMatch;
25+
import com.datadog.api.client.v1.model.HeatgridTextFormatMatchType;
26+
import com.datadog.api.client.v1.model.HeatgridTextFormatReplace;
27+
import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceAll;
28+
import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceAllType;
29+
import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceSubstring;
30+
import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceSubstringType;
31+
import com.datadog.api.client.v1.model.HeatgridTextFormatRule;
32+
import com.datadog.api.client.v1.model.HeatgridWidgetDefinition;
33+
import com.datadog.api.client.v1.model.HeatgridWidgetDefinitionType;
34+
import com.datadog.api.client.v1.model.HeatgridWidgetFormula;
35+
import com.datadog.api.client.v1.model.HeatgridWidgetRequest;
36+
import com.datadog.api.client.v1.model.HeatgridWidgetResponseFormat;
37+
import com.datadog.api.client.v1.model.Widget;
38+
import com.datadog.api.client.v1.model.WidgetDefinition;
39+
import java.util.Arrays;
40+
import java.util.Collections;
41+
42+
public class Example {
43+
public static void main(String[] args) {
44+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
45+
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
46+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
47+
48+
Dashboard body =
49+
new Dashboard()
50+
.title("Example-Dashboard")
51+
.layoutType(DashboardLayoutType.ORDERED)
52+
.widgets(
53+
Collections.singletonList(
54+
new Widget()
55+
.definition(
56+
new WidgetDefinition(
57+
new HeatgridWidgetDefinition()
58+
.type(HeatgridWidgetDefinitionType.HEATGRID)
59+
.requests(
60+
Collections.singletonList(
61+
new HeatgridWidgetRequest()
62+
.responseFormat(
63+
HeatgridWidgetResponseFormat.TIMESERIES)
64+
.queries(
65+
Collections.singletonList(
66+
new FormulaAndFunctionQueryDefinition(
67+
new FormulaAndFunctionMetricQueryDefinition()
68+
.dataSource(
69+
FormulaAndFunctionMetricDataSource
70+
.METRICS)
71+
.name("query1")
72+
.query(
73+
"avg:system.cpu.user{*} by"
74+
+ " {host}"))))
75+
.formulas(
76+
Collections.singletonList(
77+
new HeatgridWidgetFormula()
78+
.formula("query1")))))
79+
.sort(
80+
new HeatgridSort()
81+
.nestingDisplay(HeatgridNestingDisplay.FLAT)
82+
.sortBy(
83+
new HeatgridSortBy(
84+
new HeatgridSortByLabel()
85+
.property(HeatgridSortByLabelProperty.LABEL)
86+
.order(HeatgridSortOrder.ASC))))
87+
.color(
88+
new HeatgridColorConfig(
89+
new HeatgridDiscreteCustomColor()
90+
.mode(HeatgridDiscreteMode.DISCRETE)
91+
.source(HeatgridCustomColorSource.CUSTOM)
92+
.bins(
93+
Arrays.asList(
94+
new HeatgridColorBin()
95+
.color(new HeatgridColor("#00FF00"))
96+
.label("Normal"),
97+
new HeatgridColorBin()
98+
.color(new HeatgridColor("#FF0000"))
99+
.lowerBound(80.0)
100+
.label("High")))))
101+
.labelColumn(
102+
new HeatgridLabelColumn()
103+
.textFormats(
104+
Arrays.asList(
105+
new HeatgridTextFormatRule()
106+
.match(
107+
new HeatgridTextFormatMatch()
108+
.type(
109+
HeatgridTextFormatMatchType
110+
.STARTS_WITH)
111+
.value("api-"))
112+
.replace(
113+
new HeatgridTextFormatReplace(
114+
new HeatgridTextFormatReplaceSubstring()
115+
.type(
116+
HeatgridTextFormatReplaceSubstringType
117+
.SUBSTRING)
118+
.substring("api-")
119+
.with(""))),
120+
new HeatgridTextFormatRule()
121+
.match(
122+
new HeatgridTextFormatMatch()
123+
.type(
124+
HeatgridTextFormatMatchType.IS)
125+
.value("unknown"))
126+
.replace(
127+
new HeatgridTextFormatReplace(
128+
new HeatgridTextFormatReplaceAll()
129+
.type(
130+
HeatgridTextFormatReplaceAllType
131+
.ALL)
132+
.with("Other"))))))))));
133+
134+
try {
135+
Dashboard result = apiInstance.createDashboard(body);
136+
System.out.println(result);
137+
} catch (ApiException e) {
138+
System.err.println("Exception when calling DashboardsApi#createDashboard");
139+
System.err.println("Status code: " + e.getCode());
140+
System.err.println("Reason: " + e.getResponseBody());
141+
System.err.println("Response headers: " + e.getResponseHeaders());
142+
e.printStackTrace();
143+
}
144+
}
145+
}

‎src/main/java/com/datadog/api/client/v1/model/HeatgridColorBin.java‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
1414
import java.util.Objects;
1515

16-
/** A color and optional lower threshold for a discrete bin. */
16+
/** A color, optional lower threshold, and optional label for a discrete bin. */
1717
@JsonPropertyOrder({
1818
HeatgridColorBin.JSON_PROPERTY_COLOR,
19+
HeatgridColorBin.JSON_PROPERTY_LABEL,
1920
HeatgridColorBin.JSON_PROPERTY_LOWER_BOUND
2021
})
2122
@jakarta.annotation.Generated(
@@ -25,6 +26,9 @@ public class HeatgridColorBin {
2526
public static final String JSON_PROPERTY_COLOR = "color";
2627
private HeatgridColor color;
2728

29+
public static final String JSON_PROPERTY_LABEL = "label";
30+
private String label;
31+
2832
public static final String JSON_PROPERTY_LOWER_BOUND = "lower_bound";
2933
private Double lowerBound;
3034

@@ -61,6 +65,27 @@ public void setColor(HeatgridColor color) {
6165
}
6266
}
6367

68+
public HeatgridColorBin label(String label) {
69+
this.label = label;
70+
return this;
71+
}
72+
73+
/**
74+
* Name of the bin.
75+
*
76+
* @return label
77+
*/
78+
@jakarta.annotation.Nullable
79+
@JsonProperty(JSON_PROPERTY_LABEL)
80+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
81+
public String getLabel() {
82+
return label;
83+
}
84+
85+
public void setLabel(String label) {
86+
this.label = label;
87+
}
88+
6489
public HeatgridColorBin lowerBound(Double lowerBound) {
6590
this.lowerBound = lowerBound;
6691
return this;
@@ -93,19 +118,21 @@ public boolean equals(Object o) {
93118
}
94119
HeatgridColorBin heatgridColorBin = (HeatgridColorBin) o;
95120
return Objects.equals(this.color, heatgridColorBin.color)
121+
&& Objects.equals(this.label, heatgridColorBin.label)
96122
&& Objects.equals(this.lowerBound, heatgridColorBin.lowerBound);
97123
}
98124

99125
@Override
100126
public int hashCode() {
101-
return Objects.hash(color, lowerBound);
127+
return Objects.hash(color, label, lowerBound);
102128
}
103129

104130
@Override
105131
public String toString() {
106132
StringBuilder sb = new StringBuilder();
107133
sb.append("class HeatgridColorBin {\n");
108134
sb.append(" color: ").append(toIndentedString(color)).append("\n");
135+
sb.append(" label: ").append(toIndentedString(label)).append("\n");
109136
sb.append(" lowerBound: ").append(toIndentedString(lowerBound)).append("\n");
110137
sb.append('}');
111138
return sb.toString();

0 commit comments

Comments
 (0)