diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 2d470c8f2f0..f9eef58dc1e 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -1758,6 +1758,14 @@ components:
schema:
example: "my-service"
type: string
+ SharedDashboardDashboardIDPathParameter:
+ description: ID of the dashboard.
+ in: path
+ name: dashboard_id
+ required: true
+ schema:
+ example: abc-def-ghi
+ type: string
SignalID:
description: The ID of the signal.
in: path
@@ -52576,6 +52584,23 @@ components:
meta:
$ref: "#/components/schemas/ServiceAccessTokenResponseMeta"
type: object
+ ListSharedDashboardsResponse:
+ description: Response containing shared dashboards for a dashboard.
+ properties:
+ data:
+ description: Shared dashboards for the dashboard.
+ items:
+ $ref: "#/components/schemas/SharedDashboardResponse"
+ type: array
+ included:
+ description: Users and dashboards related to the shared dashboards.
+ items:
+ $ref: "#/components/schemas/SharedDashboardIncluded"
+ type: array
+ required:
+ - data
+ - included
+ type: object
ListSourcemapsResponse:
description: Response containing a paginated list of source maps.
properties:
@@ -85992,6 +86017,347 @@ components:
required:
- type
type: object
+ SharedDashboardGlobalTime:
+ additionalProperties: {}
+ description: Default time range configuration for the shared dashboard.
+ example:
+ live_span: 1h
+ nullable: true
+ type: object
+ SharedDashboardIncluded:
+ description: Resource included with a shared dashboard.
+ oneOf:
+ - $ref: "#/components/schemas/SharedDashboardIncludedDashboard"
+ - $ref: "#/components/schemas/SharedDashboardIncludedUser"
+ SharedDashboardIncludedDashboard:
+ description: Included dashboard resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/SharedDashboardIncludedDashboardAttributes"
+ id:
+ description: ID of the dashboard.
+ example: abc-def-ghi
+ type: string
+ type:
+ $ref: "#/components/schemas/SharedDashboardIncludedDashboardType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ SharedDashboardIncludedDashboardAttributes:
+ description: Attributes of the included dashboard.
+ properties:
+ title:
+ description: Dashboard title.
+ example: Q1 Metrics Dashboard
+ type: string
+ required:
+ - title
+ type: object
+ SharedDashboardIncludedDashboardType:
+ default: dashboard
+ description: Included dashboard resource type.
+ enum:
+ - dashboard
+ example: dashboard
+ type: string
+ x-enum-varnames:
+ - DASHBOARD
+ SharedDashboardIncludedUser:
+ description: Included user resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/SharedDashboardIncludedUserAttributes"
+ id:
+ description: ID of the user.
+ example: 00000000-0000-0000-0000-000000000000
+ type: string
+ type:
+ $ref: "#/components/schemas/UserResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ SharedDashboardIncludedUserAttributes:
+ description: Attributes of the included user.
+ properties:
+ handle:
+ description: User handle.
+ example: jane.doe@example.com
+ type: string
+ name:
+ description: User display name.
+ example: Jane Doe
+ type: string
+ required:
+ - handle
+ - name
+ type: object
+ SharedDashboardInvitee:
+ description: Invitee that can access an invite-only shared dashboard.
+ properties:
+ access_expiration:
+ description: Time when the invitee's access expires.
+ example: "2026-01-15T09:30:00.000Z"
+ format: date-time
+ nullable: true
+ type: string
+ created_at:
+ description: Time when the invitee was added.
+ example: "2026-01-01T00:00:00.000Z"
+ format: date-time
+ type: string
+ email:
+ description: Email address of the invitee.
+ example: jane.doe@example.com
+ type: string
+ required:
+ - email
+ - access_expiration
+ - created_at
+ type: object
+ SharedDashboardRelationshipDashboard:
+ description: Dashboard associated with the shared dashboard.
+ properties:
+ data:
+ $ref: "#/components/schemas/SharedDashboardRelationshipDashboardData"
+ required:
+ - data
+ type: object
+ SharedDashboardRelationshipDashboardData:
+ description: Dashboard relationship data.
+ properties:
+ id:
+ description: ID of the dashboard.
+ example: abc-def-ghi
+ type: string
+ type:
+ $ref: "#/components/schemas/SharedDashboardIncludedDashboardType"
+ required:
+ - id
+ - type
+ type: object
+ SharedDashboardRelationshipSharer:
+ description: User who shared the dashboard.
+ properties:
+ data:
+ $ref: "#/components/schemas/UserRelationshipData"
+ required:
+ - data
+ type: object
+ SharedDashboardRelationships:
+ description: Relationships of a shared dashboard.
+ properties:
+ dashboard:
+ $ref: "#/components/schemas/SharedDashboardRelationshipDashboard"
+ sharer:
+ $ref: "#/components/schemas/SharedDashboardRelationshipSharer"
+ required:
+ - dashboard
+ - sharer
+ type: object
+ SharedDashboardResponse:
+ description: A shared dashboard response resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/SharedDashboardResponseAttributes"
+ id:
+ description: ID of the shared dashboard.
+ example: "12345"
+ type: string
+ relationships:
+ $ref: "#/components/schemas/SharedDashboardRelationships"
+ type:
+ $ref: "#/components/schemas/SharedDashboardType"
+ required:
+ - id
+ - type
+ - attributes
+ - relationships
+ type: object
+ SharedDashboardResponseAttributes:
+ description: Attributes of a shared dashboard response.
+ properties:
+ created_at:
+ description: Time when the shared dashboard was created.
+ example: "2026-01-01T00:00:00.000Z"
+ format: date-time
+ type: string
+ embeddable_domains:
+ description: Domains where embed-type shared dashboards can be embedded.
+ example: ["https://example.com"]
+ items:
+ description: An embeddable domain.
+ type: string
+ type: array
+ expiration:
+ description: Time when the shared dashboard expires.
+ example: "2026-02-01T00:00:00.000Z"
+ format: date-time
+ nullable: true
+ type: string
+ global_time:
+ $ref: "#/components/schemas/SharedDashboardGlobalTime"
+ global_time_selectable:
+ description: Whether viewers can select a different global time setting.
+ example: false
+ type: boolean
+ invitees:
+ description: Invitees for invite-only shared dashboards.
+ items:
+ $ref: "#/components/schemas/SharedDashboardInvitee"
+ type: array
+ last_accessed:
+ description: Time when the shared dashboard was last accessed.
+ example: "2026-01-15T09:30:00.000Z"
+ format: date-time
+ nullable: true
+ type: string
+ selectable_template_vars:
+ description: Template variables that viewers can modify.
+ items:
+ $ref: "#/components/schemas/SharedDashboardSelectableTemplateVariable"
+ type: array
+ share_type:
+ $ref: "#/components/schemas/SharedDashboardShareType"
+ sharer_disabled:
+ description: Whether the user who shared the dashboard is disabled.
+ example: false
+ type: boolean
+ status:
+ $ref: "#/components/schemas/SharedDashboardStatus"
+ title:
+ description: Display title for the shared dashboard.
+ example: Q1 Metrics Dashboard
+ type: string
+ token:
+ description: Token assigned to the shared dashboard.
+ example: abc-123-token
+ type: string
+ url:
+ description: URL for the shared dashboard.
+ example: https://p.datadoghq.com/sb/abc-123-token
+ type: string
+ viewing_preferences:
+ $ref: "#/components/schemas/SharedDashboardViewingPreferences"
+ required:
+ - token
+ - title
+ - url
+ - viewing_preferences
+ - global_time_selectable
+ - global_time
+ - selectable_template_vars
+ - created_at
+ - last_accessed
+ - status
+ - share_type
+ - invitees
+ - embeddable_domains
+ - expiration
+ - sharer_disabled
+ type: object
+ SharedDashboardSelectableTemplateVariable:
+ description: A template variable that viewers can modify on the shared dashboard.
+ properties:
+ allow_any_value:
+ description: Whether viewers can see all tag values for the template variable and specify any value.
+ example: false
+ type: boolean
+ default_values:
+ description: Default selected values for the variable.
+ example: ["prod"]
+ items:
+ description: A default value for the template variable.
+ type: string
+ type: array
+ name:
+ description: Name of the template variable.
+ example: environment
+ type: string
+ prefix:
+ description: Tag prefix for the variable.
+ example: env
+ type: string
+ type:
+ description: Type of the template variable.
+ example: group
+ type: string
+ visible_tags:
+ description: Restricts which tag values are visible to the viewer.
+ example: ["prod"]
+ items:
+ description: A visible tag value for the template variable.
+ type: string
+ type: array
+ required:
+ - name
+ - prefix
+ - type
+ - allow_any_value
+ - default_values
+ - visible_tags
+ type: object
+ SharedDashboardShareType:
+ description: Type of dashboard sharing.
+ enum:
+ - open
+ - invite
+ - embed
+ - secure-embed
+ example: invite
+ type: string
+ x-enum-varnames:
+ - OPEN
+ - INVITE
+ - EMBED
+ - SECURE_EMBED
+ SharedDashboardStatus:
+ description: Status of the shared dashboard.
+ enum:
+ - active
+ - paused
+ example: active
+ type: string
+ x-enum-varnames:
+ - ACTIVE
+ - PAUSED
+ SharedDashboardType:
+ default: shared_dashboard
+ description: Shared dashboard resource type.
+ enum:
+ - shared_dashboard
+ example: shared_dashboard
+ type: string
+ x-enum-varnames:
+ - SHARED_DASHBOARD
+ SharedDashboardViewingPreferences:
+ description: Display settings for the shared dashboard.
+ properties:
+ high_density:
+ description: Whether widgets are displayed in high-density mode.
+ example: false
+ type: boolean
+ theme:
+ $ref: "#/components/schemas/SharedDashboardViewingPreferencesTheme"
+ required:
+ - high_density
+ - theme
+ type: object
+ SharedDashboardViewingPreferencesTheme:
+ description: The theme of the shared dashboard view. `system` follows the viewer's system default.
+ enum:
+ - system
+ - light
+ - dark
+ example: system
+ type: string
+ x-enum-varnames:
+ - SYSTEM
+ - LIGHT
+ - DARK
Shift:
description: An on-call shift with its associated data and relationships.
example:
@@ -120533,6 +120899,95 @@ paths:
tags:
- Dashboard Lists
x-codegen-request-body-name: body
+ /api/v2/dashboard/{dashboard_id}/shared:
+ get:
+ description: Retrieve shared dashboards associated with the specified dashboard.
+ operationId: ListSharedDashboardsByDashboardId
+ parameters:
+ - $ref: "#/components/parameters/SharedDashboardDashboardIDPathParameter"
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ created_at: "2026-01-01T00:00:00.000Z"
+ embeddable_domains: []
+ expiration:
+ global_time:
+ live_span: 1h
+ global_time_selectable: false
+ invitees:
+ - access_expiration:
+ created_at: "2026-01-01T00:00:00.000Z"
+ email: jane.doe@example.com
+ last_accessed:
+ selectable_template_vars: []
+ share_type: invite
+ sharer_disabled: false
+ status: active
+ title: Q1 Metrics Dashboard
+ token: abc-123-token
+ url: https://p.datadoghq.com/sb/abc-123-token
+ viewing_preferences:
+ high_density: false
+ theme: system
+ id: "12345"
+ relationships:
+ dashboard:
+ data:
+ id: abc-def-ghi
+ type: dashboard
+ sharer:
+ data:
+ id: 00000000-0000-0000-0000-000000000000
+ type: user
+ type: shared_dashboard
+ included:
+ - attributes:
+ title: Q1 Metrics Dashboard
+ id: abc-def-ghi
+ type: dashboard
+ - attributes:
+ handle: jane.doe@example.com
+ name: Jane Doe
+ id: 00000000-0000-0000-0000-000000000000
+ type: user
+ schema:
+ $ref: "#/components/schemas/ListSharedDashboardsResponse"
+ description: OK
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Dashboard Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - dashboards_read
+ summary: List shared dashboards for a dashboard
+ tags:
+ - Dashboard Sharing
+ "x-permission":
+ operator: OR
+ permissions:
+ - dashboards_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/dashboard/{dashboard_id}/shared/secure-embed:
post:
description: >-
@@ -181189,6 +181644,8 @@ tags:
- **Embed** sharing must be enabled under **Organization Settings** > **Public Sharing** > **Shared Dashboards**.
- You need [an API key and an application key](https://docs.datadoghq.com/account_management/api-app-keys/) to interact with these endpoints.
name: Dashboard Secure Embed
+ - description: Manage dashboard sharing configurations.
+ name: Dashboard Sharing
- description: |-
Get usage statistics for the dashboards in your organization, including view
counts, last-edit times, widget counts, and quality scores. See the
diff --git a/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.java b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.java
new file mode 100644
index 00000000000..83a1e729ce7
--- /dev/null
+++ b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.java
@@ -0,0 +1,27 @@
+// List shared dashboards for a dashboard returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DashboardSharingApi;
+import com.datadog.api.client.v2.model.ListSharedDashboardsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listSharedDashboardsByDashboardId", true);
+ DashboardSharingApi apiInstance = new DashboardSharingApi(defaultClient);
+
+ try {
+ ListSharedDashboardsResponse result =
+ apiInstance.listSharedDashboardsByDashboardId("abc-def-ghi");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling DashboardSharingApi#listSharedDashboardsByDashboardId");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index 3c2d2401c35..ee8a7ccf89d 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -972,6 +972,7 @@ public class ApiClient {
put("v2.listCostTagMetadataMonths", false);
put("v2.listCostTagMetadataOrchestrators", false);
put("v2.searchCostRecommendations", false);
+ put("v2.listSharedDashboardsByDashboardId", false);
put("v2.createDashboardSecureEmbed", false);
put("v2.deleteDashboardSecureEmbed", false);
put("v2.getDashboardSecureEmbed", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/DashboardSharingApi.java b/src/main/java/com/datadog/api/client/v2/api/DashboardSharingApi.java
new file mode 100644
index 00000000000..558e9a28614
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/DashboardSharingApi.java
@@ -0,0 +1,208 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.ListSharedDashboardsResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DashboardSharingApi {
+ private ApiClient apiClient;
+
+ public DashboardSharingApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public DashboardSharingApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * List shared dashboards for a dashboard.
+ *
+ *
See {@link #listSharedDashboardsByDashboardIdWithHttpInfo}.
+ *
+ * @param dashboardId ID of the dashboard. (required)
+ * @return ListSharedDashboardsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListSharedDashboardsResponse listSharedDashboardsByDashboardId(String dashboardId)
+ throws ApiException {
+ return listSharedDashboardsByDashboardIdWithHttpInfo(dashboardId).getData();
+ }
+
+ /**
+ * List shared dashboards for a dashboard.
+ *
+ *
See {@link #listSharedDashboardsByDashboardIdWithHttpInfoAsync}.
+ *
+ * @param dashboardId ID of the dashboard. (required)
+ * @return CompletableFuture<ListSharedDashboardsResponse>
+ */
+ public CompletableFuture listSharedDashboardsByDashboardIdAsync(
+ String dashboardId) {
+ return listSharedDashboardsByDashboardIdWithHttpInfoAsync(dashboardId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve shared dashboards associated with the specified dashboard.
+ *
+ * @param dashboardId ID of the dashboard. (required)
+ * @return ApiResponse<ListSharedDashboardsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Dashboard Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listSharedDashboardsByDashboardIdWithHttpInfo(
+ String dashboardId) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listSharedDashboardsByDashboardId";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'dashboardId' is set
+ if (dashboardId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'dashboardId' when calling"
+ + " listSharedDashboardsByDashboardId");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/dashboard/{dashboard_id}/shared"
+ .replaceAll(
+ "\\{" + "dashboard_id" + "\\}", apiClient.escapeString(dashboardId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DashboardSharingApi.listSharedDashboardsByDashboardId",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List shared dashboards for a dashboard.
+ *
+ * See {@link #listSharedDashboardsByDashboardIdWithHttpInfo}.
+ *
+ * @param dashboardId ID of the dashboard. (required)
+ * @return CompletableFuture<ApiResponse<ListSharedDashboardsResponse>>
+ */
+ public CompletableFuture>
+ listSharedDashboardsByDashboardIdWithHttpInfoAsync(String dashboardId) {
+ // Check if unstable operation is enabled
+ String operationId = "listSharedDashboardsByDashboardId";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'dashboardId' is set
+ if (dashboardId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'dashboardId' when calling"
+ + " listSharedDashboardsByDashboardId"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/dashboard/{dashboard_id}/shared"
+ .replaceAll(
+ "\\{" + "dashboard_id" + "\\}", apiClient.escapeString(dashboardId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DashboardSharingApi.listSharedDashboardsByDashboardId",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/ListSharedDashboardsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListSharedDashboardsResponse.java
new file mode 100644
index 00000000000..c5150145992
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/ListSharedDashboardsResponse.java
@@ -0,0 +1,195 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** Response containing shared dashboards for a dashboard. */
+@JsonPropertyOrder({
+ ListSharedDashboardsResponse.JSON_PROPERTY_DATA,
+ ListSharedDashboardsResponse.JSON_PROPERTY_INCLUDED
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class ListSharedDashboardsResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private List data = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_INCLUDED = "included";
+ private List included = new ArrayList<>();
+
+ public ListSharedDashboardsResponse() {}
+
+ @JsonCreator
+ public ListSharedDashboardsResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data,
+ @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDED)
+ List included) {
+ this.data = data;
+ this.included = included;
+ }
+
+ public ListSharedDashboardsResponse data(List data) {
+ this.data = data;
+ for (SharedDashboardResponse item : data) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public ListSharedDashboardsResponse addDataItem(SharedDashboardResponse dataItem) {
+ this.data.add(dataItem);
+ this.unparsed |= dataItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Shared dashboards for the dashboard.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public ListSharedDashboardsResponse included(List included) {
+ this.included = included;
+ for (SharedDashboardIncluded item : included) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public ListSharedDashboardsResponse addIncludedItem(SharedDashboardIncluded includedItem) {
+ this.included.add(includedItem);
+ this.unparsed |= includedItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Users and dashboards related to the shared dashboards.
+ *
+ * @return included
+ */
+ @JsonProperty(JSON_PROPERTY_INCLUDED)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getIncluded() {
+ return included;
+ }
+
+ public void setIncluded(List included) {
+ this.included = included;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return ListSharedDashboardsResponse
+ */
+ @JsonAnySetter
+ public ListSharedDashboardsResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this ListSharedDashboardsResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ListSharedDashboardsResponse listSharedDashboardsResponse = (ListSharedDashboardsResponse) o;
+ return Objects.equals(this.data, listSharedDashboardsResponse.data)
+ && Objects.equals(this.included, listSharedDashboardsResponse.included)
+ && Objects.equals(
+ this.additionalProperties, listSharedDashboardsResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, included, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ListSharedDashboardsResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" included: ").append(toIndentedString(included)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncluded.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncluded.java
new file mode 100644
index 00000000000..ad99807120a
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncluded.java
@@ -0,0 +1,286 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.AbstractOpenApiSchema;
+import com.datadog.api.client.JSON;
+import com.datadog.api.client.UnparsedObject;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import jakarta.ws.rs.core.GenericType;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+@JsonDeserialize(using = SharedDashboardIncluded.SharedDashboardIncludedDeserializer.class)
+@JsonSerialize(using = SharedDashboardIncluded.SharedDashboardIncludedSerializer.class)
+public class SharedDashboardIncluded extends AbstractOpenApiSchema {
+ private static final Logger log = Logger.getLogger(SharedDashboardIncluded.class.getName());
+
+ @JsonIgnore public boolean unparsed = false;
+
+ public static class SharedDashboardIncludedSerializer
+ extends StdSerializer {
+ public SharedDashboardIncludedSerializer(Class t) {
+ super(t);
+ }
+
+ public SharedDashboardIncludedSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ SharedDashboardIncluded value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class SharedDashboardIncludedDeserializer
+ extends StdDeserializer {
+ public SharedDashboardIncludedDeserializer() {
+ this(SharedDashboardIncluded.class);
+ }
+
+ public SharedDashboardIncludedDeserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public SharedDashboardIncluded deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ JsonNode tree = jp.readValueAsTree();
+ Object deserialized = null;
+ Object tmp = null;
+ boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
+ int match = 0;
+ JsonToken token = tree.traverse(jp.getCodec()).nextToken();
+ // deserialize SharedDashboardIncludedDashboard
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (SharedDashboardIncludedDashboard.class.equals(Integer.class)
+ || SharedDashboardIncludedDashboard.class.equals(Long.class)
+ || SharedDashboardIncludedDashboard.class.equals(Float.class)
+ || SharedDashboardIncludedDashboard.class.equals(Double.class)
+ || SharedDashboardIncludedDashboard.class.equals(Boolean.class)
+ || SharedDashboardIncludedDashboard.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((SharedDashboardIncludedDashboard.class.equals(Integer.class)
+ || SharedDashboardIncludedDashboard.class.equals(Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((SharedDashboardIncludedDashboard.class.equals(Float.class)
+ || SharedDashboardIncludedDashboard.class.equals(Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (SharedDashboardIncludedDashboard.class.equals(Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (SharedDashboardIncludedDashboard.class.equals(String.class)
+ && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp = tree.traverse(jp.getCodec()).readValueAs(SharedDashboardIncludedDashboard.class);
+ // TODO: there is no validation against JSON schema constraints
+ // (min, max, enum, pattern...), this does not perform a strict JSON
+ // validation, which means the 'match' count may be higher than it should be.
+ if (!((SharedDashboardIncludedDashboard) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(Level.FINER, "Input data matches schema 'SharedDashboardIncludedDashboard'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(
+ Level.FINER, "Input data does not match schema 'SharedDashboardIncludedDashboard'", e);
+ }
+
+ // deserialize SharedDashboardIncludedUser
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (SharedDashboardIncludedUser.class.equals(Integer.class)
+ || SharedDashboardIncludedUser.class.equals(Long.class)
+ || SharedDashboardIncludedUser.class.equals(Float.class)
+ || SharedDashboardIncludedUser.class.equals(Double.class)
+ || SharedDashboardIncludedUser.class.equals(Boolean.class)
+ || SharedDashboardIncludedUser.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((SharedDashboardIncludedUser.class.equals(Integer.class)
+ || SharedDashboardIncludedUser.class.equals(Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((SharedDashboardIncludedUser.class.equals(Float.class)
+ || SharedDashboardIncludedUser.class.equals(Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (SharedDashboardIncludedUser.class.equals(Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (SharedDashboardIncludedUser.class.equals(String.class)
+ && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp = tree.traverse(jp.getCodec()).readValueAs(SharedDashboardIncludedUser.class);
+ // TODO: there is no validation against JSON schema constraints
+ // (min, max, enum, pattern...), this does not perform a strict JSON
+ // validation, which means the 'match' count may be higher than it should be.
+ if (!((SharedDashboardIncludedUser) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(Level.FINER, "Input data matches schema 'SharedDashboardIncludedUser'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(Level.FINER, "Input data does not match schema 'SharedDashboardIncludedUser'", e);
+ }
+
+ SharedDashboardIncluded ret = new SharedDashboardIncluded();
+ if (match == 1) {
+ ret.setActualInstance(deserialized);
+ } else {
+ Map res =
+ new ObjectMapper()
+ .readValue(
+ tree.traverse(jp.getCodec()).readValueAsTree().toString(),
+ new TypeReference