Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 107 additions & 8 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1780,14 +1780,11 @@ components:
- INVITE
- EMBED
DashboardSummary:
description: Dashboard summary response.
properties:
dashboards:
description: List of dashboard definitions.
items:
$ref: "#/components/schemas/DashboardSummaryDefinition"
type: array
type: object
description: Dashboard summary response with API-versioned representations.
oneOf:
- $ref: "#/components/schemas/DashboardSummary_V1"
- $ref: "#/components/schemas/DashboardSummary_20270101"
x-datadog-api-versioned: true
DashboardSummaryDefinition:
description: Dashboard definition.
properties:
Expand Down Expand Up @@ -1825,6 +1822,108 @@ components:
description: URL of the dashboard.
type: string
type: object
DashboardSummaryDefinition_20270101:
description: Dashboard definition.
properties:
author:
$ref: "#/components/schemas/Creator"
created:
description: Date of creation of the dashboard.
format: date-time
nullable: true
readOnly: true
type: string
icon:
description: URL to the icon of the dashboard.
nullable: true
readOnly: true
type: string
id:
$ref: "#/components/schemas/DashboardSummaryID_20270101"
integration_id:
description: The short name of the integration.
nullable: true
readOnly: true
type: string
is_favorite:
description: Whether the dashboard is in the favorites.
readOnly: true
type: boolean
is_read_only:
description: Whether the dashboard is read only.
readOnly: true
type: boolean
is_shared:
description: Whether the dashboard is publicly shared.
readOnly: true
type: boolean
last_view_date:
description: Date when the dashboard was last viewed.
nullable: true
readOnly: true
type: string
modified:
description: Date of last edition of the dashboard.
format: date-time
nullable: true
readOnly: true
type: string
popularity:
description: Popularity of the dashboard.
format: int32
maximum: 5
readOnly: true
type: integer
tags:
description: List of team names representing ownership of the dashboard.
items:
description: The name of a Datadog team, formatted as `team:<name>`.
type: string
nullable: true
readOnly: true
type: array
title:
description: Title of the dashboard.
readOnly: true
type: string
type:
description: The type of the dashboard.
readOnly: true
type: string
url:
description: URL path to the dashboard.
readOnly: true
type: string
type: object
DashboardSummaryID_20270101:
description: ID of the dashboard.
oneOf:
- type: string
- format: int64
type: integer
DashboardSummary_20270101:
description: Dashboard summary response.
properties:
dashboards:
description: List of dashboard definitions.
items:
$ref: "#/components/schemas/DashboardSummaryDefinition_20270101"
type: array
total:
description: Number of dashboards.
format: int64
readOnly: true
type: integer
type: object
DashboardSummary_V1:
description: Dashboard summary response.
properties:
dashboards:
description: List of dashboard definitions.
items:
$ref: "#/components/schemas/DashboardSummaryDefinition"
type: array
type: object
DashboardTab:
description: Dashboard tab for organizing widgets.
properties:
Expand Down
5 changes: 2 additions & 3 deletions src/datadog_api_client/v1/api/dashboards_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
)
from datadog_api_client.v1.model.dashboard_bulk_delete_request import DashboardBulkDeleteRequest
from datadog_api_client.v1.model.dashboard_summary import DashboardSummary
from datadog_api_client.v1.model.dashboard_summary_definition import DashboardSummaryDefinition
from datadog_api_client.v1.model.dashboard_restore_request import DashboardRestoreRequest
from datadog_api_client.v1.model.dashboard import Dashboard
from datadog_api_client.v1.model.shared_dashboard import SharedDashboard
Expand Down Expand Up @@ -603,7 +602,7 @@ def list_dashboards_with_pagination(
filter_deleted: Union[bool, UnsetType] = unset,
count: Union[int, UnsetType] = unset,
start: Union[int, UnsetType] = unset,
) -> collections.abc.Iterable[DashboardSummaryDefinition]:
) -> collections.abc.Iterable[None]:
"""Get all dashboards.

Provide a paginated version of :meth:`list_dashboards`, returning all items.
Expand All @@ -620,7 +619,7 @@ def list_dashboards_with_pagination(
:type start: int, optional

:return: A generator of paginated results.
:rtype: collections.abc.Iterable[DashboardSummaryDefinition]
:rtype: collections.abc.Iterable[None]
"""
kwargs: Dict[str, Any] = {}
if filter_shared is not unset:
Expand Down
51 changes: 26 additions & 25 deletions src/datadog_api_client/v1/model/dashboard_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,41 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
ModelComposed,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v1.model.dashboard_summary_definition import DashboardSummaryDefinition


class DashboardSummary(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.dashboard_summary_definition import DashboardSummaryDefinition

return {
"dashboards": ([DashboardSummaryDefinition],),
}

attribute_map = {
"dashboards": "dashboards",
}

def __init__(self_, dashboards: Union[List[DashboardSummaryDefinition], UnsetType] = unset, **kwargs):
class DashboardSummary(ModelComposed):
def __init__(self, **kwargs):
"""
Dashboard summary response.
Dashboard summary response with API-versioned representations.

:param dashboards: List of dashboard definitions.
:type dashboards: [DashboardSummaryDefinition], optional

:param total: Number of dashboards.
:type total: int, optional
"""
if dashboards is not unset:
kwargs["dashboards"] = dashboards
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.v1.model.dashboard_summary_v1 import DashboardSummary_V1
from datadog_api_client.v1.model.dashboard_summary_20270101 import DashboardSummary_20270101

return {
"oneOf": [
DashboardSummary_V1,
DashboardSummary_20270101,
],
}
59 changes: 59 additions & 0 deletions src/datadog_api_client/v1/model/dashboard_summary_20270101.py
Original file line number Diff line number Diff line change
@@ -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.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v1.model.dashboard_summary_definition_20270101 import DashboardSummaryDefinition_20270101


class DashboardSummary_20270101(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.dashboard_summary_definition_20270101 import (
DashboardSummaryDefinition_20270101,
)

return {
"dashboards": ([DashboardSummaryDefinition_20270101],),
"total": (int,),
}

attribute_map = {
"dashboards": "dashboards",
"total": "total",
}
read_only_vars = {
"total",
}

def __init__(
self_,
dashboards: Union[List[DashboardSummaryDefinition_20270101], UnsetType] = unset,
total: Union[int, UnsetType] = unset,
**kwargs,
):
"""
Dashboard summary response.

:param dashboards: List of dashboard definitions.
:type dashboards: [DashboardSummaryDefinition_20270101], optional

:param total: Number of dashboards.
:type total: int, optional
"""
if dashboards is not unset:
kwargs["dashboards"] = dashboards
if total is not unset:
kwargs["total"] = total
super().__init__(kwargs)
Loading
Loading