Skip to content

Commit 9564ba2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b12a417 of spec repo
1 parent adffdd0 commit 9564ba2

File tree

5 files changed

+177
-21
lines changed

5 files changed

+177
-21
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.5.1.dev2",
7-
"regenerated": "2021-11-12 11:37:21.745481",
8-
"spec_repo_commit": "fabbc01"
7+
"regenerated": "2021-11-12 14:56:46.961784",
8+
"spec_repo_commit": "b12a417"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2021-11-12 11:37:23.046131",
13-
"spec_repo_commit": "fabbc01"
12+
"regenerated": "2021-11-12 14:56:48.284216",
13+
"spec_repo_commit": "b12a417"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,12 @@ components:
736736
$ref: '#/components/schemas/WidgetCompareTo'
737737
event_query:
738738
$ref: '#/components/schemas/LogQueryDefinition'
739+
formulas:
740+
description: List of formulas that operate on queries. **This feature is
741+
currently in beta.**
742+
items:
743+
$ref: '#/components/schemas/WidgetFormula'
744+
type: array
739745
increase_good:
740746
description: Whether to show increase as good.
741747
type: boolean
@@ -754,6 +760,14 @@ components:
754760
q:
755761
description: Query definition.
756762
type: string
763+
queries:
764+
description: List of queries that can be returned directly or used in formulas.
765+
**This feature is currently in beta.**
766+
items:
767+
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
768+
type: array
769+
response_format:
770+
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
757771
rum_query:
758772
$ref: '#/components/schemas/LogQueryDefinition'
759773
security_query:

api_docs/v1/ChangeWidgetRequest.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ Updated change widget.
44

55
## Properties
66

7-
| Name | Type | Description | Notes |
8-
| ----------------------- | ------------------------------------------------------- | ---------------------------------- | ---------- |
9-
| **apmQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
10-
| **changeType** | **WidgetChangeType** | | [optional] |
11-
| **compareTo** | **WidgetCompareTo** | | [optional] |
12-
| **eventQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
13-
| **increaseGood** | **Boolean** | Whether to show increase as good. | [optional] |
14-
| **logQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
15-
| **networkQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
16-
| **orderBy** | **WidgetOrderBy** | | [optional] |
17-
| **orderDir** | **WidgetSort** | | [optional] |
18-
| **processQuery** | [**ProcessQueryDefinition**](ProcessQueryDefinition.md) | | [optional] |
19-
| **profileMetricsQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
20-
| **q** | **String** | Query definition. | [optional] |
21-
| **rumQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
22-
| **securityQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
23-
| **showPresent** | **Boolean** | Whether to show the present value. | [optional] |
7+
| Name | Type | Description | Notes |
8+
| ----------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------- |
9+
| **apmQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
10+
| **changeType** | **WidgetChangeType** | | [optional] |
11+
| **compareTo** | **WidgetCompareTo** | | [optional] |
12+
| **eventQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
13+
| **formulas** | [**List<WidgetFormula>**](WidgetFormula.md) | List of formulas that operate on queries. **This feature is currently in beta.** | [optional] |
14+
| **increaseGood** | **Boolean** | Whether to show increase as good. | [optional] |
15+
| **logQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
16+
| **networkQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
17+
| **orderBy** | **WidgetOrderBy** | | [optional] |
18+
| **orderDir** | **WidgetSort** | | [optional] |
19+
| **processQuery** | [**ProcessQueryDefinition**](ProcessQueryDefinition.md) | | [optional] |
20+
| **profileMetricsQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
21+
| **q** | **String** | Query definition. | [optional] |
22+
| **queries** | [**List<FormulaAndFunctionQueryDefinition>**](FormulaAndFunctionQueryDefinition.md) | List of queries that can be returned directly or used in formulas. **This feature is currently in beta.** | [optional] |
23+
| **responseFormat** | **FormulaAndFunctionResponseFormat** | | [optional] |
24+
| **rumQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
25+
| **securityQuery** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] |
26+
| **showPresent** | **Boolean** | Whether to show the present value. | [optional] |

