diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2d470c8f2f..f9eef58dc1 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index fdced5d696..1078229666 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -256,6 +256,13 @@ datadog\_api\_client.v2.api.dashboard\_secure\_embed\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.dashboard\_sharing\_api module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.dashboard_sharing_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.dashboards\_api module -------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index f1ceac9025..0be479a493 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -19716,6 +19716,13 @@ datadog\_api\_client.v2.model.list\_service\_access\_tokens\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_shared\_dashboards\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_shared_dashboards_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_sourcemaps\_response module --------------------------------------------------------------- @@ -37104,6 +37111,146 @@ datadog\_api\_client.v2.model.session\_id\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.shared\_dashboard\_global\_time module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_global_time + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included\_dashboard module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included_dashboard + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included\_dashboard\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included_dashboard_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included\_dashboard\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included_dashboard_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included\_user module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_included\_user\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_included_user_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_invitee module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_invitee + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_relationship\_dashboard module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_relationship_dashboard + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_relationship\_dashboard\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_relationship_dashboard_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_relationship\_sharer module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_relationship_sharer + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_relationships module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_response\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_selectable\_template\_variable module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_selectable_template_variable + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_share\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_share_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_status module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_viewing\_preferences module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_viewing_preferences + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.shared\_dashboard\_viewing\_preferences\_theme module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.shared_dashboard_viewing_preferences_theme + :members: + :show-inheritance: + datadog\_api\_client.v2.model.shift module ------------------------------------------ diff --git a/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.py b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.py new file mode 100644 index 0000000000..0f4cbf78b7 --- /dev/null +++ b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.py @@ -0,0 +1,16 @@ +""" +List shared dashboards for a dashboard returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dashboard_sharing_api import DashboardSharingApi + +configuration = Configuration() +configuration.unstable_operations["list_shared_dashboards_by_dashboard_id"] = True +with ApiClient(configuration) as api_client: + api_instance = DashboardSharingApi(api_client) + response = api_instance.list_shared_dashboards_by_dashboard_id( + dashboard_id="abc-def-ghi", + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 62cd8f6abf..7217977d54 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -464,6 +464,7 @@ def __init__( "v2.list_cost_tag_metadata_months": False, "v2.list_cost_tag_metadata_orchestrators": False, "v2.search_cost_recommendations": False, + "v2.list_shared_dashboards_by_dashboard_id": False, "v2.create_dashboard_secure_embed": False, "v2.delete_dashboard_secure_embed": False, "v2.get_dashboard_secure_embed": False, diff --git a/src/datadog_api_client/v2/api/dashboard_sharing_api.py b/src/datadog_api_client/v2/api/dashboard_sharing_api.py new file mode 100644 index 0000000000..6422613af2 --- /dev/null +++ b/src/datadog_api_client/v2/api/dashboard_sharing_api.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.list_shared_dashboards_response import ListSharedDashboardsResponse + + +class DashboardSharingApi: + """ + Manage dashboard sharing configurations. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._list_shared_dashboards_by_dashboard_id_endpoint = _Endpoint( + settings={ + "response_type": (ListSharedDashboardsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/dashboard/{dashboard_id}/shared", + "operation_id": "list_shared_dashboards_by_dashboard_id", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "dashboard_id": { + "required": True, + "openapi_types": (str,), + "attribute": "dashboard_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + def list_shared_dashboards_by_dashboard_id( + self, + dashboard_id: str, + ) -> ListSharedDashboardsResponse: + """List shared dashboards for a dashboard. + + Retrieve shared dashboards associated with the specified dashboard. + + :param dashboard_id: ID of the dashboard. + :type dashboard_id: str + :rtype: ListSharedDashboardsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["dashboard_id"] = dashboard_id + + return self._list_shared_dashboards_by_dashboard_id_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 299d30f49a..6025977b29 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -35,6 +35,7 @@ from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi from datadog_api_client.v2.api.dashboard_secure_embed_api import DashboardSecureEmbedApi +from datadog_api_client.v2.api.dashboard_sharing_api import DashboardSharingApi from datadog_api_client.v2.api.dashboards_api import DashboardsApi from datadog_api_client.v2.api.data_deletion_api import DataDeletionApi from datadog_api_client.v2.api.datasets_api import DatasetsApi @@ -162,6 +163,7 @@ "DORAMetricsApi", "DashboardListsApi", "DashboardSecureEmbedApi", + "DashboardSharingApi", "DashboardsApi", "DataDeletionApi", "DatasetsApi", diff --git a/src/datadog_api_client/v2/model/list_shared_dashboards_response.py b/src/datadog_api_client/v2/model/list_shared_dashboards_response.py new file mode 100644 index 0000000000..c2c367d38e --- /dev/null +++ b/src/datadog_api_client/v2/model/list_shared_dashboards_response.py @@ -0,0 +1,55 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_response import SharedDashboardResponse + from datadog_api_client.v2.model.shared_dashboard_included import SharedDashboardIncluded + from datadog_api_client.v2.model.shared_dashboard_included_dashboard import SharedDashboardIncludedDashboard + from datadog_api_client.v2.model.shared_dashboard_included_user import SharedDashboardIncludedUser + + +class ListSharedDashboardsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_response import SharedDashboardResponse + from datadog_api_client.v2.model.shared_dashboard_included import SharedDashboardIncluded + + return { + "data": ([SharedDashboardResponse],), + "included": ([SharedDashboardIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[SharedDashboardResponse], + included: List[Union[SharedDashboardIncluded, SharedDashboardIncludedDashboard, SharedDashboardIncludedUser]], + **kwargs, + ): + """ + Response containing shared dashboards for a dashboard. + + :param data: Shared dashboards for the dashboard. + :type data: [SharedDashboardResponse] + + :param included: Users and dashboards related to the shared dashboards. + :type included: [SharedDashboardIncluded] + """ + super().__init__(kwargs) + + self_.data = data + self_.included = included diff --git a/src/datadog_api_client/v2/model/shared_dashboard_global_time.py b/src/datadog_api_client/v2/model/shared_dashboard_global_time.py new file mode 100644 index 0000000000..a93366f8cb --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_global_time.py @@ -0,0 +1,19 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class SharedDashboardGlobalTime(ModelNormal): + _nullable = True + + def __init__(self_, **kwargs): + """ + Default time range configuration for the shared dashboard. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included.py b/src/datadog_api_client/v2/model/shared_dashboard_included.py new file mode 100644 index 0000000000..1dda4f1a70 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included.py @@ -0,0 +1,46 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class SharedDashboardIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + Resource included with a shared dashboard. + + :param attributes: Attributes of the included dashboard. + :type attributes: SharedDashboardIncludedDashboardAttributes + + :param id: ID of the dashboard. + :type id: str + + :param type: Included dashboard resource type. + :type type: SharedDashboardIncludedDashboardType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.shared_dashboard_included_dashboard import SharedDashboardIncludedDashboard + from datadog_api_client.v2.model.shared_dashboard_included_user import SharedDashboardIncludedUser + + return { + "oneOf": [ + SharedDashboardIncludedDashboard, + SharedDashboardIncludedUser, + ], + } diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard.py b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard.py new file mode 100644 index 0000000000..f5ee6658ba --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard.py @@ -0,0 +1,68 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_attributes import ( + SharedDashboardIncludedDashboardAttributes, + ) + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_type import ( + SharedDashboardIncludedDashboardType, + ) + + +class SharedDashboardIncludedDashboard(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_attributes import ( + SharedDashboardIncludedDashboardAttributes, + ) + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_type import ( + SharedDashboardIncludedDashboardType, + ) + + return { + "attributes": (SharedDashboardIncludedDashboardAttributes,), + "id": (str,), + "type": (SharedDashboardIncludedDashboardType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: SharedDashboardIncludedDashboardAttributes, + id: str, + type: SharedDashboardIncludedDashboardType, + **kwargs, + ): + """ + Included dashboard resource. + + :param attributes: Attributes of the included dashboard. + :type attributes: SharedDashboardIncludedDashboardAttributes + + :param id: ID of the dashboard. + :type id: str + + :param type: Included dashboard resource type. + :type type: SharedDashboardIncludedDashboardType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_attributes.py b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_attributes.py new file mode 100644 index 0000000000..a0bf39ce72 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_attributes.py @@ -0,0 +1,33 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SharedDashboardIncludedDashboardAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "title": (str,), + } + + attribute_map = { + "title": "title", + } + + def __init__(self_, title: str, **kwargs): + """ + Attributes of the included dashboard. + + :param title: Dashboard title. + :type title: str + """ + super().__init__(kwargs) + + self_.title = title diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_type.py b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_type.py new file mode 100644 index 0000000000..54be875f05 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included_dashboard_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SharedDashboardIncludedDashboardType(ModelSimple): + """ + Included dashboard resource type. + + :param value: If omitted defaults to "dashboard". Must be one of ["dashboard"]. + :type value: str + """ + + allowed_values = { + "dashboard", + } + DASHBOARD: ClassVar["SharedDashboardIncludedDashboardType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SharedDashboardIncludedDashboardType.DASHBOARD = SharedDashboardIncludedDashboardType("dashboard") diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included_user.py b/src/datadog_api_client/v2/model/shared_dashboard_included_user.py new file mode 100644 index 0000000000..b6bc5d8f53 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included_user.py @@ -0,0 +1,58 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_included_user_attributes import ( + SharedDashboardIncludedUserAttributes, + ) + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + +class SharedDashboardIncludedUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_included_user_attributes import ( + SharedDashboardIncludedUserAttributes, + ) + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + return { + "attributes": (SharedDashboardIncludedUserAttributes,), + "id": (str,), + "type": (UserResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: SharedDashboardIncludedUserAttributes, id: str, type: UserResourceType, **kwargs): + """ + Included user resource. + + :param attributes: Attributes of the included user. + :type attributes: SharedDashboardIncludedUserAttributes + + :param id: ID of the user. + :type id: str + + :param type: User resource type. + :type type: UserResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/shared_dashboard_included_user_attributes.py b/src/datadog_api_client/v2/model/shared_dashboard_included_user_attributes.py new file mode 100644 index 0000000000..2edeb038d3 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_included_user_attributes.py @@ -0,0 +1,39 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SharedDashboardIncludedUserAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "handle": (str,), + "name": (str,), + } + + attribute_map = { + "handle": "handle", + "name": "name", + } + + def __init__(self_, handle: str, name: str, **kwargs): + """ + Attributes of the included user. + + :param handle: User handle. + :type handle: str + + :param name: User display name. + :type name: str + """ + super().__init__(kwargs) + + self_.handle = handle + self_.name = name diff --git a/src/datadog_api_client/v2/model/shared_dashboard_invitee.py b/src/datadog_api_client/v2/model/shared_dashboard_invitee.py new file mode 100644 index 0000000000..b6cfdf1c07 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_invitee.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, +) + + +class SharedDashboardInvitee(ModelNormal): + @cached_property + def openapi_types(_): + return { + "access_expiration": (datetime, none_type), + "created_at": (datetime,), + "email": (str,), + } + + attribute_map = { + "access_expiration": "access_expiration", + "created_at": "created_at", + "email": "email", + } + + def __init__(self_, access_expiration: Union[datetime, none_type], created_at: datetime, email: str, **kwargs): + """ + Invitee that can access an invite-only shared dashboard. + + :param access_expiration: Time when the invitee's access expires. + :type access_expiration: datetime, none_type + + :param created_at: Time when the invitee was added. + :type created_at: datetime + + :param email: Email address of the invitee. + :type email: str + """ + super().__init__(kwargs) + + self_.access_expiration = access_expiration + self_.created_at = created_at + self_.email = email diff --git a/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard.py b/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard.py new file mode 100644 index 0000000000..1329048a7b --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard_data import ( + SharedDashboardRelationshipDashboardData, + ) + + +class SharedDashboardRelationshipDashboard(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard_data import ( + SharedDashboardRelationshipDashboardData, + ) + + return { + "data": (SharedDashboardRelationshipDashboardData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SharedDashboardRelationshipDashboardData, **kwargs): + """ + Dashboard associated with the shared dashboard. + + :param data: Dashboard relationship data. + :type data: SharedDashboardRelationshipDashboardData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard_data.py b/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard_data.py new file mode 100644 index 0000000000..302078ca5b --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_relationship_dashboard_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_type import ( + SharedDashboardIncludedDashboardType, + ) + + +class SharedDashboardRelationshipDashboardData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_included_dashboard_type import ( + SharedDashboardIncludedDashboardType, + ) + + return { + "id": (str,), + "type": (SharedDashboardIncludedDashboardType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: SharedDashboardIncludedDashboardType, **kwargs): + """ + Dashboard relationship data. + + :param id: ID of the dashboard. + :type id: str + + :param type: Included dashboard resource type. + :type type: SharedDashboardIncludedDashboardType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/shared_dashboard_relationship_sharer.py b/src/datadog_api_client/v2/model/shared_dashboard_relationship_sharer.py new file mode 100644 index 0000000000..c37174855b --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_relationship_sharer.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData + + +class SharedDashboardRelationshipSharer(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData + + return { + "data": (UserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UserRelationshipData, **kwargs): + """ + User who shared the dashboard. + + :param data: Relationship to user object. + :type data: UserRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/shared_dashboard_relationships.py b/src/datadog_api_client/v2/model/shared_dashboard_relationships.py new file mode 100644 index 0000000000..c88e78cefe --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_relationships.py @@ -0,0 +1,52 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard import SharedDashboardRelationshipDashboard + from datadog_api_client.v2.model.shared_dashboard_relationship_sharer import SharedDashboardRelationshipSharer + + +class SharedDashboardRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard import ( + SharedDashboardRelationshipDashboard, + ) + from datadog_api_client.v2.model.shared_dashboard_relationship_sharer import SharedDashboardRelationshipSharer + + return { + "dashboard": (SharedDashboardRelationshipDashboard,), + "sharer": (SharedDashboardRelationshipSharer,), + } + + attribute_map = { + "dashboard": "dashboard", + "sharer": "sharer", + } + + def __init__( + self_, dashboard: SharedDashboardRelationshipDashboard, sharer: SharedDashboardRelationshipSharer, **kwargs + ): + """ + Relationships of a shared dashboard. + + :param dashboard: Dashboard associated with the shared dashboard. + :type dashboard: SharedDashboardRelationshipDashboard + + :param sharer: User who shared the dashboard. + :type sharer: SharedDashboardRelationshipSharer + """ + super().__init__(kwargs) + + self_.dashboard = dashboard + self_.sharer = sharer diff --git a/src/datadog_api_client/v2/model/shared_dashboard_response.py b/src/datadog_api_client/v2/model/shared_dashboard_response.py new file mode 100644 index 0000000000..8e0425d5e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_response.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_response_attributes import SharedDashboardResponseAttributes + from datadog_api_client.v2.model.shared_dashboard_relationships import SharedDashboardRelationships + from datadog_api_client.v2.model.shared_dashboard_type import SharedDashboardType + + +class SharedDashboardResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_response_attributes import SharedDashboardResponseAttributes + from datadog_api_client.v2.model.shared_dashboard_relationships import SharedDashboardRelationships + from datadog_api_client.v2.model.shared_dashboard_type import SharedDashboardType + + return { + "attributes": (SharedDashboardResponseAttributes,), + "id": (str,), + "relationships": (SharedDashboardRelationships,), + "type": (SharedDashboardType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: SharedDashboardResponseAttributes, + id: str, + relationships: SharedDashboardRelationships, + type: SharedDashboardType, + **kwargs, + ): + """ + A shared dashboard response resource. + + :param attributes: Attributes of a shared dashboard response. + :type attributes: SharedDashboardResponseAttributes + + :param id: ID of the shared dashboard. + :type id: str + + :param relationships: Relationships of a shared dashboard. + :type relationships: SharedDashboardRelationships + + :param type: Shared dashboard resource type. + :type type: SharedDashboardType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/shared_dashboard_response_attributes.py b/src/datadog_api_client/v2/model/shared_dashboard_response_attributes.py new file mode 100644 index 0000000000..b9d77251de --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_response_attributes.py @@ -0,0 +1,158 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_global_time import SharedDashboardGlobalTime + from datadog_api_client.v2.model.shared_dashboard_invitee import SharedDashboardInvitee + from datadog_api_client.v2.model.shared_dashboard_selectable_template_variable import ( + SharedDashboardSelectableTemplateVariable, + ) + from datadog_api_client.v2.model.shared_dashboard_share_type import SharedDashboardShareType + from datadog_api_client.v2.model.shared_dashboard_status import SharedDashboardStatus + from datadog_api_client.v2.model.shared_dashboard_viewing_preferences import SharedDashboardViewingPreferences + + +class SharedDashboardResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_global_time import SharedDashboardGlobalTime + from datadog_api_client.v2.model.shared_dashboard_invitee import SharedDashboardInvitee + from datadog_api_client.v2.model.shared_dashboard_selectable_template_variable import ( + SharedDashboardSelectableTemplateVariable, + ) + from datadog_api_client.v2.model.shared_dashboard_share_type import SharedDashboardShareType + from datadog_api_client.v2.model.shared_dashboard_status import SharedDashboardStatus + from datadog_api_client.v2.model.shared_dashboard_viewing_preferences import SharedDashboardViewingPreferences + + return { + "created_at": (datetime,), + "embeddable_domains": ([str],), + "expiration": (datetime, none_type), + "global_time": (SharedDashboardGlobalTime,), + "global_time_selectable": (bool,), + "invitees": ([SharedDashboardInvitee],), + "last_accessed": (datetime, none_type), + "selectable_template_vars": ([SharedDashboardSelectableTemplateVariable],), + "share_type": (SharedDashboardShareType,), + "sharer_disabled": (bool,), + "status": (SharedDashboardStatus,), + "title": (str,), + "token": (str,), + "url": (str,), + "viewing_preferences": (SharedDashboardViewingPreferences,), + } + + attribute_map = { + "created_at": "created_at", + "embeddable_domains": "embeddable_domains", + "expiration": "expiration", + "global_time": "global_time", + "global_time_selectable": "global_time_selectable", + "invitees": "invitees", + "last_accessed": "last_accessed", + "selectable_template_vars": "selectable_template_vars", + "share_type": "share_type", + "sharer_disabled": "sharer_disabled", + "status": "status", + "title": "title", + "token": "token", + "url": "url", + "viewing_preferences": "viewing_preferences", + } + + def __init__( + self_, + created_at: datetime, + embeddable_domains: List[str], + expiration: Union[datetime, none_type], + global_time: Union[SharedDashboardGlobalTime, none_type], + global_time_selectable: bool, + invitees: List[SharedDashboardInvitee], + last_accessed: Union[datetime, none_type], + selectable_template_vars: List[SharedDashboardSelectableTemplateVariable], + share_type: SharedDashboardShareType, + sharer_disabled: bool, + status: SharedDashboardStatus, + title: str, + token: str, + url: str, + viewing_preferences: SharedDashboardViewingPreferences, + **kwargs, + ): + """ + Attributes of a shared dashboard response. + + :param created_at: Time when the shared dashboard was created. + :type created_at: datetime + + :param embeddable_domains: Domains where embed-type shared dashboards can be embedded. + :type embeddable_domains: [str] + + :param expiration: Time when the shared dashboard expires. + :type expiration: datetime, none_type + + :param global_time: Default time range configuration for the shared dashboard. + :type global_time: SharedDashboardGlobalTime, none_type + + :param global_time_selectable: Whether viewers can select a different global time setting. + :type global_time_selectable: bool + + :param invitees: Invitees for invite-only shared dashboards. + :type invitees: [SharedDashboardInvitee] + + :param last_accessed: Time when the shared dashboard was last accessed. + :type last_accessed: datetime, none_type + + :param selectable_template_vars: Template variables that viewers can modify. + :type selectable_template_vars: [SharedDashboardSelectableTemplateVariable] + + :param share_type: Type of dashboard sharing. + :type share_type: SharedDashboardShareType + + :param sharer_disabled: Whether the user who shared the dashboard is disabled. + :type sharer_disabled: bool + + :param status: Status of the shared dashboard. + :type status: SharedDashboardStatus + + :param title: Display title for the shared dashboard. + :type title: str + + :param token: Token assigned to the shared dashboard. + :type token: str + + :param url: URL for the shared dashboard. + :type url: str + + :param viewing_preferences: Display settings for the shared dashboard. + :type viewing_preferences: SharedDashboardViewingPreferences + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.embeddable_domains = embeddable_domains + self_.expiration = expiration + self_.global_time = global_time + self_.global_time_selectable = global_time_selectable + self_.invitees = invitees + self_.last_accessed = last_accessed + self_.selectable_template_vars = selectable_template_vars + self_.share_type = share_type + self_.sharer_disabled = sharer_disabled + self_.status = status + self_.title = title + self_.token = token + self_.url = url + self_.viewing_preferences = viewing_preferences diff --git a/src/datadog_api_client/v2/model/shared_dashboard_selectable_template_variable.py b/src/datadog_api_client/v2/model/shared_dashboard_selectable_template_variable.py new file mode 100644 index 0000000000..f1bea263b8 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_selectable_template_variable.py @@ -0,0 +1,73 @@ +# 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. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SharedDashboardSelectableTemplateVariable(ModelNormal): + @cached_property + def openapi_types(_): + return { + "allow_any_value": (bool,), + "default_values": ([str],), + "name": (str,), + "prefix": (str,), + "type": (str,), + "visible_tags": ([str],), + } + + attribute_map = { + "allow_any_value": "allow_any_value", + "default_values": "default_values", + "name": "name", + "prefix": "prefix", + "type": "type", + "visible_tags": "visible_tags", + } + + def __init__( + self_, + allow_any_value: bool, + default_values: List[str], + name: str, + prefix: str, + type: str, + visible_tags: List[str], + **kwargs, + ): + """ + A template variable that viewers can modify on the shared dashboard. + + :param allow_any_value: Whether viewers can see all tag values for the template variable and specify any value. + :type allow_any_value: bool + + :param default_values: Default selected values for the variable. + :type default_values: [str] + + :param name: Name of the template variable. + :type name: str + + :param prefix: Tag prefix for the variable. + :type prefix: str + + :param type: Type of the template variable. + :type type: str + + :param visible_tags: Restricts which tag values are visible to the viewer. + :type visible_tags: [str] + """ + super().__init__(kwargs) + + self_.allow_any_value = allow_any_value + self_.default_values = default_values + self_.name = name + self_.prefix = prefix + self_.type = type + self_.visible_tags = visible_tags diff --git a/src/datadog_api_client/v2/model/shared_dashboard_share_type.py b/src/datadog_api_client/v2/model/shared_dashboard_share_type.py new file mode 100644 index 0000000000..21b2f05ae0 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_share_type.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SharedDashboardShareType(ModelSimple): + """ + Type of dashboard sharing. + + :param value: Must be one of ["open", "invite", "embed", "secure-embed"]. + :type value: str + """ + + allowed_values = { + "open", + "invite", + "embed", + "secure-embed", + } + OPEN: ClassVar["SharedDashboardShareType"] + INVITE: ClassVar["SharedDashboardShareType"] + EMBED: ClassVar["SharedDashboardShareType"] + SECURE_EMBED: ClassVar["SharedDashboardShareType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SharedDashboardShareType.OPEN = SharedDashboardShareType("open") +SharedDashboardShareType.INVITE = SharedDashboardShareType("invite") +SharedDashboardShareType.EMBED = SharedDashboardShareType("embed") +SharedDashboardShareType.SECURE_EMBED = SharedDashboardShareType("secure-embed") diff --git a/src/datadog_api_client/v2/model/shared_dashboard_status.py b/src/datadog_api_client/v2/model/shared_dashboard_status.py new file mode 100644 index 0000000000..b19b731916 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_status.py @@ -0,0 +1,38 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SharedDashboardStatus(ModelSimple): + """ + Status of the shared dashboard. + + :param value: Must be one of ["active", "paused"]. + :type value: str + """ + + allowed_values = { + "active", + "paused", + } + ACTIVE: ClassVar["SharedDashboardStatus"] + PAUSED: ClassVar["SharedDashboardStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SharedDashboardStatus.ACTIVE = SharedDashboardStatus("active") +SharedDashboardStatus.PAUSED = SharedDashboardStatus("paused") diff --git a/src/datadog_api_client/v2/model/shared_dashboard_type.py b/src/datadog_api_client/v2/model/shared_dashboard_type.py new file mode 100644 index 0000000000..87a40f43fc --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SharedDashboardType(ModelSimple): + """ + Shared dashboard resource type. + + :param value: If omitted defaults to "shared_dashboard". Must be one of ["shared_dashboard"]. + :type value: str + """ + + allowed_values = { + "shared_dashboard", + } + SHARED_DASHBOARD: ClassVar["SharedDashboardType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SharedDashboardType.SHARED_DASHBOARD = SharedDashboardType("shared_dashboard") diff --git a/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences.py b/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences.py new file mode 100644 index 0000000000..c01133e7ac --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.shared_dashboard_viewing_preferences_theme import ( + SharedDashboardViewingPreferencesTheme, + ) + + +class SharedDashboardViewingPreferences(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.shared_dashboard_viewing_preferences_theme import ( + SharedDashboardViewingPreferencesTheme, + ) + + return { + "high_density": (bool,), + "theme": (SharedDashboardViewingPreferencesTheme,), + } + + attribute_map = { + "high_density": "high_density", + "theme": "theme", + } + + def __init__(self_, high_density: bool, theme: SharedDashboardViewingPreferencesTheme, **kwargs): + """ + Display settings for the shared dashboard. + + :param high_density: Whether widgets are displayed in high-density mode. + :type high_density: bool + + :param theme: The theme of the shared dashboard view. ``system`` follows the viewer's system default. + :type theme: SharedDashboardViewingPreferencesTheme + """ + super().__init__(kwargs) + + self_.high_density = high_density + self_.theme = theme diff --git a/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences_theme.py b/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences_theme.py new file mode 100644 index 0000000000..8ff781bc22 --- /dev/null +++ b/src/datadog_api_client/v2/model/shared_dashboard_viewing_preferences_theme.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SharedDashboardViewingPreferencesTheme(ModelSimple): + """ + The theme of the shared dashboard view. `system` follows the viewer's system default. + + :param value: Must be one of ["system", "light", "dark"]. + :type value: str + """ + + allowed_values = { + "system", + "light", + "dark", + } + SYSTEM: ClassVar["SharedDashboardViewingPreferencesTheme"] + LIGHT: ClassVar["SharedDashboardViewingPreferencesTheme"] + DARK: ClassVar["SharedDashboardViewingPreferencesTheme"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SharedDashboardViewingPreferencesTheme.SYSTEM = SharedDashboardViewingPreferencesTheme("system") +SharedDashboardViewingPreferencesTheme.LIGHT = SharedDashboardViewingPreferencesTheme("light") +SharedDashboardViewingPreferencesTheme.DARK = SharedDashboardViewingPreferencesTheme("dark") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 817d63c3f9..6f8e6782aa 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4088,6 +4088,7 @@ from datadog_api_client.v2.model.list_scorecards_response import ListScorecardsResponse from datadog_api_client.v2.model.list_security_findings_response import ListSecurityFindingsResponse from datadog_api_client.v2.model.list_service_access_tokens_response import ListServiceAccessTokensResponse +from datadog_api_client.v2.model.list_shared_dashboards_response import ListSharedDashboardsResponse from datadog_api_client.v2.model.list_sourcemaps_response import ListSourcemapsResponse from datadog_api_client.v2.model.list_tags_response import ListTagsResponse from datadog_api_client.v2.model.list_tags_response_data import ListTagsResponseData @@ -7547,6 +7548,34 @@ from datadog_api_client.v2.model.service_repository_info_status import ServiceRepositoryInfoStatus from datadog_api_client.v2.model.session_id_array import SessionIdArray from datadog_api_client.v2.model.session_id_data import SessionIdData +from datadog_api_client.v2.model.shared_dashboard_global_time import SharedDashboardGlobalTime +from datadog_api_client.v2.model.shared_dashboard_included import SharedDashboardIncluded +from datadog_api_client.v2.model.shared_dashboard_included_dashboard import SharedDashboardIncludedDashboard +from datadog_api_client.v2.model.shared_dashboard_included_dashboard_attributes import ( + SharedDashboardIncludedDashboardAttributes, +) +from datadog_api_client.v2.model.shared_dashboard_included_dashboard_type import SharedDashboardIncludedDashboardType +from datadog_api_client.v2.model.shared_dashboard_included_user import SharedDashboardIncludedUser +from datadog_api_client.v2.model.shared_dashboard_included_user_attributes import SharedDashboardIncludedUserAttributes +from datadog_api_client.v2.model.shared_dashboard_invitee import SharedDashboardInvitee +from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard import SharedDashboardRelationshipDashboard +from datadog_api_client.v2.model.shared_dashboard_relationship_dashboard_data import ( + SharedDashboardRelationshipDashboardData, +) +from datadog_api_client.v2.model.shared_dashboard_relationship_sharer import SharedDashboardRelationshipSharer +from datadog_api_client.v2.model.shared_dashboard_relationships import SharedDashboardRelationships +from datadog_api_client.v2.model.shared_dashboard_response import SharedDashboardResponse +from datadog_api_client.v2.model.shared_dashboard_response_attributes import SharedDashboardResponseAttributes +from datadog_api_client.v2.model.shared_dashboard_selectable_template_variable import ( + SharedDashboardSelectableTemplateVariable, +) +from datadog_api_client.v2.model.shared_dashboard_share_type import SharedDashboardShareType +from datadog_api_client.v2.model.shared_dashboard_status import SharedDashboardStatus +from datadog_api_client.v2.model.shared_dashboard_type import SharedDashboardType +from datadog_api_client.v2.model.shared_dashboard_viewing_preferences import SharedDashboardViewingPreferences +from datadog_api_client.v2.model.shared_dashboard_viewing_preferences_theme import ( + SharedDashboardViewingPreferencesTheme, +) from datadog_api_client.v2.model.shift import Shift from datadog_api_client.v2.model.shift_data import ShiftData from datadog_api_client.v2.model.shift_data_attributes import ShiftDataAttributes @@ -12062,6 +12091,7 @@ "ListScorecardsResponse", "ListSecurityFindingsResponse", "ListServiceAccessTokensResponse", + "ListSharedDashboardsResponse", "ListSourcemapsResponse", "ListTagsResponse", "ListTagsResponseData", @@ -14263,6 +14293,26 @@ "ServiceRepositoryInfoStatus", "SessionIdArray", "SessionIdData", + "SharedDashboardGlobalTime", + "SharedDashboardIncluded", + "SharedDashboardIncludedDashboard", + "SharedDashboardIncludedDashboardAttributes", + "SharedDashboardIncludedDashboardType", + "SharedDashboardIncludedUser", + "SharedDashboardIncludedUserAttributes", + "SharedDashboardInvitee", + "SharedDashboardRelationshipDashboard", + "SharedDashboardRelationshipDashboardData", + "SharedDashboardRelationshipSharer", + "SharedDashboardRelationships", + "SharedDashboardResponse", + "SharedDashboardResponseAttributes", + "SharedDashboardSelectableTemplateVariable", + "SharedDashboardShareType", + "SharedDashboardStatus", + "SharedDashboardType", + "SharedDashboardViewingPreferences", + "SharedDashboardViewingPreferencesTheme", "Shift", "ShiftData", "ShiftDataAttributes", diff --git a/tests/v2/features/dashboard_sharing.feature b/tests/v2/features/dashboard_sharing.feature new file mode 100644 index 0000000000..45257252d3 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 9101d0155c..0802a2039c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2105,6 +2105,12 @@ "type": "safe" } }, + "ListSharedDashboardsByDashboardId": { + "tag": "Dashboard Sharing", + "undo": { + "type": "safe" + } + }, "CreateDashboardSecureEmbed": { "tag": "Dashboard Secure Embed", "undo": {