Skip to content

Commit 268dc7c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 6de6059 of spec repo (#3932)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent bb50aac commit 268dc7c

14 files changed

Lines changed: 305 additions & 14 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27293,7 +27293,7 @@ components:
2729327293
- attributes
2729427294
type: object
2729527295
DashboardUsageAttributes:
27296-
description: Usage statistics for a dashboard.
27296+
description: Usage statistics for a dashboard. The `viewer` field and all view-count fields (`total_views`, `viewed_at`, `total_views_by_type`) are populated only when Real User Monitoring (RUM) is active for the org.
2729727297
properties:
2729827298
author:
2729927299
$ref: "#/components/schemas/DashboardUsageUser"
@@ -27332,7 +27332,7 @@ components:
2733227332
example: My production overview
2733327333
type: string
2733427334
total_views:
27335-
description: The total number of times the dashboard has been viewed.
27335+
description: Total view count for the dashboard. Counts only views captured by Real User Monitoring (RUM); `0` in orgs without RUM.
2733627336
example: 42
2733727337
format: int64
2733827338
type: integer
@@ -27341,11 +27341,11 @@ components:
2734127341
description: View count for that view type.
2734227342
format: int64
2734327343
type: integer
27344-
description: View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`.
27344+
description: View counts keyed by view type (`in_app`, `embed`, `public`, `shared`, `api`, `unknown`). Counts only views captured by Real User Monitoring (RUM); empty in orgs without RUM.
2734527345
nullable: true
2734627346
type: object
2734727347
viewed_at:
27348-
description: When the dashboard was most recently viewed.
27348+
description: When the dashboard was most recently viewed. Populated only when Real User Monitoring (RUM) is active for the org; `null` in orgs without RUM.
2734927349
example: "2026-05-01T14:22:10.000Z"
2735027350
format: date-time
2735127351
nullable: true
@@ -117452,7 +117452,7 @@ paths:
117452117452
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
117453117453
/api/v2/dashboards/usage:
117454117454
get:
117455-
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set.
117455+
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set. Use `filter[edited_before]` or `filter[viewed_before]` to narrow results by recency. View-count fields depend on Real User Monitoring (RUM) and are `null` or `0` in orgs without RUM.
117456117456
operationId: ListDashboardsUsage
117457117457
parameters:
117458117458
- description: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
@@ -117472,6 +117472,20 @@ paths:
117472117472
format: int64
117473117473
minimum: 0
117474117474
type: integer
117475+
- description: Return only dashboards whose last edit (`edited_at`) is strictly before this ISO 8601 timestamp (`edited_at < value`; boundary matches are excluded). Must include a timezone offset (for example, `Z` or `+00:00`); naive timestamps return HTTP 400.
117476+
in: query
117477+
name: filter[edited_before]
117478+
required: false
117479+
schema:
117480+
example: "2025-04-26T00:00:00Z"
117481+
type: string
117482+
- description: Return only dashboards whose most recent view (`viewed_at`) is strictly before this ISO 8601 timestamp, including dashboards that have never been viewed. Must include a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
117483+
in: query
117484+
name: filter[viewed_before]
117485+
required: false
117486+
schema:
117487+
example: "2025-04-26T00:00:00Z"
117488+
type: string
117475117489
responses:
117476117490
"200":
117477117491
content:
@@ -117553,7 +117567,7 @@ paths:
117553117567
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
117554117568
/api/v2/dashboards/{dashboard_id}/usage:
117555117569
get:
117556-
description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score.
117570+
description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score. View-count fields depend on Real User Monitoring (RUM) and are `null` or `0` in orgs without RUM.
117557117571
operationId: GetDashboardUsage
117558117572
parameters:
117559117573
- description: The ID of the dashboard.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get usage stats for all dashboards with edited_before filter returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DashboardsApi;
6+
import com.datadog.api.client.v2.api.DashboardsApi.ListDashboardsUsageOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListDashboardsUsageResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listDashboardsUsage", true);
13+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
14+
15+
try {
16+
ListDashboardsUsageResponse result =
17+
apiInstance.listDashboardsUsage(
18+
new ListDashboardsUsageOptionalParameters()
19+
.filterEditedBefore("2025-04-26T00:00:00Z"));
20+
System.out.println(result);
21+
} catch (ApiException e) {
22+
System.err.println("Exception when calling DashboardsApi#listDashboardsUsage");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get usage stats for all dashboards with viewed_before filter returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DashboardsApi;
6+
import com.datadog.api.client.v2.api.DashboardsApi.ListDashboardsUsageOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListDashboardsUsageResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listDashboardsUsage", true);
13+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
14+
15+
try {
16+
ListDashboardsUsageResponse result =
17+
apiInstance.listDashboardsUsage(
18+
new ListDashboardsUsageOptionalParameters()
19+
.filterViewedBefore("2025-04-26T00:00:00Z"));
20+
System.out.println(result);
21+
} catch (ApiException e) {
22+
System.err.println("Exception when calling DashboardsApi#listDashboardsUsage");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Get usage stats for all dashboards with both filters returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DashboardsApi;
6+
import com.datadog.api.client.v2.api.DashboardsApi.ListDashboardsUsageOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListDashboardsUsageResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listDashboardsUsage", true);
13+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
14+
15+
try {
16+
ListDashboardsUsageResponse result =
17+
apiInstance.listDashboardsUsage(
18+
new ListDashboardsUsageOptionalParameters()
19+
.filterEditedBefore("2025-04-26T00:00:00Z")
20+
.filterViewedBefore("2025-04-26T00:00:00Z"));
21+
System.out.println(result);
22+
} catch (ApiException e) {
23+
System.err.println("Exception when calling DashboardsApi#listDashboardsUsage");
24+
System.err.println("Status code: " + e.getCode());
25+
System.err.println("Reason: " + e.getResponseBody());
26+
System.err.println("Response headers: " + e.getResponseHeaders());
27+
e.printStackTrace();
28+
}
29+
}
30+
}

src/main/java/com/datadog/api/client/v2/api/DashboardsApi.java

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public CompletableFuture<DashboardUsageResponse> getDashboardUsageAsync(String d
7979

8080
/**
8181
* Get usage statistics for a single dashboard. The response includes view counts, the most recent
82-
* view and edit times, widget counts, and the dashboard quality score.
82+
* view and edit times, widget counts, and the dashboard quality score. View-count fields depend
83+
* on Real User Monitoring (RUM) and are <code>null</code> or <code>0</code> in orgs without RUM.
8384
*
8485
* @param dashboardId The ID of the dashboard. (required)
8586
* @return ApiResponse&lt;DashboardUsageResponse&gt;
@@ -208,6 +209,8 @@ public CompletableFuture<ApiResponse<DashboardUsageResponse>> getDashboardUsageW
208209
public static class ListDashboardsUsageOptionalParameters {
209210
private Long pageLimit;
210211
private Long pageOffset;
212+
private String filterEditedBefore;
213+
private String filterViewedBefore;
211214

212215
/**
213216
* Set pageLimit.
@@ -231,6 +234,35 @@ public ListDashboardsUsageOptionalParameters pageOffset(Long pageOffset) {
231234
this.pageOffset = pageOffset;
232235
return this;
233236
}
237+
238+
/**
239+
* Set filterEditedBefore.
240+
*
241+
* @param filterEditedBefore Return only dashboards whose last edit (<code>edited_at</code>) is
242+
* strictly before this ISO 8601 timestamp (<code>edited_at &lt; value</code>; boundary
243+
* matches are excluded). Must include a timezone offset (for example, <code>Z</code> or
244+
* <code>+00:00</code>); naive timestamps return HTTP 400. (optional)
245+
* @return ListDashboardsUsageOptionalParameters
246+
*/
247+
public ListDashboardsUsageOptionalParameters filterEditedBefore(String filterEditedBefore) {
248+
this.filterEditedBefore = filterEditedBefore;
249+
return this;
250+
}
251+
252+
/**
253+
* Set filterViewedBefore.
254+
*
255+
* @param filterViewedBefore Return only dashboards whose most recent view (<code>viewed_at
256+
* </code>) is strictly before this ISO 8601 timestamp, including dashboards that have never
257+
* been viewed. Must include a timezone offset; naive timestamps return HTTP 400. Orgs
258+
* without Real User Monitoring (RUM) will see all dashboards returned by this filter.
259+
* (optional)
260+
* @return ListDashboardsUsageOptionalParameters
261+
*/
262+
public ListDashboardsUsageOptionalParameters filterViewedBefore(String filterViewedBefore) {
263+
this.filterViewedBefore = filterViewedBefore;
264+
return this;
265+
}
234266
}
235267

236268
/**
@@ -347,7 +379,10 @@ public PaginationIterable<DashboardUsage> listDashboardsUsageWithPagination(
347379

348380
/**
349381
* Get paginated usage statistics for every dashboard in the caller's organization. Use <code>
350-
* page[limit]</code> and <code>page[offset]</code> to walk the result set.
382+
* page[limit]</code> and <code>page[offset]</code> to walk the result set. Use <code>
383+
* filter[edited_before]</code> or <code>filter[viewed_before]</code> to narrow results by
384+
* recency. View-count fields depend on Real User Monitoring (RUM) and are <code>null</code> or
385+
* <code>0</code> in orgs without RUM.
351386
*
352387
* @param parameters Optional parameters for the request.
353388
* @return ApiResponse&lt;ListDashboardsUsageResponse&gt;
@@ -374,6 +409,8 @@ public ApiResponse<ListDashboardsUsageResponse> listDashboardsUsageWithHttpInfo(
374409
Object localVarPostBody = null;
375410
Long pageLimit = parameters.pageLimit;
376411
Long pageOffset = parameters.pageOffset;
412+
String filterEditedBefore = parameters.filterEditedBefore;
413+
String filterViewedBefore = parameters.filterViewedBefore;
377414
// create path and map variables
378415
String localVarPath = "/api/v2/dashboards/usage";
379416

@@ -382,6 +419,10 @@ public ApiResponse<ListDashboardsUsageResponse> listDashboardsUsageWithHttpInfo(
382419

383420
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
384421
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
422+
localVarQueryParams.addAll(
423+
apiClient.parameterToPairs("", "filter[edited_before]", filterEditedBefore));
424+
localVarQueryParams.addAll(
425+
apiClient.parameterToPairs("", "filter[viewed_before]", filterViewedBefore));
385426

386427
Invocation.Builder builder =
387428
apiClient.createBuilder(
@@ -427,6 +468,8 @@ public ApiResponse<ListDashboardsUsageResponse> listDashboardsUsageWithHttpInfo(
427468
Object localVarPostBody = null;
428469
Long pageLimit = parameters.pageLimit;
429470
Long pageOffset = parameters.pageOffset;
471+
String filterEditedBefore = parameters.filterEditedBefore;
472+
String filterViewedBefore = parameters.filterViewedBefore;
430473
// create path and map variables
431474
String localVarPath = "/api/v2/dashboards/usage";
432475

@@ -435,6 +478,10 @@ public ApiResponse<ListDashboardsUsageResponse> listDashboardsUsageWithHttpInfo(
435478

436479
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
437480
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
481+
localVarQueryParams.addAll(
482+
apiClient.parameterToPairs("", "filter[edited_before]", filterEditedBefore));
483+
localVarQueryParams.addAll(
484+
apiClient.parameterToPairs("", "filter[viewed_before]", filterViewedBefore));
438485

439486
Invocation.Builder builder;
440487
try {

src/main/java/com/datadog/api/client/v2/model/DashboardUsage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public DashboardUsage attributes(DashboardUsageAttributes attributes) {
5858
}
5959

6060
/**
61-
* Usage statistics for a dashboard.
61+
* Usage statistics for a dashboard. The <code>viewer</code> field and all view-count fields (
62+
* <code>total_views</code>, <code>viewed_at</code>, <code>total_views_by_type</code>) are
63+
* populated only when Real User Monitoring (RUM) is active for the org.
6264
*
6365
* @return attributes
6466
*/

src/main/java/com/datadog/api/client/v2/model/DashboardUsageAttributes.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
import java.util.Objects;
2222
import org.openapitools.jackson.nullable.JsonNullable;
2323

24-
/** Usage statistics for a dashboard. */
24+
/**
25+
* Usage statistics for a dashboard. The <code>viewer</code> field and all view-count fields (<code>
26+
* total_views</code>, <code>viewed_at</code>, <code>total_views_by_type</code>) are populated only
27+
* when Real User Monitoring (RUM) is active for the org.
28+
*/
2529
@JsonPropertyOrder({
2630
DashboardUsageAttributes.JSON_PROPERTY_AUTHOR,
2731
DashboardUsageAttributes.JSON_PROPERTY_CREATED_AT,
@@ -304,7 +308,8 @@ public DashboardUsageAttributes totalViews(Long totalViews) {
304308
}
305309

306310
/**
307-
* The total number of times the dashboard has been viewed.
311+
* Total view count for the dashboard. Counts only views captured by Real User Monitoring (RUM);
312+
* <code>0</code> in orgs without RUM.
308313
*
309314
* @return totalViews
310315
*/
@@ -337,8 +342,9 @@ public DashboardUsageAttributes putTotalViewsByTypeItem(String key, Long totalVi
337342
}
338343

339344
/**
340-
* View counts keyed by view type. Possible keys are <code>in_app</code>, <code>embed</code>,
341-
* <code>public</code>, <code>shared</code>, <code>api</code>, and <code>unknown</code>.
345+
* View counts keyed by view type (<code>in_app</code>, <code>embed</code>, <code>public</code>,
346+
* <code>shared</code>, <code>api</code>, <code>unknown</code>). Counts only views captured by
347+
* Real User Monitoring (RUM); empty in orgs without RUM.
342348
*
343349
* @return totalViewsByType
344350
*/
@@ -369,7 +375,8 @@ public DashboardUsageAttributes viewedAt(OffsetDateTime viewedAt) {
369375
}
370376

371377
/**
372-
* When the dashboard was most recently viewed.
378+
* When the dashboard was most recently viewed. Populated only when Real User Monitoring (RUM) is
379+
* active for the org; <code>null</code> in orgs without RUM.
373380
*
374381
* @return viewedAt
375382
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-01T18:15:39.812Z

src/test/resources/cassettes/features/v2/Get_usage_stats_for_all_dashboards_with_both_filters_returns_OK_response.json

Lines changed: 36 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-01T18:14:52.307Z

0 commit comments

Comments
 (0)