Skip to content

Commit 27afdea

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ff63977 of spec repo
1 parent 9aa93ff commit 27afdea

File tree

5 files changed

+234
-12
lines changed

5 files changed

+234
-12
lines changed

examples/v1/dashboards/SendPublicDashboardInvitation.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,26 @@
88
import com.datadog.api.client.v1.model.SharedDashboardInvitesData;
99
import com.datadog.api.client.v1.model.SharedDashboardInvitesDataObject;
1010
import com.datadog.api.client.v1.model.SharedDashboardInvitesDataObjectAttributes;
11+
import java.util.Collections;
1112

1213
public class Example {
1314
public static void main(String[] args) {
1415
ApiClient defaultClient = ApiClient.getDefaultApiClient();
1516
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
1617

17-
// there is a valid "shared_dashboard" in the system
18-
String SHARED_DASHBOARD_TOKEN = System.getenv("SHARED_DASHBOARD_TOKEN");
19-
2018
SharedDashboardInvites body =
2119
new SharedDashboardInvites()
2220
.data(
2321
new SharedDashboardInvitesData(
24-
new SharedDashboardInvitesDataObject()
25-
.attributes(
26-
new SharedDashboardInvitesDataObjectAttributes()
27-
.email("exampledashboard@datadoghq.com"))
28-
.type(DashboardInviteType.PUBLIC_DASHBOARD_INVITATION)));
22+
Collections.singletonList(
23+
new SharedDashboardInvitesDataObject()
24+
.attributes(
25+
new SharedDashboardInvitesDataObjectAttributes()
26+
.email("test@datadoghq.com"))
27+
.type(DashboardInviteType.PUBLIC_DASHBOARD_INVITATION))));
2928