src/main/java/com/datadog/api/v1/client/model/ChangeWidgetRequest.java

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
1717
import io.swagger.annotations.ApiModel;
1818
import io.swagger.annotations.ApiModelProperty;
19+
import java.util.ArrayList;
20+
import java.util.List;
1921
import java.util.Objects;
2022

2123
/** Updated change widget. */
@@ -25,6 +27,7 @@
2527
ChangeWidgetRequest.JSON_PROPERTY_CHANGE_TYPE,
2628
ChangeWidgetRequest.JSON_PROPERTY_COMPARE_TO,
2729
ChangeWidgetRequest.JSON_PROPERTY_EVENT_QUERY,
30+
ChangeWidgetRequest.JSON_PROPERTY_FORMULAS,
2831
ChangeWidgetRequest.JSON_PROPERTY_INCREASE_GOOD,
2932
ChangeWidgetRequest.JSON_PROPERTY_LOG_QUERY,
3033
ChangeWidgetRequest.JSON_PROPERTY_NETWORK_QUERY,
@@ -33,6 +36,8 @@
3336
ChangeWidgetRequest.JSON_PROPERTY_PROCESS_QUERY,
3437
ChangeWidgetRequest.JSON_PROPERTY_PROFILE_METRICS_QUERY,
3538
ChangeWidgetRequest.JSON_PROPERTY_Q,
39+
ChangeWidgetRequest.JSON_PROPERTY_QUERIES,
40+
ChangeWidgetRequest.JSON_PROPERTY_RESPONSE_FORMAT,
3641
ChangeWidgetRequest.JSON_PROPERTY_RUM_QUERY,
3742
ChangeWidgetRequest.JSON_PROPERTY_SECURITY_QUERY,
3843
ChangeWidgetRequest.JSON_PROPERTY_SHOW_PRESENT
@@ -52,6 +57,9 @@ public class ChangeWidgetRequest {
5257
public static final String JSON_PROPERTY_EVENT_QUERY = "event_query";
5358
private LogQueryDefinition eventQuery;
5459

60+
public static final String JSON_PROPERTY_FORMULAS = "formulas";
61+
private List<WidgetFormula> formulas = null;
62+
5563
public static final String JSON_PROPERTY_INCREASE_GOOD = "increase_good";
5664
private Boolean increaseGood;
5765

@@ -76,6 +84,12 @@ public class ChangeWidgetRequest {
7684
public static final String JSON_PROPERTY_Q = "q";
7785
private String q;
7886

87+
public static final String JSON_PROPERTY_QUERIES = "queries";
88+
private List<FormulaAndFunctionQueryDefinition> queries = null;
89+
90+
public static final String JSON_PROPERTY_RESPONSE_FORMAT = "response_format";
91+
private FormulaAndFunctionResponseFormat responseFormat;
92+
7993
public static final String JSON_PROPERTY_RUM_QUERY = "rum_query";
8094
private LogQueryDefinition rumQuery;
8195

@@ -183,6 +197,41 @@ public void setEventQuery(LogQueryDefinition eventQuery) {
183197
this.eventQuery = eventQuery;
184198
}
185199

200+
public ChangeWidgetRequest formulas(List<WidgetFormula> formulas) {
201+
this.formulas = formulas;
202+
for (WidgetFormula item : formulas) {
203+
this.unparsed |= item.unparsed;
204+
}
205+
return this;
206+
}
207+
208+
public ChangeWidgetRequest addFormulasItem(WidgetFormula formulasItem) {
209+
if (this.formulas == null) {
210+
this.formulas = new ArrayList<>();
211+
}
212+
this.formulas.add(formulasItem);
213+
this.unparsed |= formulasItem.unparsed;
214+
return this;
215+
}
216+
217+
/**
218+
* List of formulas that operate on queries. **This feature is currently in beta.**
219+
*
220+
* @return formulas
221+
*/
222+
@javax.annotation.Nullable
223+
@ApiModelProperty(
224+
value = "List of formulas that operate on queries. **This feature is currently in beta.**")
225+
@JsonProperty(JSON_PROPERTY_FORMULAS)
226+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
227+
public List<WidgetFormula> getFormulas() {
228+
return formulas;
229+
}
230+
231+
public void setFormulas(List<WidgetFormula> formulas) {
232+
this.formulas = formulas;
233+
}
234+
186235
public ChangeWidgetRequest increaseGood(Boolean increaseGood) {
187236
this.increaseGood = increaseGood;
188237
return this;
@@ -371,6 +420,70 @@ public void setQ(String q) {
371420
this.q = q;
372421
}
373422

423+
public ChangeWidgetRequest queries(List<FormulaAndFunctionQueryDefinition> queries) {
424+
this.queries = queries;
425+
for (FormulaAndFunctionQueryDefinition item : queries) {
426+
this.unparsed |= item.unparsed;
427+
}
428+
return this;
429+
}
430+
431+
public ChangeWidgetRequest addQueriesItem(FormulaAndFunctionQueryDefinition queriesItem) {
432+
if (this.queries == null) {
433+
this.queries = new ArrayList<>();
434+
}
435+
this.queries.add(queriesItem);
436+
this.unparsed |= queriesItem.unparsed;
437+
return this;
438+
}
439+
440+
/**
441+
* List of queries that can be returned directly or used in formulas. **This feature is currently
442+
* in beta.**
443+
*
444+
* @return queries
445+
*/
446+
@javax.annotation.Nullable
447+
@ApiModelProperty(
448+
value =
449+
"List of queries that can be returned directly or used in formulas. **This feature is"
450+
+ " currently in beta.**")
451+
@JsonProperty(JSON_PROPERTY_QUERIES)
452+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
453+
public List<FormulaAndFunctionQueryDefinition> getQueries() {
454+
return queries;
455+
}
456+
457+
public void setQueries(List<FormulaAndFunctionQueryDefinition> queries) {
458+
this.queries = queries;
459+
}
460+
461+
public ChangeWidgetRequest responseFormat(FormulaAndFunctionResponseFormat responseFormat) {
462+
this.responseFormat = responseFormat;
463+
this.unparsed |= !responseFormat.isValid();
464+
return this;
465+
}
466+
467+
/**
468+
* Get responseFormat
469+
*
470+
* @return responseFormat
471+
*/
472+
@javax.annotation.Nullable
473+
@ApiModelProperty(value = "")
474+
@JsonProperty(JSON_PROPERTY_RESPONSE_FORMAT)
475+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
476+
public FormulaAndFunctionResponseFormat getResponseFormat() {
477+
return responseFormat;
478+
}
479+
480+
public void setResponseFormat(FormulaAndFunctionResponseFormat responseFormat) {
481+
if (!responseFormat.isValid()) {
482+
this.unparsed = true;
483+
}
484+
this.responseFormat = responseFormat;
485+
}
486+
374487
public ChangeWidgetRequest rumQuery(LogQueryDefinition rumQuery) {
375488
this.rumQuery = rumQuery;
376489
this.unparsed |= rumQuery.unparsed;
@@ -453,6 +566,7 @@ public boolean equals(Object o) {
453566
&& Objects.equals(this.changeType, changeWidgetRequest.changeType)
454567
&& Objects.equals(this.compareTo, changeWidgetRequest.compareTo)
455568
&& Objects.equals(this.eventQuery, changeWidgetRequest.eventQuery)
569+
&& Objects.equals(this.formulas, changeWidgetRequest.formulas)
456570
&& Objects.equals(this.increaseGood, changeWidgetRequest.increaseGood)
457571
&& Objects.equals(this.logQuery, changeWidgetRequest.logQuery)
458572
&& Objects.equals(this.networkQuery, changeWidgetRequest.networkQuery)
@@ -461,6 +575,8 @@ public boolean equals(Object o) {
461575
&& Objects.equals(this.processQuery, changeWidgetRequest.processQuery)
462576
&& Objects.equals(this.profileMetricsQuery, changeWidgetRequest.profileMetricsQuery)
463577
&& Objects.equals(this.q, changeWidgetRequest.q)
578+
&& Objects.equals(this.queries, changeWidgetRequest.queries)
579+
&& Objects.equals(this.responseFormat, changeWidgetRequest.responseFormat)
464580
&& Objects.equals(this.rumQuery, changeWidgetRequest.rumQuery)
465581
&& Objects.equals(this.securityQuery, changeWidgetRequest.securityQuery)
466582
&& Objects.equals(this.showPresent, changeWidgetRequest.showPresent);
@@ -473,6 +589,7 @@ public int hashCode() {
473589
changeType,
474590
compareTo,
475591
eventQuery,
592+
formulas,
476593
increaseGood,
477594
logQuery,
478595
networkQuery,
@@ -481,6 +598,8 @@ public int hashCode() {
481598
processQuery,
482599
profileMetricsQuery,
483600
q,
601+
queries,
602+
responseFormat,
484603
rumQuery,
485604
securityQuery,
486605
showPresent);
@@ -494,6 +613,7 @@ public String toString() {
494613
sb.append(" changeType: ").append(toIndentedString(changeType)).append("\n");
495614
sb.append(" compareTo: ").append(toIndentedString(compareTo)).append("\n");
496615
sb.append(" eventQuery: ").append(toIndentedString(eventQuery)).append("\n");
616+
sb.append(" formulas: ").append(toIndentedString(formulas)).append("\n");
497617
sb.append(" increaseGood: ").append(toIndentedString(increaseGood)).append("\n");
498618
sb.append(" logQuery: ").append(toIndentedString(logQuery)).append("\n");
499619
sb.append(" networkQuery: ").append(toIndentedString(networkQuery)).append("\n");
@@ -504,6 +624,8 @@ public String toString() {
504624
.append(toIndentedString(profileMetricsQuery))
505625
.append("\n");
506626
sb.append(" q: ").append(toIndentedString(q)).append("\n");
627+
sb.append(" queries: ").append(toIndentedString(queries)).append("\n");
628+
sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n");
507629
sb.append(" rumQuery: ").append(toIndentedString(rumQuery)).append("\n");
508630
sb.append(" securityQuery: ").append(toIndentedString(securityQuery)).append("\n");
509631
sb.append(" showPresent: ").append(toIndentedString(showPresent)).append("\n");

src/test/resources/com/datadog/api/v1/client/api/dashboards.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ Feature: Dashboards
2323
When the request is sent
2424
Then the response status is 200 OK
2525

26+
Scenario: Create a new dashboard with a formulas and functions change widget
27+
Given new "CreateDashboard" request
28+
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "", "title_size": "16", "title_align": "left", "time": {}, "type": "change", "requests": [ { "formulas": [ { "formula": "hour_before(query1)" }, { "formula": "query1" } ], "queries": [ { "data_source": "logs", "name": "query1", "search": { "query": "" }, "indexes": [ "*" ], "compute": { "aggregation": "count" }, "group_by": [] } ], "response_format": "scalar", "compare_to": "hour_before", "increase_good": true, "order_by": "change", "change_type": "absolute", "order_dir": "desc" } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" }
29+
When the request is sent
30+
Then the response status is 200 OK
31+
And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar"
32+
And the response "widgets[0].definition.requests[0].compare_to" is equal to "hour_before"
33+
And the response "widgets[0].definition.requests[0].increase_good" is equal to true
34+
And the response "widgets[0].definition.requests[0].order_by" is equal to "change"
35+
And the response "widgets[0].definition.requests[0].change_type" is equal to "absolute"
36+
And the response "widgets[0].definition.requests[0].order_dir" is equal to "desc"
37+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "logs"
38+
And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1"
39+
And the response "widgets[0].definition.requests[0].queries[0].compute.aggregation" is equal to "count"
40+
And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "hour_before(query1)"
41+
And the response "widgets[0].definition.requests[0].formulas[1].formula" is equal to "query1"
42+
2643
Scenario: Create a new dashboard with a profile metric query
2744
Given new "CreateDashboard" request
2845
And body from file "dashboard_payload.json"

0 commit comments

Comments
 (0)