From de3836a33594cce3eba213d308b7abe013580ddc Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 8 Jun 2026 16:46:07 +0000 Subject: [PATCH] Regenerate client from commit e9a2b14 of spec repo --- .generator/schemas/v2/openapi.yaml | 457 +++++++++++++ .../ListSharedDashboardsByDashboardId.java | 27 + .../com/datadog/api/client/ApiClient.java | 1 + .../client/v2/api/DashboardSharingApi.java | 208 ++++++ .../model/ListSharedDashboardsResponse.java | 195 ++++++ .../v2/model/SharedDashboardIncluded.java | 286 ++++++++ .../SharedDashboardIncludedDashboard.java | 214 ++++++ ...dDashboardIncludedDashboardAttributes.java | 147 ++++ .../SharedDashboardIncludedDashboardType.java | 59 ++ .../v2/model/SharedDashboardIncludedUser.java | 210 ++++++ ...SharedDashboardIncludedUserAttributes.java | 175 +++++ .../v2/model/SharedDashboardInvitee.java | 206 ++++++ .../SharedDashboardRelationshipDashboard.java | 148 +++++ ...redDashboardRelationshipDashboardData.java | 183 +++++ .../SharedDashboardRelationshipSharer.java | 147 ++++ .../model/SharedDashboardRelationships.java | 180 +++++ .../v2/model/SharedDashboardResponse.java | 240 +++++++ .../SharedDashboardResponseAttributes.java | 628 ++++++++++++++++++ ...edDashboardSelectableTemplateVariable.java | 304 +++++++++ .../v2/model/SharedDashboardShareType.java | 60 ++ .../v2/model/SharedDashboardStatus.java | 56 ++ .../client/v2/model/SharedDashboardType.java | 56 ++ .../SharedDashboardViewingPreferences.java | 182 +++++ ...haredDashboardViewingPreferencesTheme.java | 69 ++ .../client/v2/api/dashboard_sharing.feature | 22 + .../com/datadog/api/client/v2/api/undo.json | 6 + 26 files changed, 4466 insertions(+) create mode 100644 examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/DashboardSharingApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListSharedDashboardsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncluded.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboard.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUser.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUserAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardInvitee.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboard.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboardData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipSharer.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardSelectableTemplateVariable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardShareType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardStatus.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferences.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferencesTheme.java create mode 100644 src/test/resources/com/datadog/api/client/v2/api/dashboard_sharing.feature 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>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public SharedDashboardIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "SharedDashboardIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public SharedDashboardIncluded() { + super("oneOf", Boolean.FALSE); + } + + public SharedDashboardIncluded(SharedDashboardIncludedDashboard o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SharedDashboardIncluded(SharedDashboardIncludedUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "SharedDashboardIncludedDashboard", new GenericType() {}); + schemas.put("SharedDashboardIncludedUser", new GenericType() {}); + JSON.registerDescendants(SharedDashboardIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return SharedDashboardIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: SharedDashboardIncludedDashboard, SharedDashboardIncludedUser + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + SharedDashboardIncludedDashboard.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(SharedDashboardIncludedUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be SharedDashboardIncludedDashboard," + + " SharedDashboardIncludedUser"); + } + + /** + * Get the actual instance, which can be the following: SharedDashboardIncludedDashboard, + * SharedDashboardIncludedUser + * + * @return The actual instance (SharedDashboardIncludedDashboard, SharedDashboardIncludedUser) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SharedDashboardIncludedDashboard`. If the actual instance is not + * `SharedDashboardIncludedDashboard`, the ClassCastException will be thrown. + * + * @return The actual instance of `SharedDashboardIncludedDashboard` + * @throws ClassCastException if the instance is not `SharedDashboardIncludedDashboard` + */ + public SharedDashboardIncludedDashboard getSharedDashboardIncludedDashboard() + throws ClassCastException { + return (SharedDashboardIncludedDashboard) super.getActualInstance(); + } + + /** + * Get the actual instance of `SharedDashboardIncludedUser`. If the actual instance is not + * `SharedDashboardIncludedUser`, the ClassCastException will be thrown. + * + * @return The actual instance of `SharedDashboardIncludedUser` + * @throws ClassCastException if the instance is not `SharedDashboardIncludedUser` + */ + public SharedDashboardIncludedUser getSharedDashboardIncludedUser() throws ClassCastException { + return (SharedDashboardIncludedUser) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboard.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboard.java new file mode 100644 index 00000000000..81177686223 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboard.java @@ -0,0 +1,214 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Included dashboard resource. */ +@JsonPropertyOrder({ + SharedDashboardIncludedDashboard.JSON_PROPERTY_ATTRIBUTES, + SharedDashboardIncludedDashboard.JSON_PROPERTY_ID, + SharedDashboardIncludedDashboard.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardIncludedDashboard { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SharedDashboardIncludedDashboardAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SharedDashboardIncludedDashboardType type = + SharedDashboardIncludedDashboardType.DASHBOARD; + + public SharedDashboardIncludedDashboard() {} + + @JsonCreator + public SharedDashboardIncludedDashboard( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SharedDashboardIncludedDashboardAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SharedDashboardIncludedDashboardType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SharedDashboardIncludedDashboard attributes( + SharedDashboardIncludedDashboardAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the included dashboard. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardIncludedDashboardAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SharedDashboardIncludedDashboardAttributes attributes) { + this.attributes = attributes; + } + + public SharedDashboardIncludedDashboard id(String id) { + this.id = id; + return this; + } + + /** + * ID of the dashboard. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SharedDashboardIncludedDashboard type(SharedDashboardIncludedDashboardType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Included dashboard resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardIncludedDashboardType getType() { + return type; + } + + public void setType(SharedDashboardIncludedDashboardType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 SharedDashboardIncludedDashboard + */ + @JsonAnySetter + public SharedDashboardIncludedDashboard 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 SharedDashboardIncludedDashboard object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardIncludedDashboard sharedDashboardIncludedDashboard = + (SharedDashboardIncludedDashboard) o; + return Objects.equals(this.attributes, sharedDashboardIncludedDashboard.attributes) + && Objects.equals(this.id, sharedDashboardIncludedDashboard.id) + && Objects.equals(this.type, sharedDashboardIncludedDashboard.type) + && Objects.equals( + this.additionalProperties, sharedDashboardIncludedDashboard.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardIncludedDashboard {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/SharedDashboardIncludedDashboardAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardAttributes.java new file mode 100644 index 00000000000..d288cfc366b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardAttributes.java @@ -0,0 +1,147 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the included dashboard. */ +@JsonPropertyOrder({SharedDashboardIncludedDashboardAttributes.JSON_PROPERTY_TITLE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardIncludedDashboardAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public SharedDashboardIncludedDashboardAttributes() {} + + @JsonCreator + public SharedDashboardIncludedDashboardAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.title = title; + } + + public SharedDashboardIncludedDashboardAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Dashboard title. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 SharedDashboardIncludedDashboardAttributes + */ + @JsonAnySetter + public SharedDashboardIncludedDashboardAttributes 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 SharedDashboardIncludedDashboardAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardIncludedDashboardAttributes sharedDashboardIncludedDashboardAttributes = + (SharedDashboardIncludedDashboardAttributes) o; + return Objects.equals(this.title, sharedDashboardIncludedDashboardAttributes.title) + && Objects.equals( + this.additionalProperties, + sharedDashboardIncludedDashboardAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardIncludedDashboardAttributes {\n"); + sb.append(" title: ").append(toIndentedString(title)).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/SharedDashboardIncludedDashboardType.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardType.java new file mode 100644 index 00000000000..cac118f62b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedDashboardType.java @@ -0,0 +1,59 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Included dashboard resource type. */ +@JsonSerialize( + using = + SharedDashboardIncludedDashboardType.SharedDashboardIncludedDashboardTypeSerializer.class) +public class SharedDashboardIncludedDashboardType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("dashboard")); + + public static final SharedDashboardIncludedDashboardType DASHBOARD = + new SharedDashboardIncludedDashboardType("dashboard"); + + SharedDashboardIncludedDashboardType(String value) { + super(value, allowedValues); + } + + public static class SharedDashboardIncludedDashboardTypeSerializer + extends StdSerializer { + public SharedDashboardIncludedDashboardTypeSerializer( + Class t) { + super(t); + } + + public SharedDashboardIncludedDashboardTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SharedDashboardIncludedDashboardType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SharedDashboardIncludedDashboardType fromValue(String value) { + return new SharedDashboardIncludedDashboardType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUser.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUser.java new file mode 100644 index 00000000000..d7ee65d82fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUser.java @@ -0,0 +1,210 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Included user resource. */ +@JsonPropertyOrder({ + SharedDashboardIncludedUser.JSON_PROPERTY_ATTRIBUTES, + SharedDashboardIncludedUser.JSON_PROPERTY_ID, + SharedDashboardIncludedUser.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardIncludedUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SharedDashboardIncludedUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserResourceType type = UserResourceType.USER; + + public SharedDashboardIncludedUser() {} + + @JsonCreator + public SharedDashboardIncludedUser( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SharedDashboardIncludedUserAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SharedDashboardIncludedUser attributes(SharedDashboardIncludedUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the included user. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardIncludedUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SharedDashboardIncludedUserAttributes attributes) { + this.attributes = attributes; + } + + public SharedDashboardIncludedUser id(String id) { + this.id = id; + return this; + } + + /** + * ID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SharedDashboardIncludedUser type(UserResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserResourceType getType() { + return type; + } + + public void setType(UserResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 SharedDashboardIncludedUser + */ + @JsonAnySetter + public SharedDashboardIncludedUser 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 SharedDashboardIncludedUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardIncludedUser sharedDashboardIncludedUser = (SharedDashboardIncludedUser) o; + return Objects.equals(this.attributes, sharedDashboardIncludedUser.attributes) + && Objects.equals(this.id, sharedDashboardIncludedUser.id) + && Objects.equals(this.type, sharedDashboardIncludedUser.type) + && Objects.equals( + this.additionalProperties, sharedDashboardIncludedUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardIncludedUser {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/SharedDashboardIncludedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUserAttributes.java new file mode 100644 index 00000000000..3f94b4c174d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardIncludedUserAttributes.java @@ -0,0 +1,175 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the included user. */ +@JsonPropertyOrder({ + SharedDashboardIncludedUserAttributes.JSON_PROPERTY_HANDLE, + SharedDashboardIncludedUserAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardIncludedUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SharedDashboardIncludedUserAttributes() {} + + @JsonCreator + public SharedDashboardIncludedUserAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public SharedDashboardIncludedUserAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * User handle. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public SharedDashboardIncludedUserAttributes name(String name) { + this.name = name; + return this; + } + + /** + * User display name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 SharedDashboardIncludedUserAttributes + */ + @JsonAnySetter + public SharedDashboardIncludedUserAttributes 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 SharedDashboardIncludedUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardIncludedUserAttributes sharedDashboardIncludedUserAttributes = + (SharedDashboardIncludedUserAttributes) o; + return Objects.equals(this.handle, sharedDashboardIncludedUserAttributes.handle) + && Objects.equals(this.name, sharedDashboardIncludedUserAttributes.name) + && Objects.equals( + this.additionalProperties, sharedDashboardIncludedUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardIncludedUserAttributes {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/SharedDashboardInvitee.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardInvitee.java new file mode 100644 index 00000000000..bcd741bc452 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardInvitee.java @@ -0,0 +1,206 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Invitee that can access an invite-only shared dashboard. */ +@JsonPropertyOrder({ + SharedDashboardInvitee.JSON_PROPERTY_ACCESS_EXPIRATION, + SharedDashboardInvitee.JSON_PROPERTY_CREATED_AT, + SharedDashboardInvitee.JSON_PROPERTY_EMAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardInvitee { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_EXPIRATION = "access_expiration"; + private OffsetDateTime accessExpiration; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public SharedDashboardInvitee() {} + + @JsonCreator + public SharedDashboardInvitee( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCESS_EXPIRATION) + OffsetDateTime accessExpiration, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_EMAIL) String email) { + this.accessExpiration = accessExpiration; + if (accessExpiration != null) {} + this.createdAt = createdAt; + this.email = email; + } + + public SharedDashboardInvitee accessExpiration(OffsetDateTime accessExpiration) { + this.accessExpiration = accessExpiration; + if (accessExpiration != null) {} + return this; + } + + /** + * Time when the invitee's access expires. + * + * @return accessExpiration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getAccessExpiration() { + return accessExpiration; + } + + public void setAccessExpiration(OffsetDateTime accessExpiration) { + this.accessExpiration = accessExpiration; + } + + public SharedDashboardInvitee createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time when the invitee was added. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public SharedDashboardInvitee email(String email) { + this.email = email; + return this; + } + + /** + * Email address of the invitee. + * + * @return email + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + /** + * 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 SharedDashboardInvitee + */ + @JsonAnySetter + public SharedDashboardInvitee 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 SharedDashboardInvitee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardInvitee sharedDashboardInvitee = (SharedDashboardInvitee) o; + return Objects.equals(this.accessExpiration, sharedDashboardInvitee.accessExpiration) + && Objects.equals(this.createdAt, sharedDashboardInvitee.createdAt) + && Objects.equals(this.email, sharedDashboardInvitee.email) + && Objects.equals(this.additionalProperties, sharedDashboardInvitee.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessExpiration, createdAt, email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardInvitee {\n"); + sb.append(" accessExpiration: ").append(toIndentedString(accessExpiration)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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/SharedDashboardRelationshipDashboard.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboard.java new file mode 100644 index 00000000000..23257211d47 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboard.java @@ -0,0 +1,148 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Dashboard associated with the shared dashboard. */ +@JsonPropertyOrder({SharedDashboardRelationshipDashboard.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardRelationshipDashboard { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SharedDashboardRelationshipDashboardData data; + + public SharedDashboardRelationshipDashboard() {} + + @JsonCreator + public SharedDashboardRelationshipDashboard( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + SharedDashboardRelationshipDashboardData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SharedDashboardRelationshipDashboard data(SharedDashboardRelationshipDashboardData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Dashboard relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardRelationshipDashboardData getData() { + return data; + } + + public void setData(SharedDashboardRelationshipDashboardData data) { + this.data = data; + } + + /** + * 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 SharedDashboardRelationshipDashboard + */ + @JsonAnySetter + public SharedDashboardRelationshipDashboard 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 SharedDashboardRelationshipDashboard object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardRelationshipDashboard sharedDashboardRelationshipDashboard = + (SharedDashboardRelationshipDashboard) o; + return Objects.equals(this.data, sharedDashboardRelationshipDashboard.data) + && Objects.equals( + this.additionalProperties, sharedDashboardRelationshipDashboard.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardRelationshipDashboard {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/SharedDashboardRelationshipDashboardData.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboardData.java new file mode 100644 index 00000000000..aa7b29362b8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipDashboardData.java @@ -0,0 +1,183 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Dashboard relationship data. */ +@JsonPropertyOrder({ + SharedDashboardRelationshipDashboardData.JSON_PROPERTY_ID, + SharedDashboardRelationshipDashboardData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardRelationshipDashboardData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SharedDashboardIncludedDashboardType type = + SharedDashboardIncludedDashboardType.DASHBOARD; + + public SharedDashboardRelationshipDashboardData() {} + + @JsonCreator + public SharedDashboardRelationshipDashboardData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SharedDashboardIncludedDashboardType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SharedDashboardRelationshipDashboardData id(String id) { + this.id = id; + return this; + } + + /** + * ID of the dashboard. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SharedDashboardRelationshipDashboardData type(SharedDashboardIncludedDashboardType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Included dashboard resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardIncludedDashboardType getType() { + return type; + } + + public void setType(SharedDashboardIncludedDashboardType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 SharedDashboardRelationshipDashboardData + */ + @JsonAnySetter + public SharedDashboardRelationshipDashboardData 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 SharedDashboardRelationshipDashboardData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardRelationshipDashboardData sharedDashboardRelationshipDashboardData = + (SharedDashboardRelationshipDashboardData) o; + return Objects.equals(this.id, sharedDashboardRelationshipDashboardData.id) + && Objects.equals(this.type, sharedDashboardRelationshipDashboardData.type) + && Objects.equals( + this.additionalProperties, + sharedDashboardRelationshipDashboardData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardRelationshipDashboardData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/SharedDashboardRelationshipSharer.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipSharer.java new file mode 100644 index 00000000000..d125e5d6ebb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationshipSharer.java @@ -0,0 +1,147 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** User who shared the dashboard. */ +@JsonPropertyOrder({SharedDashboardRelationshipSharer.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardRelationshipSharer { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserRelationshipData data; + + public SharedDashboardRelationshipSharer() {} + + @JsonCreator + public SharedDashboardRelationshipSharer( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SharedDashboardRelationshipSharer data(UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to user object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserRelationshipData getData() { + return data; + } + + public void setData(UserRelationshipData data) { + this.data = data; + } + + /** + * 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 SharedDashboardRelationshipSharer + */ + @JsonAnySetter + public SharedDashboardRelationshipSharer 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 SharedDashboardRelationshipSharer object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardRelationshipSharer sharedDashboardRelationshipSharer = + (SharedDashboardRelationshipSharer) o; + return Objects.equals(this.data, sharedDashboardRelationshipSharer.data) + && Objects.equals( + this.additionalProperties, sharedDashboardRelationshipSharer.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardRelationshipSharer {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/SharedDashboardRelationships.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationships.java new file mode 100644 index 00000000000..033b2a853b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardRelationships.java @@ -0,0 +1,180 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of a shared dashboard. */ +@JsonPropertyOrder({ + SharedDashboardRelationships.JSON_PROPERTY_DASHBOARD, + SharedDashboardRelationships.JSON_PROPERTY_SHARER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DASHBOARD = "dashboard"; + private SharedDashboardRelationshipDashboard dashboard; + + public static final String JSON_PROPERTY_SHARER = "sharer"; + private SharedDashboardRelationshipSharer sharer; + + public SharedDashboardRelationships() {} + + @JsonCreator + public SharedDashboardRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_DASHBOARD) + SharedDashboardRelationshipDashboard dashboard, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARER) + SharedDashboardRelationshipSharer sharer) { + this.dashboard = dashboard; + this.unparsed |= dashboard.unparsed; + this.sharer = sharer; + this.unparsed |= sharer.unparsed; + } + + public SharedDashboardRelationships dashboard(SharedDashboardRelationshipDashboard dashboard) { + this.dashboard = dashboard; + this.unparsed |= dashboard.unparsed; + return this; + } + + /** + * Dashboard associated with the shared dashboard. + * + * @return dashboard + */ + @JsonProperty(JSON_PROPERTY_DASHBOARD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardRelationshipDashboard getDashboard() { + return dashboard; + } + + public void setDashboard(SharedDashboardRelationshipDashboard dashboard) { + this.dashboard = dashboard; + } + + public SharedDashboardRelationships sharer(SharedDashboardRelationshipSharer sharer) { + this.sharer = sharer; + this.unparsed |= sharer.unparsed; + return this; + } + + /** + * User who shared the dashboard. + * + * @return sharer + */ + @JsonProperty(JSON_PROPERTY_SHARER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardRelationshipSharer getSharer() { + return sharer; + } + + public void setSharer(SharedDashboardRelationshipSharer sharer) { + this.sharer = sharer; + } + + /** + * 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 SharedDashboardRelationships + */ + @JsonAnySetter + public SharedDashboardRelationships 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 SharedDashboardRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardRelationships sharedDashboardRelationships = (SharedDashboardRelationships) o; + return Objects.equals(this.dashboard, sharedDashboardRelationships.dashboard) + && Objects.equals(this.sharer, sharedDashboardRelationships.sharer) + && Objects.equals( + this.additionalProperties, sharedDashboardRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dashboard, sharer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardRelationships {\n"); + sb.append(" dashboard: ").append(toIndentedString(dashboard)).append("\n"); + sb.append(" sharer: ").append(toIndentedString(sharer)).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/SharedDashboardResponse.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponse.java new file mode 100644 index 00000000000..b1678bd0a13 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponse.java @@ -0,0 +1,240 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A shared dashboard response resource. */ +@JsonPropertyOrder({ + SharedDashboardResponse.JSON_PROPERTY_ATTRIBUTES, + SharedDashboardResponse.JSON_PROPERTY_ID, + SharedDashboardResponse.JSON_PROPERTY_RELATIONSHIPS, + SharedDashboardResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SharedDashboardResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private SharedDashboardRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SharedDashboardType type = SharedDashboardType.SHARED_DASHBOARD; + + public SharedDashboardResponse() {} + + @JsonCreator + public SharedDashboardResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SharedDashboardResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + SharedDashboardRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SharedDashboardType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SharedDashboardResponse attributes(SharedDashboardResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a shared dashboard response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SharedDashboardResponseAttributes attributes) { + this.attributes = attributes; + } + + public SharedDashboardResponse id(String id) { + this.id = id; + return this; + } + + /** + * ID of the shared dashboard. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SharedDashboardResponse relationships(SharedDashboardRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a shared dashboard. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardRelationships getRelationships() { + return relationships; + } + + public void setRelationships(SharedDashboardRelationships relationships) { + this.relationships = relationships; + } + + public SharedDashboardResponse type(SharedDashboardType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Shared dashboard resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardType getType() { + return type; + } + + public void setType(SharedDashboardType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 SharedDashboardResponse + */ + @JsonAnySetter + public SharedDashboardResponse 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 SharedDashboardResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardResponse sharedDashboardResponse = (SharedDashboardResponse) o; + return Objects.equals(this.attributes, sharedDashboardResponse.attributes) + && Objects.equals(this.id, sharedDashboardResponse.id) + && Objects.equals(this.relationships, sharedDashboardResponse.relationships) + && Objects.equals(this.type, sharedDashboardResponse.type) + && Objects.equals(this.additionalProperties, sharedDashboardResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardResponse {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/SharedDashboardResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponseAttributes.java new file mode 100644 index 00000000000..7e33114d03e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardResponseAttributes.java @@ -0,0 +1,628 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a shared dashboard response. */ +@JsonPropertyOrder({ + SharedDashboardResponseAttributes.JSON_PROPERTY_CREATED_AT, + SharedDashboardResponseAttributes.JSON_PROPERTY_EMBEDDABLE_DOMAINS, + SharedDashboardResponseAttributes.JSON_PROPERTY_EXPIRATION, + SharedDashboardResponseAttributes.JSON_PROPERTY_GLOBAL_TIME, + SharedDashboardResponseAttributes.JSON_PROPERTY_GLOBAL_TIME_SELECTABLE, + SharedDashboardResponseAttributes.JSON_PROPERTY_INVITEES, + SharedDashboardResponseAttributes.JSON_PROPERTY_LAST_ACCESSED, + SharedDashboardResponseAttributes.JSON_PROPERTY_SELECTABLE_TEMPLATE_VARS, + SharedDashboardResponseAttributes.JSON_PROPERTY_SHARE_TYPE, + SharedDashboardResponseAttributes.JSON_PROPERTY_SHARER_DISABLED, + SharedDashboardResponseAttributes.JSON_PROPERTY_STATUS, + SharedDashboardResponseAttributes.JSON_PROPERTY_TITLE, + SharedDashboardResponseAttributes.JSON_PROPERTY_TOKEN, + SharedDashboardResponseAttributes.JSON_PROPERTY_URL, + SharedDashboardResponseAttributes.JSON_PROPERTY_VIEWING_PREFERENCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_EMBEDDABLE_DOMAINS = "embeddable_domains"; + private List embeddableDomains = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; + private OffsetDateTime expiration; + + public static final String JSON_PROPERTY_GLOBAL_TIME = "global_time"; + private Map globalTime = new HashMap(); + + public static final String JSON_PROPERTY_GLOBAL_TIME_SELECTABLE = "global_time_selectable"; + private Boolean globalTimeSelectable; + + public static final String JSON_PROPERTY_INVITEES = "invitees"; + private List invitees = new ArrayList<>(); + + public static final String JSON_PROPERTY_LAST_ACCESSED = "last_accessed"; + private OffsetDateTime lastAccessed; + + public static final String JSON_PROPERTY_SELECTABLE_TEMPLATE_VARS = "selectable_template_vars"; + private List selectableTemplateVars = + new ArrayList<>(); + + public static final String JSON_PROPERTY_SHARE_TYPE = "share_type"; + private SharedDashboardShareType shareType; + + public static final String JSON_PROPERTY_SHARER_DISABLED = "sharer_disabled"; + private Boolean sharerDisabled; + + public static final String JSON_PROPERTY_STATUS = "status"; + private SharedDashboardStatus status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_VIEWING_PREFERENCES = "viewing_preferences"; + private SharedDashboardViewingPreferences viewingPreferences; + + public SharedDashboardResponseAttributes() {} + + @JsonCreator + public SharedDashboardResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_EMBEDDABLE_DOMAINS) + List embeddableDomains, + @JsonProperty(required = true, value = JSON_PROPERTY_EXPIRATION) OffsetDateTime expiration, + @JsonProperty(required = true, value = JSON_PROPERTY_GLOBAL_TIME) + Map globalTime, + @JsonProperty(required = true, value = JSON_PROPERTY_GLOBAL_TIME_SELECTABLE) + Boolean globalTimeSelectable, + @JsonProperty(required = true, value = JSON_PROPERTY_INVITEES) + List invitees, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_ACCESSED) + OffsetDateTime lastAccessed, + @JsonProperty(required = true, value = JSON_PROPERTY_SELECTABLE_TEMPLATE_VARS) + List selectableTemplateVars, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARE_TYPE) + SharedDashboardShareType shareType, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARER_DISABLED) Boolean sharerDisabled, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) SharedDashboardStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_TOKEN) String token, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url, + @JsonProperty(required = true, value = JSON_PROPERTY_VIEWING_PREFERENCES) + SharedDashboardViewingPreferences viewingPreferences) { + this.createdAt = createdAt; + this.embeddableDomains = embeddableDomains; + this.expiration = expiration; + if (expiration != null) {} + this.globalTime = globalTime; + if (globalTime != null) {} + this.globalTimeSelectable = globalTimeSelectable; + this.invitees = invitees; + this.lastAccessed = lastAccessed; + if (lastAccessed != null) {} + this.selectableTemplateVars = selectableTemplateVars; + this.shareType = shareType; + this.unparsed |= !shareType.isValid(); + this.sharerDisabled = sharerDisabled; + this.status = status; + this.unparsed |= !status.isValid(); + this.title = title; + this.token = token; + this.url = url; + this.viewingPreferences = viewingPreferences; + this.unparsed |= viewingPreferences.unparsed; + } + + public SharedDashboardResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time when the shared dashboard was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public SharedDashboardResponseAttributes embeddableDomains(List embeddableDomains) { + this.embeddableDomains = embeddableDomains; + return this; + } + + public SharedDashboardResponseAttributes addEmbeddableDomainsItem(String embeddableDomainsItem) { + this.embeddableDomains.add(embeddableDomainsItem); + return this; + } + + /** + * Domains where embed-type shared dashboards can be embedded. + * + * @return embeddableDomains + */ + @JsonProperty(JSON_PROPERTY_EMBEDDABLE_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEmbeddableDomains() { + return embeddableDomains; + } + + public void setEmbeddableDomains(List embeddableDomains) { + this.embeddableDomains = embeddableDomains; + } + + public SharedDashboardResponseAttributes expiration(OffsetDateTime expiration) { + this.expiration = expiration; + if (expiration != null) {} + return this; + } + + /** + * Time when the shared dashboard expires. + * + * @return expiration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getExpiration() { + return expiration; + } + + public void setExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + } + + public SharedDashboardResponseAttributes globalTime(Map globalTime) { + this.globalTime = globalTime; + if (globalTime != null) {} + return this; + } + + public SharedDashboardResponseAttributes putGlobalTimeItem(String key, Object globalTimeItem) { + this.globalTime.put(key, globalTimeItem); + return this; + } + + /** + * Default time range configuration for the shared dashboard. + * + * @return globalTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GLOBAL_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getGlobalTime() { + return globalTime; + } + + public void setGlobalTime(Map globalTime) { + this.globalTime = globalTime; + } + + public SharedDashboardResponseAttributes globalTimeSelectable(Boolean globalTimeSelectable) { + this.globalTimeSelectable = globalTimeSelectable; + return this; + } + + /** + * Whether viewers can select a different global time setting. + * + * @return globalTimeSelectable + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_TIME_SELECTABLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getGlobalTimeSelectable() { + return globalTimeSelectable; + } + + public void setGlobalTimeSelectable(Boolean globalTimeSelectable) { + this.globalTimeSelectable = globalTimeSelectable; + } + + public SharedDashboardResponseAttributes invitees(List invitees) { + this.invitees = invitees; + for (SharedDashboardInvitee item : invitees) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SharedDashboardResponseAttributes addInviteesItem(SharedDashboardInvitee inviteesItem) { + this.invitees.add(inviteesItem); + this.unparsed |= inviteesItem.unparsed; + return this; + } + + /** + * Invitees for invite-only shared dashboards. + * + * @return invitees + */ + @JsonProperty(JSON_PROPERTY_INVITEES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInvitees() { + return invitees; + } + + public void setInvitees(List invitees) { + this.invitees = invitees; + } + + public SharedDashboardResponseAttributes lastAccessed(OffsetDateTime lastAccessed) { + this.lastAccessed = lastAccessed; + if (lastAccessed != null) {} + return this; + } + + /** + * Time when the shared dashboard was last accessed. + * + * @return lastAccessed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_ACCESSED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getLastAccessed() { + return lastAccessed; + } + + public void setLastAccessed(OffsetDateTime lastAccessed) { + this.lastAccessed = lastAccessed; + } + + public SharedDashboardResponseAttributes selectableTemplateVars( + List selectableTemplateVars) { + this.selectableTemplateVars = selectableTemplateVars; + for (SharedDashboardSelectableTemplateVariable item : selectableTemplateVars) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SharedDashboardResponseAttributes addSelectableTemplateVarsItem( + SharedDashboardSelectableTemplateVariable selectableTemplateVarsItem) { + this.selectableTemplateVars.add(selectableTemplateVarsItem); + this.unparsed |= selectableTemplateVarsItem.unparsed; + return this; + } + + /** + * Template variables that viewers can modify. + * + * @return selectableTemplateVars + */ + @JsonProperty(JSON_PROPERTY_SELECTABLE_TEMPLATE_VARS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSelectableTemplateVars() { + return selectableTemplateVars; + } + + public void setSelectableTemplateVars( + List selectableTemplateVars) { + this.selectableTemplateVars = selectableTemplateVars; + } + + public SharedDashboardResponseAttributes shareType(SharedDashboardShareType shareType) { + this.shareType = shareType; + this.unparsed |= !shareType.isValid(); + return this; + } + + /** + * Type of dashboard sharing. + * + * @return shareType + */ + @JsonProperty(JSON_PROPERTY_SHARE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardShareType getShareType() { + return shareType; + } + + public void setShareType(SharedDashboardShareType shareType) { + if (!shareType.isValid()) { + this.unparsed = true; + } + this.shareType = shareType; + } + + public SharedDashboardResponseAttributes sharerDisabled(Boolean sharerDisabled) { + this.sharerDisabled = sharerDisabled; + return this; + } + + /** + * Whether the user who shared the dashboard is disabled. + * + * @return sharerDisabled + */ + @JsonProperty(JSON_PROPERTY_SHARER_DISABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getSharerDisabled() { + return sharerDisabled; + } + + public void setSharerDisabled(Boolean sharerDisabled) { + this.sharerDisabled = sharerDisabled; + } + + public SharedDashboardResponseAttributes status(SharedDashboardStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Status of the shared dashboard. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardStatus getStatus() { + return status; + } + + public void setStatus(SharedDashboardStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public SharedDashboardResponseAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Display title for the shared dashboard. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public SharedDashboardResponseAttributes token(String token) { + this.token = token; + return this; + } + + /** + * Token assigned to the shared dashboard. + * + * @return token + */ + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public SharedDashboardResponseAttributes url(String url) { + this.url = url; + return this; + } + + /** + * URL for the shared dashboard. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public SharedDashboardResponseAttributes viewingPreferences( + SharedDashboardViewingPreferences viewingPreferences) { + this.viewingPreferences = viewingPreferences; + this.unparsed |= viewingPreferences.unparsed; + return this; + } + + /** + * Display settings for the shared dashboard. + * + * @return viewingPreferences + */ + @JsonProperty(JSON_PROPERTY_VIEWING_PREFERENCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardViewingPreferences getViewingPreferences() { + return viewingPreferences; + } + + public void setViewingPreferences(SharedDashboardViewingPreferences viewingPreferences) { + this.viewingPreferences = viewingPreferences; + } + + /** + * 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 SharedDashboardResponseAttributes + */ + @JsonAnySetter + public SharedDashboardResponseAttributes 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 SharedDashboardResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardResponseAttributes sharedDashboardResponseAttributes = + (SharedDashboardResponseAttributes) o; + return Objects.equals(this.createdAt, sharedDashboardResponseAttributes.createdAt) + && Objects.equals( + this.embeddableDomains, sharedDashboardResponseAttributes.embeddableDomains) + && Objects.equals(this.expiration, sharedDashboardResponseAttributes.expiration) + && Objects.equals(this.globalTime, sharedDashboardResponseAttributes.globalTime) + && Objects.equals( + this.globalTimeSelectable, sharedDashboardResponseAttributes.globalTimeSelectable) + && Objects.equals(this.invitees, sharedDashboardResponseAttributes.invitees) + && Objects.equals(this.lastAccessed, sharedDashboardResponseAttributes.lastAccessed) + && Objects.equals( + this.selectableTemplateVars, sharedDashboardResponseAttributes.selectableTemplateVars) + && Objects.equals(this.shareType, sharedDashboardResponseAttributes.shareType) + && Objects.equals(this.sharerDisabled, sharedDashboardResponseAttributes.sharerDisabled) + && Objects.equals(this.status, sharedDashboardResponseAttributes.status) + && Objects.equals(this.title, sharedDashboardResponseAttributes.title) + && Objects.equals(this.token, sharedDashboardResponseAttributes.token) + && Objects.equals(this.url, sharedDashboardResponseAttributes.url) + && Objects.equals( + this.viewingPreferences, sharedDashboardResponseAttributes.viewingPreferences) + && Objects.equals( + this.additionalProperties, sharedDashboardResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + embeddableDomains, + expiration, + globalTime, + globalTimeSelectable, + invitees, + lastAccessed, + selectableTemplateVars, + shareType, + sharerDisabled, + status, + title, + token, + url, + viewingPreferences, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardResponseAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" embeddableDomains: ").append(toIndentedString(embeddableDomains)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" globalTime: ").append(toIndentedString(globalTime)).append("\n"); + sb.append(" globalTimeSelectable: ") + .append(toIndentedString(globalTimeSelectable)) + .append("\n"); + sb.append(" invitees: ").append(toIndentedString(invitees)).append("\n"); + sb.append(" lastAccessed: ").append(toIndentedString(lastAccessed)).append("\n"); + sb.append(" selectableTemplateVars: ") + .append(toIndentedString(selectableTemplateVars)) + .append("\n"); + sb.append(" shareType: ").append(toIndentedString(shareType)).append("\n"); + sb.append(" sharerDisabled: ").append(toIndentedString(sharerDisabled)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" viewingPreferences: ").append(toIndentedString(viewingPreferences)).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/SharedDashboardSelectableTemplateVariable.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardSelectableTemplateVariable.java new file mode 100644 index 00000000000..c6074e7fc01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardSelectableTemplateVariable.java @@ -0,0 +1,304 @@ +/* + * 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; + +/** A template variable that viewers can modify on the shared dashboard. */ +@JsonPropertyOrder({ + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_ALLOW_ANY_VALUE, + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_DEFAULT_VALUES, + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_NAME, + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_PREFIX, + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_TYPE, + SharedDashboardSelectableTemplateVariable.JSON_PROPERTY_VISIBLE_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardSelectableTemplateVariable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALLOW_ANY_VALUE = "allow_any_value"; + private Boolean allowAnyValue; + + public static final String JSON_PROPERTY_DEFAULT_VALUES = "default_values"; + private List defaultValues = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private String prefix; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_VISIBLE_TAGS = "visible_tags"; + private List visibleTags = new ArrayList<>(); + + public SharedDashboardSelectableTemplateVariable() {} + + @JsonCreator + public SharedDashboardSelectableTemplateVariable( + @JsonProperty(required = true, value = JSON_PROPERTY_ALLOW_ANY_VALUE) Boolean allowAnyValue, + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT_VALUES) + List defaultValues, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PREFIX) String prefix, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type, + @JsonProperty(required = true, value = JSON_PROPERTY_VISIBLE_TAGS) List visibleTags) { + this.allowAnyValue = allowAnyValue; + this.defaultValues = defaultValues; + this.name = name; + this.prefix = prefix; + this.type = type; + this.visibleTags = visibleTags; + } + + public SharedDashboardSelectableTemplateVariable allowAnyValue(Boolean allowAnyValue) { + this.allowAnyValue = allowAnyValue; + return this; + } + + /** + * Whether viewers can see all tag values for the template variable and specify any value. + * + * @return allowAnyValue + */ + @JsonProperty(JSON_PROPERTY_ALLOW_ANY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getAllowAnyValue() { + return allowAnyValue; + } + + public void setAllowAnyValue(Boolean allowAnyValue) { + this.allowAnyValue = allowAnyValue; + } + + public SharedDashboardSelectableTemplateVariable defaultValues(List defaultValues) { + this.defaultValues = defaultValues; + return this; + } + + public SharedDashboardSelectableTemplateVariable addDefaultValuesItem(String defaultValuesItem) { + this.defaultValues.add(defaultValuesItem); + return this; + } + + /** + * Default selected values for the variable. + * + * @return defaultValues + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDefaultValues() { + return defaultValues; + } + + public void setDefaultValues(List defaultValues) { + this.defaultValues = defaultValues; + } + + public SharedDashboardSelectableTemplateVariable name(String name) { + this.name = name; + return this; + } + + /** + * Name of the template variable. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SharedDashboardSelectableTemplateVariable prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Tag prefix for the variable. + * + * @return prefix + */ + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public SharedDashboardSelectableTemplateVariable type(String type) { + this.type = type; + return this; + } + + /** + * Type of the template variable. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public SharedDashboardSelectableTemplateVariable visibleTags(List visibleTags) { + this.visibleTags = visibleTags; + return this; + } + + public SharedDashboardSelectableTemplateVariable addVisibleTagsItem(String visibleTagsItem) { + this.visibleTags.add(visibleTagsItem); + return this; + } + + /** + * Restricts which tag values are visible to the viewer. + * + * @return visibleTags + */ + @JsonProperty(JSON_PROPERTY_VISIBLE_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getVisibleTags() { + return visibleTags; + } + + public void setVisibleTags(List visibleTags) { + this.visibleTags = visibleTags; + } + + /** + * 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 SharedDashboardSelectableTemplateVariable + */ + @JsonAnySetter + public SharedDashboardSelectableTemplateVariable 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 SharedDashboardSelectableTemplateVariable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardSelectableTemplateVariable sharedDashboardSelectableTemplateVariable = + (SharedDashboardSelectableTemplateVariable) o; + return Objects.equals( + this.allowAnyValue, sharedDashboardSelectableTemplateVariable.allowAnyValue) + && Objects.equals( + this.defaultValues, sharedDashboardSelectableTemplateVariable.defaultValues) + && Objects.equals(this.name, sharedDashboardSelectableTemplateVariable.name) + && Objects.equals(this.prefix, sharedDashboardSelectableTemplateVariable.prefix) + && Objects.equals(this.type, sharedDashboardSelectableTemplateVariable.type) + && Objects.equals(this.visibleTags, sharedDashboardSelectableTemplateVariable.visibleTags) + && Objects.equals( + this.additionalProperties, + sharedDashboardSelectableTemplateVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + allowAnyValue, defaultValues, name, prefix, type, visibleTags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardSelectableTemplateVariable {\n"); + sb.append(" allowAnyValue: ").append(toIndentedString(allowAnyValue)).append("\n"); + sb.append(" defaultValues: ").append(toIndentedString(defaultValues)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" visibleTags: ").append(toIndentedString(visibleTags)).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/SharedDashboardShareType.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardShareType.java new file mode 100644 index 00000000000..0936d5723ef --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardShareType.java @@ -0,0 +1,60 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of dashboard sharing. */ +@JsonSerialize(using = SharedDashboardShareType.SharedDashboardShareTypeSerializer.class) +public class SharedDashboardShareType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("open", "invite", "embed", "secure-embed")); + + public static final SharedDashboardShareType OPEN = new SharedDashboardShareType("open"); + public static final SharedDashboardShareType INVITE = new SharedDashboardShareType("invite"); + public static final SharedDashboardShareType EMBED = new SharedDashboardShareType("embed"); + public static final SharedDashboardShareType SECURE_EMBED = + new SharedDashboardShareType("secure-embed"); + + SharedDashboardShareType(String value) { + super(value, allowedValues); + } + + public static class SharedDashboardShareTypeSerializer + extends StdSerializer { + public SharedDashboardShareTypeSerializer(Class t) { + super(t); + } + + public SharedDashboardShareTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SharedDashboardShareType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SharedDashboardShareType fromValue(String value) { + return new SharedDashboardShareType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardStatus.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardStatus.java new file mode 100644 index 00000000000..6ccf0aa3bb0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardStatus.java @@ -0,0 +1,56 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Status of the shared dashboard. */ +@JsonSerialize(using = SharedDashboardStatus.SharedDashboardStatusSerializer.class) +public class SharedDashboardStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("active", "paused")); + + public static final SharedDashboardStatus ACTIVE = new SharedDashboardStatus("active"); + public static final SharedDashboardStatus PAUSED = new SharedDashboardStatus("paused"); + + SharedDashboardStatus(String value) { + super(value, allowedValues); + } + + public static class SharedDashboardStatusSerializer extends StdSerializer { + public SharedDashboardStatusSerializer(Class t) { + super(t); + } + + public SharedDashboardStatusSerializer() { + this(null); + } + + @Override + public void serialize( + SharedDashboardStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SharedDashboardStatus fromValue(String value) { + return new SharedDashboardStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardType.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardType.java new file mode 100644 index 00000000000..78e0d1ab210 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardType.java @@ -0,0 +1,56 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Shared dashboard resource type. */ +@JsonSerialize(using = SharedDashboardType.SharedDashboardTypeSerializer.class) +public class SharedDashboardType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("shared_dashboard")); + + public static final SharedDashboardType SHARED_DASHBOARD = + new SharedDashboardType("shared_dashboard"); + + SharedDashboardType(String value) { + super(value, allowedValues); + } + + public static class SharedDashboardTypeSerializer extends StdSerializer { + public SharedDashboardTypeSerializer(Class t) { + super(t); + } + + public SharedDashboardTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SharedDashboardType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SharedDashboardType fromValue(String value) { + return new SharedDashboardType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferences.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferences.java new file mode 100644 index 00000000000..f5782dbbdc3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferences.java @@ -0,0 +1,182 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Display settings for the shared dashboard. */ +@JsonPropertyOrder({ + SharedDashboardViewingPreferences.JSON_PROPERTY_HIGH_DENSITY, + SharedDashboardViewingPreferences.JSON_PROPERTY_THEME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SharedDashboardViewingPreferences { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HIGH_DENSITY = "high_density"; + private Boolean highDensity; + + public static final String JSON_PROPERTY_THEME = "theme"; + private SharedDashboardViewingPreferencesTheme theme; + + public SharedDashboardViewingPreferences() {} + + @JsonCreator + public SharedDashboardViewingPreferences( + @JsonProperty(required = true, value = JSON_PROPERTY_HIGH_DENSITY) Boolean highDensity, + @JsonProperty(required = true, value = JSON_PROPERTY_THEME) + SharedDashboardViewingPreferencesTheme theme) { + this.highDensity = highDensity; + this.theme = theme; + this.unparsed |= !theme.isValid(); + } + + public SharedDashboardViewingPreferences highDensity(Boolean highDensity) { + this.highDensity = highDensity; + return this; + } + + /** + * Whether widgets are displayed in high-density mode. + * + * @return highDensity + */ + @JsonProperty(JSON_PROPERTY_HIGH_DENSITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHighDensity() { + return highDensity; + } + + public void setHighDensity(Boolean highDensity) { + this.highDensity = highDensity; + } + + public SharedDashboardViewingPreferences theme(SharedDashboardViewingPreferencesTheme theme) { + this.theme = theme; + this.unparsed |= !theme.isValid(); + return this; + } + + /** + * The theme of the shared dashboard view. system follows the viewer's system + * default. + * + * @return theme + */ + @JsonProperty(JSON_PROPERTY_THEME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SharedDashboardViewingPreferencesTheme getTheme() { + return theme; + } + + public void setTheme(SharedDashboardViewingPreferencesTheme theme) { + if (!theme.isValid()) { + this.unparsed = true; + } + this.theme = theme; + } + + /** + * 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 SharedDashboardViewingPreferences + */ + @JsonAnySetter + public SharedDashboardViewingPreferences 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 SharedDashboardViewingPreferences object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedDashboardViewingPreferences sharedDashboardViewingPreferences = + (SharedDashboardViewingPreferences) o; + return Objects.equals(this.highDensity, sharedDashboardViewingPreferences.highDensity) + && Objects.equals(this.theme, sharedDashboardViewingPreferences.theme) + && Objects.equals( + this.additionalProperties, sharedDashboardViewingPreferences.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(highDensity, theme, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SharedDashboardViewingPreferences {\n"); + sb.append(" highDensity: ").append(toIndentedString(highDensity)).append("\n"); + sb.append(" theme: ").append(toIndentedString(theme)).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/SharedDashboardViewingPreferencesTheme.java b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferencesTheme.java new file mode 100644 index 00000000000..1c9a5441c00 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SharedDashboardViewingPreferencesTheme.java @@ -0,0 +1,69 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The theme of the shared dashboard view. system follows the viewer's system default. + */ +@JsonSerialize( + using = + SharedDashboardViewingPreferencesTheme.SharedDashboardViewingPreferencesThemeSerializer + .class) +public class SharedDashboardViewingPreferencesTheme extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("system", "light", "dark")); + + public static final SharedDashboardViewingPreferencesTheme SYSTEM = + new SharedDashboardViewingPreferencesTheme("system"); + public static final SharedDashboardViewingPreferencesTheme LIGHT = + new SharedDashboardViewingPreferencesTheme("light"); + public static final SharedDashboardViewingPreferencesTheme DARK = + new SharedDashboardViewingPreferencesTheme("dark"); + + SharedDashboardViewingPreferencesTheme(String value) { + super(value, allowedValues); + } + + public static class SharedDashboardViewingPreferencesThemeSerializer + extends StdSerializer { + public SharedDashboardViewingPreferencesThemeSerializer( + Class t) { + super(t); + } + + public SharedDashboardViewingPreferencesThemeSerializer() { + this(null); + } + + @Override + public void serialize( + SharedDashboardViewingPreferencesTheme value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SharedDashboardViewingPreferencesTheme fromValue(String value) { + return new SharedDashboardViewingPreferencesTheme(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/dashboard_sharing.feature b/src/test/resources/com/datadog/api/client/v2/api/dashboard_sharing.feature new file mode 100644 index 00000000000..45257252d39 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/dashboard_sharing.feature @@ -0,0 +1,22 @@ +@endpoint(dashboard-sharing) @endpoint(dashboard-sharing-v2) +Feature: Dashboard Sharing + Manage dashboard sharing configurations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DashboardSharing" API + And operation "ListSharedDashboardsByDashboardId" enabled + And new "ListSharedDashboardsByDashboardId" request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List shared dashboards for a dashboard returns "Dashboard Not Found" response + Given request contains "dashboard_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Dashboard Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List shared dashboards for a dashboard returns "OK" response + Given request contains "dashboard_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 9101d0155cb..0802a2039c9 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2105,6 +2105,12 @@ "type": "safe" } }, + "ListSharedDashboardsByDashboardId": { + "tag": "Dashboard Sharing", + "undo": { + "type": "safe" + } + }, "CreateDashboardSecureEmbed": { "tag": "Dashboard Secure Embed", "undo": {