3029
try {
31-
SharedDashboardInvites result =
32-
apiInstance.sendPublicDashboardInvitation(SHARED_DASHBOARD_TOKEN, body);
30+
SharedDashboardInvites result = apiInstance.sendPublicDashboardInvitation("token", body);
3331
System.out.println(result);
3432
} catch (ApiException e) {
3533
System.err.println("Exception when calling DashboardsApi#sendPublicDashboardInvitation");
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Send shared dashboard invitation email returns "OK"
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.DashboardInviteType;
7+
import com.datadog.api.client.v1.model.SharedDashboardInvites;
8+
import com.datadog.api.client.v1.model.SharedDashboardInvitesData;
9+
import com.datadog.api.client.v1.model.SharedDashboardInvitesDataObject;
10+
import com.datadog.api.client.v1.model.SharedDashboardInvitesDataObjectAttributes;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
16+
17+
// there is a valid "shared_dashboard" in the system
18+
String SHARED_DASHBOARD_TOKEN = System.getenv("SHARED_DASHBOARD_TOKEN");
19+
20+
SharedDashboardInvites body =
21+
new SharedDashboardInvites()
22+
.data(
23+
new SharedDashboardInvitesData(
24+
new SharedDashboardInvitesDataObject()
25+
.attributes(
26+
new SharedDashboardInvitesDataObjectAttributes()
27+
.email("exampledashboard@datadoghq.com"))
28+
.type(DashboardInviteType.PUBLIC_DASHBOARD_INVITATION)));
29+
30+
try {
31+
SharedDashboardInvites result =
32+
apiInstance.sendPublicDashboardInvitation(SHARED_DASHBOARD_TOKEN, body);
33+
System.out.println(result);
34+
} catch (ApiException e) {
35+
System.err.println("Exception when calling DashboardsApi#sendPublicDashboardInvitation");
36+
System.err.println("Status code: " + e.getCode());
37+
System.err.println("Reason: " + e.getResponseBody());
38+
System.err.println("Response headers: " + e.getResponseHeaders());
39+
e.printStackTrace();
40+
}
41+
}
42+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-18T20:27:29.628Z
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
[
2+
{
3+
"httpRequest": {
4+
"body": {
5+
"type": "JSON",
6+
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 with Profile Metrics Query\",\"widgets\":[{\"definition\":{\"requests\":[{\"profile_metrics_query\":{\"compute\":{\"aggregation\":\"sum\",\"facet\":\"@prof_core_cpu_cores\"},\"group_by\":[{\"facet\":\"service\",\"limit\":10,\"sort\":{\"aggregation\":\"sum\",\"facet\":\"@prof_core_cpu_cores\",\"order\":\"desc\"}}],\"search\":{\"query\":\"runtime:jvm\"}}}],\"type\":\"timeseries\"}}]}"
7+
},
8+
"headers": {},
9+
"method": "POST",
10+
"path": "/api/v1/dashboard",
11+
"keepAlive": false,
12+
"secure": true
13+
},
14+
"httpResponse": {
15+
"body": "{\"id\":\"uy7-jdc-khf\",\"title\":\"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 with Profile Metrics Query\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/uy7-jdc-khf/test-sendshareddashboardinvitationemailreturnsok-1773865649-with-profile-metrics\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"profile_metrics_query\":{\"compute\":{\"aggregation\":\"sum\",\"facet\":\"@prof_core_cpu_cores\"},\"group_by\":[{\"facet\":\"service\",\"limit\":10,\"sort\":{\"aggregation\":\"sum\",\"facet\":\"@prof_core_cpu_cores\",\"order\":\"desc\"}}],\"search\":{\"query\":\"runtime:jvm\"}}}],\"type\":\"timeseries\"},\"id\":3763196530100152}],\"notify_list\":null,\"created_at\":\"2026-03-18T20:27:29.720762+00:00\",\"modified_at\":\"2026-03-18T20:27:29.720762+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": "3cf3a276-ace4-3f8d-90d0-9be55a65f425"
31+
},
32+
{
33+
"httpRequest": {
34+
"body": {
35+
"type": "JSON",
36+
"json": "{\"dashboard_id\":\"uy7-jdc-khf\",\"dashboard_type\":\"custom_timeboard\",\"global_time\":{\"live_span\":\"1h\"},\"share_list\":[\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\"],\"share_type\":\"invite\"}"
37+
},
38+
"headers": {},
39+
"method": "POST",
40+
"path": "/api/v1/dashboard/public",
41+
"keepAlive": false,
42+
"secure": true
43+
},
44+
"httpResponse": {
45+
"body": "{\"author\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"dashboard_id\":\"uy7-jdc-khf\",\"dashboard_type\":\"custom_timeboard\",\"status\":\"active\",\"title\":\"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 with Profile Metrics Query\",\"viewing_preferences\":{},\"expiration\":null,\"last_accessed\":null,\"global_time_selectable_enabled\":false,\"global_time\":{\"live_span\":\"1h\"},\"selectable_template_vars\":null,\"token\":\"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65\",\"public_url\":\"https://p.datadoghq.com/sb/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65\",\"created\":\"2026-03-18T20:27:30.223874+00:00\",\"share_type\":\"invite\",\"share_list\":[\"team-intg-tools-libs-spam@datadoghq.com\",\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\"],\"session_duration_in_days\":30,\"invitees\":[{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"access_expiration\":null,\"last_accessed\":null,\"created_at\":\"2026-03-18T20:27:30.248539+00:00\"},{\"email\":\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\",\"access_expiration\":null,\"last_accessed\":null,\"created_at\":\"2026-03-18T20:27:30.248539+00:00\"}],\"embeddable_domains\":[]}\n",
46+
"headers": {
47+
"Content-Type": [
48+
"application/json"
49+
]
50+
},
51+
"statusCode": 200,
52+
"reasonPhrase": "OK"
53+
},
54+
"times": {
55+
"remainingTimes": 1
56+
},
57+
"timeToLive": {
58+
"unlimited": true
59+
},
60+
"id": "bae29e67-67d5-c90b-6fef-50c4ecb522dc"
61+
},
62+
{
63+
"httpRequest": {
64+
"body": {
65+
"type": "JSON",
66+
"json": "{\"data\":{\"attributes\":{\"email\":\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\"},\"type\":\"public_dashboard_invitation\"}}"
67+
},
68+
"headers": {},
69+
"method": "POST",
70+
"path": "/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65/invitation",
71+
"keepAlive": false,
72+
"secure": true
73+
},
74+
"httpResponse": {
75+
"body": "{\"data\":{\"type\":\"public_dashboard_invitation\",\"attributes\":{\"email\":\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\",\"share_token\":\"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65\",\"created_at\":\"2026-03-18T20:27:30.426144+00:00\",\"invitation_expiry\":\"2026-03-18T21:27:30.435235+00:00\",\"has_session\":false,\"session_expiry\":null}}}\n",
76+
"headers": {
77+
"Content-Type": [
78+
"application/json"
79+
]
80+
},
81+
"statusCode": 201,
82+
"reasonPhrase": "Created"
83+
},
84+
"times": {
85+
"remainingTimes": 1
86+
},
87+
"timeToLive": {
88+
"unlimited": true
89+
},
90+
"id": "5132ab42-2a8b-4893-b832-38ab58461af4"
91+
},
92+
{
93+
"httpRequest": {
94+
"body": {
95+
"type": "JSON",
96+
"json": "{\"data\":{\"attributes\":{\"email\":\"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com\"},\"type\":\"public_dashboard_invitation\"}}"
97+
},
98+
"headers": {},
99+
"method": "DELETE",
100+
"path": "/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65/invitation",
101+
"keepAlive": false,
102+
"secure": true
103+
},
104+
"httpResponse": {
105+
"headers": {
106+
"Content-Type": [
107+
"text/html; charset=utf-8"
108+
]
109+
},
110+
"statusCode": 204,
111+
"reasonPhrase": "No Content"
112+
},
113+
"times": {
114+
"remainingTimes": 1
115+
},
116+
"timeToLive": {
117+
"unlimited": true
118+
},
119+
"id": "cfaccf92-b083-a65c-e1f1-83bf1b2ff451"
120+
},
121+
{
122+
"httpRequest": {
123+
"headers": {},
124+
"method": "DELETE",
125+
"path": "/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65",
126+
"keepAlive": false,
127+
"secure": true
128+
},
129+
"httpResponse": {
130+
"body": "{\"deleted_public_dashboard_token\":\"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65\"}\n",
131+
"headers": {
132+
"Content-Type": [
133+
"application/json"
134+
]
135+
},
136+
"statusCode": 200,
137+
"reasonPhrase": "OK"
138+
},
139+
"times": {
140+
"remainingTimes": 1
141+
},
142+
"timeToLive": {
143+
"unlimited": true
144+
},
145+
"id": "549f4fb3-7ad1-5c23-c3eb-796b19312a8b"
146+
},
147+
{
148+
"httpRequest": {
149+
"headers": {},
150+
"method": "DELETE",
151+
"path": "/api/v1/dashboard/uy7-jdc-khf",
152+
"keepAlive": false,
153+
"secure": true
154+
},
155+
"httpResponse": {
156+
"body": "{\"deleted_dashboard_id\":\"uy7-jdc-khf\"}",
157+
"headers": {
158+
"Content-Type": [
159+
"application/json"
160+
]
161+
},
162+
"statusCode": 200,
163+
"reasonPhrase": "OK"
164+
},
165+
"times": {
166+
"remainingTimes": 1
167+
},
168+
"timeToLive": {
169+
"unlimited": true
170+
},
171+
"id": "97bba2c0-b6f5-21f5-664e-f8cb0c3de56b"
172+
}
173+
]

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,17 +1358,25 @@ Feature: Dashboards
13581358
Then the response status is 404 Not Found
13591359

13601360
@team:DataDog/reporting-and-sharing
1361-
Scenario: Send shared dashboard invitation email returns "OK" response
1361+
Scenario: Send shared dashboard invitation email returns "OK"
13621362
Given there is a valid "dashboard" in the system
13631363
And there is a valid "shared_dashboard" in the system
13641364
And new "SendPublicDashboardInvitation" request
13651365
And request contains "token" parameter from "shared_dashboard.token"
13661366
And body with value {"data": {"attributes": {"email": "{{unique_lower_alnum}}@datadoghq.com"}, "type": "public_dashboard_invitation"}}
13671367
When the request is sent
13681368
Then the response status is 201 OK
1369-
And the response "data.attributes.email" has the same value as "shared_dashboard.share_list[0]"
1369+
And the response "data.attributes.email" has the same value as "shared_dashboard.share_list[1]"
13701370
And the response "data.attributes.share_token" has the same value as "shared_dashboard.token"
13711371

1372+
@generated @skip @team:DataDog/reporting-and-sharing
1373+
Scenario: Send shared dashboard invitation email returns "OK" response
1374+
Given new "SendPublicDashboardInvitation" request
1375+
And request contains "token" parameter from "REPLACE.ME"
1376+
And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]}
1377+
When the request is sent
1378+
Then the response status is 201 OK
1379+
13721380
@generated @skip @team:DataDog/dashboards-backend
13731381
Scenario: Update a dashboard returns "Bad Request" response
13741382
Given new "UpdateDashboard" request

0 commit comments

Comments
 (0)