From 7ea6f916ae07bd31ae2562299a68897973e347f5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 28 Aug 2026 13:31:57 +0000 Subject: [PATCH] Regenerate client from commit 1df4332 of spec repo --- .generator/schemas/v1/openapi.yaml | 115 ++++++++++- src/datadog_api_client/api_client.py | 7 +- .../v1/api/dashboards_api.py | 2 +- .../v1_20270101/__init__.py | 27 +++ .../v1_20270101/api/__init__.py | 0 .../v1_20270101/api/dashboards_api.py | 160 +++++++++++++++ .../v1_20270101/apis/__init__.py | 6 + .../v1_20270101/model/__init__.py | 0 .../v1_20270101/model/dashboard_summary.py | 57 ++++++ .../model/dashboard_summary_definition.py | 184 ++++++++++++++++++ .../v1_20270101/model/dashboard_summary_id.py | 34 ++++ .../v1_20270101/models/__init__.py | 9 + 12 files changed, 591 insertions(+), 10 deletions(-) create mode 100644 src/datadog_api_client/v1_20270101/__init__.py create mode 100644 src/datadog_api_client/v1_20270101/api/__init__.py create mode 100644 src/datadog_api_client/v1_20270101/api/dashboards_api.py create mode 100644 src/datadog_api_client/v1_20270101/apis/__init__.py create mode 100644 src/datadog_api_client/v1_20270101/model/__init__.py create mode 100644 src/datadog_api_client/v1_20270101/model/dashboard_summary.py create mode 100644 src/datadog_api_client/v1_20270101/model/dashboard_summary_definition.py create mode 100644 src/datadog_api_client/v1_20270101/model/dashboard_summary_id.py create mode 100644 src/datadog_api_client/v1_20270101/models/__init__.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 7056d83d64..817b35746c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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: @@ -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:`. + 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: diff --git a/src/datadog_api_client/api_client.py b/src/datadog_api_client/api_client.py index c048e29978..5cba7dbe47 100644 --- a/src/datadog_api_client/api_client.py +++ b/src/datadog_api_client/api_client.py @@ -682,7 +682,7 @@ def __init__( self, settings: Dict[str, Any], params_map: Dict[str, Dict[str, Any]], - headers_map: Dict[str, List[str]], + headers_map: Dict[str, Any], api_client: ApiClient, ): """Creates an endpoint. @@ -708,6 +708,7 @@ def __init__( :type params_map: dict :param headers_map: See below key value pairs: 'accept' (list): list of Accept header strings + 'api_version' (str): optional Datadog API version header value 'content_type' (list): list of Content-Type header strings :type headers_map: dict :param api_client API client instance. @@ -780,6 +781,10 @@ def gather_params(self, kwargs): header_list = self.api_client.select_header_content_type(content_type_headers_list) params["header"]["Content-Type"] = header_list + api_version = self.headers_map.get("api_version") + if api_version: + params["header"]["DD-API-Version"] = api_version + self.update_params_for_auth(params["header"], params["query"]) return params diff --git a/src/datadog_api_client/v1/api/dashboards_api.py b/src/datadog_api_client/v1/api/dashboards_api.py index 88b7b4c560..57385f404b 100644 --- a/src/datadog_api_client/v1/api/dashboards_api.py +++ b/src/datadog_api_client/v1/api/dashboards_api.py @@ -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 @@ -24,6 +23,7 @@ from datadog_api_client.v1.model.shared_dashboard_update_request import SharedDashboardUpdateRequest from datadog_api_client.v1.model.shared_dashboard_invites import SharedDashboardInvites from datadog_api_client.v1.model.dashboard_delete_response import DashboardDeleteResponse +from datadog_api_client.v1.model.dashboard_summary_definition import DashboardSummaryDefinition class DashboardsApi: diff --git a/src/datadog_api_client/v1_20270101/__init__.py b/src/datadog_api_client/v1_20270101/__init__.py new file mode 100644 index 0000000000..e54af0393b --- /dev/null +++ b/src/datadog_api_client/v1_20270101/__init__.py @@ -0,0 +1,27 @@ +# 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 datadog_api_client.api_client import ApiClient, AsyncApiClient +from datadog_api_client.configuration import Configuration +from datadog_api_client.exceptions import ( + OpenApiException, + ApiAttributeError, + ApiTypeError, + ApiValueError, + ApiKeyError, + ApiException, +) + + +__all__ = [ + "ApiClient", + "AsyncApiClient", + "Configuration", + "OpenApiException", + "ApiAttributeError", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiException", +] diff --git a/src/datadog_api_client/v1_20270101/api/__init__.py b/src/datadog_api_client/v1_20270101/api/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/datadog_api_client/v1_20270101/api/dashboards_api.py b/src/datadog_api_client/v1_20270101/api/dashboards_api.py new file mode 100644 index 0000000000..f09d16cab7 --- /dev/null +++ b/src/datadog_api_client/v1_20270101/api/dashboards_api.py @@ -0,0 +1,160 @@ +# 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 + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v1_20270101.model.dashboard_summary import DashboardSummary +from datadog_api_client.v1_20270101.model.dashboard_summary_definition import DashboardSummaryDefinition + + +class DashboardsApi: + """ + Manage all your dashboards, as well as access to your shared dashboards, through the API. See the `Dashboards page `_ for more information. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._list_dashboards_endpoint = _Endpoint( + settings={ + "response_type": (DashboardSummary,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v1/dashboard", + "operation_id": "list_dashboards", + "http_method": "GET", + "version": "v1", + }, + params_map={ + "filter_shared": { + "openapi_types": (bool,), + "attribute": "filter[shared]", + "location": "query", + }, + "filter_deleted": { + "openapi_types": (bool,), + "attribute": "filter[deleted]", + "location": "query", + }, + "count": { + "openapi_types": (int,), + "attribute": "count", + "location": "query", + }, + "start": { + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + "api_version": "2027-01-01", + }, + api_client=api_client, + ) + + def list_dashboards( + self, + *, + filter_shared: Union[bool, UnsetType] = unset, + filter_deleted: Union[bool, UnsetType] = unset, + count: Union[int, UnsetType] = unset, + start: Union[int, UnsetType] = unset, + ) -> DashboardSummary: + """Get all dashboards. + + Get all dashboards. + + **Note** : This query will only return custom created or cloned dashboards. + This query will not return preset dashboards. + + :param filter_shared: When ``true`` , this query only returns shared custom created + or cloned dashboards. + :type filter_shared: bool, optional + :param filter_deleted: When ``true`` , this query returns only deleted custom-created + or cloned dashboards. This parameter is incompatible with ``filter[shared]``. + :type filter_deleted: bool, optional + :param count: The maximum number of dashboards returned in the list. + :type count: int, optional + :param start: The specific offset to use as the beginning of the returned response. + :type start: int, optional + :rtype: DashboardSummary + """ + kwargs: Dict[str, Any] = {} + if filter_shared is not unset: + kwargs["filter_shared"] = filter_shared + + if filter_deleted is not unset: + kwargs["filter_deleted"] = filter_deleted + + if count is not unset: + kwargs["count"] = count + + if start is not unset: + kwargs["start"] = start + + return self._list_dashboards_endpoint.call_with_http_info(**kwargs) + + def list_dashboards_with_pagination( + self, + *, + filter_shared: Union[bool, UnsetType] = unset, + filter_deleted: Union[bool, UnsetType] = unset, + count: Union[int, UnsetType] = unset, + start: Union[int, UnsetType] = unset, + ) -> collections.abc.Iterable[DashboardSummaryDefinition]: + """Get all dashboards. + + Provide a paginated version of :meth:`list_dashboards`, returning all items. + + :param filter_shared: When ``true`` , this query only returns shared custom created + or cloned dashboards. + :type filter_shared: bool, optional + :param filter_deleted: When ``true`` , this query returns only deleted custom-created + or cloned dashboards. This parameter is incompatible with ``filter[shared]``. + :type filter_deleted: bool, optional + :param count: The maximum number of dashboards returned in the list. + :type count: int, optional + :param start: The specific offset to use as the beginning of the returned response. + :type start: int, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[DashboardSummaryDefinition] + """ + kwargs: Dict[str, Any] = {} + if filter_shared is not unset: + kwargs["filter_shared"] = filter_shared + + if filter_deleted is not unset: + kwargs["filter_deleted"] = filter_deleted + + if count is not unset: + kwargs["count"] = count + + if start is not unset: + kwargs["start"] = start + + local_page_size = get_attribute_from_path(kwargs, "count", 100) + endpoint = self._list_dashboards_endpoint + set_attribute_from_path(kwargs, "count", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "dashboards", + "page_offset_param": "start", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) diff --git a/src/datadog_api_client/v1_20270101/apis/__init__.py b/src/datadog_api_client/v1_20270101/apis/__init__.py new file mode 100644 index 0000000000..c998a87487 --- /dev/null +++ b/src/datadog_api_client/v1_20270101/apis/__init__.py @@ -0,0 +1,6 @@ +from datadog_api_client.v1_20270101.api.dashboards_api import DashboardsApi + + +__all__ = [ + "DashboardsApi", +] diff --git a/src/datadog_api_client/v1_20270101/model/__init__.py b/src/datadog_api_client/v1_20270101/model/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/datadog_api_client/v1_20270101/model/dashboard_summary.py b/src/datadog_api_client/v1_20270101/model/dashboard_summary.py new file mode 100644 index 0000000000..e64e1fc47a --- /dev/null +++ b/src/datadog_api_client/v1_20270101/model/dashboard_summary.py @@ -0,0 +1,57 @@ +# 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_20270101.model.dashboard_summary_definition import DashboardSummaryDefinition + + +class DashboardSummary(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1_20270101.model.dashboard_summary_definition import DashboardSummaryDefinition + + return { + "dashboards": ([DashboardSummaryDefinition],), + "total": (int,), + } + + attribute_map = { + "dashboards": "dashboards", + "total": "total", + } + read_only_vars = { + "total", + } + + def __init__( + self_, + dashboards: Union[List[DashboardSummaryDefinition], UnsetType] = unset, + total: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Dashboard summary response. + + :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 + if total is not unset: + kwargs["total"] = total + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1_20270101/model/dashboard_summary_definition.py b/src/datadog_api_client/v1_20270101/model/dashboard_summary_definition.py new file mode 100644 index 0000000000..7375fbcf91 --- /dev/null +++ b/src/datadog_api_client/v1_20270101/model/dashboard_summary_definition.py @@ -0,0 +1,184 @@ +# 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, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.creator import Creator + from datadog_api_client.v1_20270101.model.dashboard_summary_id import DashboardSummaryID + + +class DashboardSummaryDefinition(ModelNormal): + validations = { + "popularity": { + "inclusive_maximum": 5, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.creator import Creator + from datadog_api_client.v1_20270101.model.dashboard_summary_id import DashboardSummaryID + + return { + "author": (Creator,), + "created": (datetime, none_type), + "icon": (str, none_type), + "id": (DashboardSummaryID,), + "integration_id": (str, none_type), + "is_favorite": (bool,), + "is_read_only": (bool,), + "is_shared": (bool,), + "last_view_date": (str, none_type), + "modified": (datetime, none_type), + "popularity": (int,), + "tags": ([str], none_type), + "title": (str,), + "type": (str,), + "url": (str,), + } + + attribute_map = { + "author": "author", + "created": "created", + "icon": "icon", + "id": "id", + "integration_id": "integration_id", + "is_favorite": "is_favorite", + "is_read_only": "is_read_only", + "is_shared": "is_shared", + "last_view_date": "last_view_date", + "modified": "modified", + "popularity": "popularity", + "tags": "tags", + "title": "title", + "type": "type", + "url": "url", + } + read_only_vars = { + "author", + "created", + "icon", + "integration_id", + "is_favorite", + "is_read_only", + "is_shared", + "last_view_date", + "modified", + "popularity", + "tags", + "title", + "type", + "url", + } + + def __init__( + self_, + author: Union[Creator, UnsetType] = unset, + created: Union[datetime, none_type, UnsetType] = unset, + icon: Union[str, none_type, UnsetType] = unset, + id: Union[DashboardSummaryID, str, int, UnsetType] = unset, + integration_id: Union[str, none_type, UnsetType] = unset, + is_favorite: Union[bool, UnsetType] = unset, + is_read_only: Union[bool, UnsetType] = unset, + is_shared: Union[bool, UnsetType] = unset, + last_view_date: Union[str, none_type, UnsetType] = unset, + modified: Union[datetime, none_type, UnsetType] = unset, + popularity: Union[int, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + url: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Dashboard definition. + + :param author: Object describing the creator of the shared element. + :type author: Creator, optional + + :param created: Date of creation of the dashboard. + :type created: datetime, none_type, optional + + :param icon: URL to the icon of the dashboard. + :type icon: str, none_type, optional + + :param id: ID of the dashboard. + :type id: DashboardSummaryID, optional + + :param integration_id: The short name of the integration. + :type integration_id: str, none_type, optional + + :param is_favorite: Whether the dashboard is in the favorites. + :type is_favorite: bool, optional + + :param is_read_only: Whether the dashboard is read only. + :type is_read_only: bool, optional + + :param is_shared: Whether the dashboard is publicly shared. + :type is_shared: bool, optional + + :param last_view_date: Date when the dashboard was last viewed. + :type last_view_date: str, none_type, optional + + :param modified: Date of last edition of the dashboard. + :type modified: datetime, none_type, optional + + :param popularity: Popularity of the dashboard. + :type popularity: int, optional + + :param tags: List of team names representing ownership of the dashboard. + :type tags: [str], none_type, optional + + :param title: Title of the dashboard. + :type title: str, optional + + :param type: The type of the dashboard. + :type type: str, optional + + :param url: URL path to the dashboard. + :type url: str, optional + """ + if author is not unset: + kwargs["author"] = author + if created is not unset: + kwargs["created"] = created + if icon is not unset: + kwargs["icon"] = icon + if id is not unset: + kwargs["id"] = id + if integration_id is not unset: + kwargs["integration_id"] = integration_id + if is_favorite is not unset: + kwargs["is_favorite"] = is_favorite + if is_read_only is not unset: + kwargs["is_read_only"] = is_read_only + if is_shared is not unset: + kwargs["is_shared"] = is_shared + if last_view_date is not unset: + kwargs["last_view_date"] = last_view_date + if modified is not unset: + kwargs["modified"] = modified + if popularity is not unset: + kwargs["popularity"] = popularity + if tags is not unset: + kwargs["tags"] = tags + if title is not unset: + kwargs["title"] = title + if type is not unset: + kwargs["type"] = type + if url is not unset: + kwargs["url"] = url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1_20270101/model/dashboard_summary_id.py b/src/datadog_api_client/v1_20270101/model/dashboard_summary_id.py new file mode 100644 index 0000000000..891548ed5f --- /dev/null +++ b/src/datadog_api_client/v1_20270101/model/dashboard_summary_id.py @@ -0,0 +1,34 @@ +# 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 DashboardSummaryID(ModelComposed): + def __init__(self, **kwargs): + """ + ID of the dashboard. + """ + 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 + return { + "oneOf": [ + str, + int, + ], + } diff --git a/src/datadog_api_client/v1_20270101/models/__init__.py b/src/datadog_api_client/v1_20270101/models/__init__.py new file mode 100644 index 0000000000..d90f00a09a --- /dev/null +++ b/src/datadog_api_client/v1_20270101/models/__init__.py @@ -0,0 +1,9 @@ +from datadog_api_client.v1_20270101.model.dashboard_summary import DashboardSummary +from datadog_api_client.v1_20270101.model.dashboard_summary_definition import DashboardSummaryDefinition +from datadog_api_client.v1_20270101.model.dashboard_summary_id import DashboardSummaryID + +__all__ = [ + "DashboardSummary", + "DashboardSummaryDefinition", + "DashboardSummaryID", +]