Skip to content

Commit ed89451

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit a73640a of spec repo (#4039)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent afe90d3 commit ed89451

7 files changed

Lines changed: 257 additions & 1 deletion

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,10 +5807,21 @@ components:
58075807
description: Team handle.
58085808
type: string
58095809
type: array
5810+
version:
5811+
$ref: "#/components/schemas/ListStreamQueryVersion"
58105812
required:
58115813
- query_string
58125814
- data_source
58135815
type: object
5816+
ListStreamQueryVersion:
5817+
description: |-
5818+
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
5819+
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**
5820+
enum:
5821+
- sequential_query
5822+
type: string
5823+
x-enum-varnames:
5824+
- SEQUENTIAL_QUERY
58145825
ListStreamResponseFormat:
58155826
description: Widget response format.
58165827
enum:
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Create a new dashboard with logs_transaction_stream list_stream widget and version
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.ListStreamColumn;
9+
import com.datadog.api.client.v1.model.ListStreamColumnWidth;
10+
import com.datadog.api.client.v1.model.ListStreamComputeAggregation;
11+
import com.datadog.api.client.v1.model.ListStreamComputeItems;
12+
import com.datadog.api.client.v1.model.ListStreamGroupByItems;
13+
import com.datadog.api.client.v1.model.ListStreamQuery;
14+
import com.datadog.api.client.v1.model.ListStreamQueryVersion;
15+
import com.datadog.api.client.v1.model.ListStreamResponseFormat;
16+
import com.datadog.api.client.v1.model.ListStreamSource;
17+
import com.datadog.api.client.v1.model.ListStreamWidgetDefinition;
18+
import com.datadog.api.client.v1.model.ListStreamWidgetDefinitionType;
19+
import com.datadog.api.client.v1.model.ListStreamWidgetRequest;
20+
import com.datadog.api.client.v1.model.Widget;
21+
import com.datadog.api.client.v1.model.WidgetDefinition;
22+
import java.util.Collections;
23+
24+
public class Example {
25+
public static void main(String[] args) {
26+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
27+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
28+
29+
Dashboard body =
30+
new Dashboard()
31+
.layoutType(DashboardLayoutType.ORDERED)
32+
.title("Example-Dashboard with list_stream widget")
33+
.widgets(
34+
Collections.singletonList(
35+
new Widget()
36+
.definition(
37+
new WidgetDefinition(
38+
new ListStreamWidgetDefinition()
39+
.type(ListStreamWidgetDefinitionType.LIST_STREAM)
40+
.requests(
41+
Collections.singletonList(
42+
new ListStreamWidgetRequest()
43+
.columns(
44+
Collections.singletonList(
45+
new ListStreamColumn()
46+
.width(ListStreamColumnWidth.AUTO)
47+
.field("timestamp")))
48+
.query(
49+
new ListStreamQuery()
50+
.dataSource(
51+
ListStreamSource
52+
.LOGS_TRANSACTION_STREAM)
53+
.queryString("")
54+
.groupBy(
55+
Collections.singletonList(
56+
new ListStreamGroupByItems()
57+
.facet("service")))
58+
.compute(
59+
Collections.singletonList(
60+
new ListStreamComputeItems()
61+
.facet("service")
62+
.aggregation(
63+
ListStreamComputeAggregation
64+
.COUNT)))
65+
.version(
66+
ListStreamQueryVersion
67+
.SEQUENTIAL_QUERY))
68+
.responseFormat(
69+
ListStreamResponseFormat.EVENT_LIST)))))));
70+
71+
try {
72+
Dashboard result = apiInstance.createDashboard(body);
73+
System.out.println(result);
74+
} catch (ApiException e) {
75+
System.err.println("Exception when calling DashboardsApi#createDashboard");
76+
System.err.println("Status code: " + e.getCode());
77+
System.err.println("Reason: " + e.getResponseBody());
78+
System.err.println("Response headers: " + e.getResponseHeaders());
79+
e.printStackTrace();
80+
}
81+
}
82+
}

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
ListStreamQuery.JSON_PROPERTY_STATES,
3535
ListStreamQuery.JSON_PROPERTY_STORAGE,
3636
ListStreamQuery.JSON_PROPERTY_SUSPECTED_CAUSES,
37-
ListStreamQuery.JSON_PROPERTY_TEAM_HANDLES
37+
ListStreamQuery.JSON_PROPERTY_TEAM_HANDLES,
38+
ListStreamQuery.JSON_PROPERTY_VERSION
3839
})
3940
@jakarta.annotation.Generated(
4041
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
@@ -83,6 +84,9 @@ public class ListStreamQuery {
8384
public static final String JSON_PROPERTY_TEAM_HANDLES = "team_handles";
8485
private List<String> teamHandles = null;
8586

87+
public static final String JSON_PROPERTY_VERSION = "version";
88+
private ListStreamQueryVersion version;
89+
8690
public ListStreamQuery() {}
8791

8892
@JsonCreator
@@ -468,6 +472,33 @@ public void setTeamHandles(List<String> teamHandles) {
468472
this.teamHandles = teamHandles;
469473
}
470474

475+
public ListStreamQuery version(ListStreamQueryVersion version) {
476+
this.version = version;
477+
this.unparsed |= !version.isValid();
478+
return this;
479+
}
480+
481+
/**
482+
* Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
483+
* preserved. Set to <code>sequential_query</code> to use v2 behavior. <strong>This feature is in
484+
* Preview.</strong>
485+
*
486+
* @return version
487+
*/
488+
@jakarta.annotation.Nullable
489+
@JsonProperty(JSON_PROPERTY_VERSION)
490+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
491+
public ListStreamQueryVersion getVersion() {
492+
return version;
493+
}
494+
495+
public void setVersion(ListStreamQueryVersion version) {
496+
if (!version.isValid()) {
497+
this.unparsed = true;
498+
}
499+
this.version = version;
500+
}
501+
471502
/**
472503
* A container for additional, undeclared properties. This is a holder for any undeclared
473504
* properties as specified with the 'additionalProperties' keyword in the OAS document.
@@ -539,6 +570,7 @@ public boolean equals(Object o) {
539570
&& Objects.equals(this.storage, listStreamQuery.storage)
540571
&& Objects.equals(this.suspectedCauses, listStreamQuery.suspectedCauses)
541572
&& Objects.equals(this.teamHandles, listStreamQuery.teamHandles)
573+
&& Objects.equals(this.version, listStreamQuery.version)
542574
&& Objects.equals(this.additionalProperties, listStreamQuery.additionalProperties);
543575
}
544576

@@ -559,6 +591,7 @@ public int hashCode() {
559591
storage,
560592
suspectedCauses,
561593
teamHandles,
594+
version,
562595
additionalProperties);
563596
}
564597

@@ -582,6 +615,7 @@ public String toString() {
582615
sb.append(" storage: ").append(toIndentedString(storage)).append("\n");
583616
sb.append(" suspectedCauses: ").append(toIndentedString(suspectedCauses)).append("\n");
584617
sb.append(" teamHandles: ").append(toIndentedString(teamHandles)).append("\n");
618+
sb.append(" version: ").append(toIndentedString(version)).append("\n");
585619
sb.append(" additionalProperties: ")
586620
.append(toIndentedString(additionalProperties))
587621
.append("\n");
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v1.model;
8+
9+
import com.datadog.api.client.ModelEnum;
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.core.JsonGenerator;
12+
import com.fasterxml.jackson.core.JsonProcessingException;
13+
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
16+
import java.io.IOException;
17+
import java.util.Arrays;
18+
import java.util.HashSet;
19+
import java.util.Set;
20+
21+
/**
22+
* Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
23+
* preserved. Set to <code>sequential_query</code> to use v2 behavior. <strong>This feature is in
24+
* Preview.</strong>
25+
*/
26+
@JsonSerialize(using = ListStreamQueryVersion.ListStreamQueryVersionSerializer.class)
27+
public class ListStreamQueryVersion extends ModelEnum<String> {
28+
29+
private static final Set<String> allowedValues =
30+
new HashSet<String>(Arrays.asList("sequential_query"));
31+
32+
public static final ListStreamQueryVersion SEQUENTIAL_QUERY =
33+
new ListStreamQueryVersion("sequential_query");
34+
35+
ListStreamQueryVersion(String value) {
36+
super(value, allowedValues);
37+
}
38+
39+
public static class ListStreamQueryVersionSerializer
40+
extends StdSerializer<ListStreamQueryVersion> {
41+
public ListStreamQueryVersionSerializer(Class<ListStreamQueryVersion> t) {
42+
super(t);
43+
}
44+
45+
public ListStreamQueryVersionSerializer() {
46+
this(null);
47+
}
48+
49+
@Override
50+
public void serialize(
51+
ListStreamQueryVersion value, JsonGenerator jgen, SerializerProvider provider)
52+
throws IOException, JsonProcessingException {
53+
jgen.writeObject(value.value);
54+
}
55+
}
56+
57+
@JsonCreator
58+
public static ListStreamQueryVersion fromValue(String value) {
59+
return new ListStreamQueryVersion(value);
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-30T18:19:26.621Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"httpRequest": {
4+
"body": {
5+
"type": "JSON",
6+
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"compute\":[{\"aggregation\":\"count\",\"facet\":\"service\"}],\"data_source\":\"logs_transaction_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\",\"version\":\"sequential_query\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}"
7+
},
8+
"headers": {},
9+
"method": "POST",
10+
"path": "/api/v1/dashboard",
11+
"keepAlive": false,
12+
"secure": true
13+
},
14+
"httpResponse": {
15+
"body": "{\"id\":\"72a-q2p-zau\",\"title\":\"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/72a-q2p-zau/test-createanewdashboardwithlogstransactionstreamliststreamwidgetandversion-1782\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"compute\":[{\"aggregation\":\"count\",\"facet\":\"service\"}],\"data_source\":\"logs_transaction_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\",\"version\":\"sequential_query\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":7740630869906828}],\"notify_list\":null,\"created_at\":\"2026-06-30T18:19:26.794909+00:00\",\"modified_at\":\"2026-06-30T18:19:26.794909+00:00\",\"restricted_roles\":[]}",
16+
"headers": {
17+
"Content-Type": [
18+
"application/json"
19+
]
20+
},
21+
"statusCode": 200,
22+
"reasonPhrase": "OK"
23+
},
24+
"times": {
25+
"remainingTimes": 1
26+
},
27+
"timeToLive": {
28+
"unlimited": true
29+
},
30+
"id": "7d2dcbfd-4f25-70cd-30d2-db347a6251ab"
31+
},
32+
{
33+
"httpRequest": {
34+
"headers": {},
35+
"method": "DELETE",
36+
"path": "/api/v1/dashboard/72a-q2p-zau",
37+
"keepAlive": false,
38+
"secure": true
39+
},
40+
"httpResponse": {
41+
"body": "{\"deleted_dashboard_id\":\"72a-q2p-zau\"}",
42+
"headers": {
43+
"Content-Type": [
44+
"application/json"
45+
]
46+
},
47+
"statusCode": 200,
48+
"reasonPhrase": "OK"
49+
},
50+
"times": {
51+
"remainingTimes": 1
52+
},
53+
"timeToLive": {
54+
"unlimited": true
55+
},
56+
"id": "6ad9f4e6-a510-1411-4aa4-81cf0551672f"
57+
}
58+
]

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,15 @@ Feature: Dashboards
721721
And the response "widgets[0].definition.requests[0].query.compute[0].facet" is equal to "service"
722722
And the response "widgets[0].definition.requests[0].query.compute[0].aggregation" is equal to "count"
723723

724+
@team:DataDog/dashboards-backend
725+
Scenario: Create a new dashboard with logs_transaction_stream list_stream widget and version
726+
Given new "CreateDashboard" request
727+
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"logs_transaction_stream","query_string":"","group_by":[{"facet":"service"}],"compute":[{"facet":"service","aggregation":"count"}],"version":"sequential_query"},"response_format":"event_list"}]}}]}
728+
When the request is sent
729+
Then the response status is 200 OK
730+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_transaction_stream"
731+
And the response "widgets[0].definition.requests[0].query.version" is equal to "sequential_query"
732+
724733
@team:DataDog/dashboards-backend
725734
Scenario: Create a new dashboard with manage_status widget
726735
Given new "CreateDashboard" request

0 commit comments

Comments
 (0)