From 9fdf1824abc68a4217dce69df3a904347062a2ef Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 May 2026 19:40:11 +0000 Subject: [PATCH] Regenerate client from commit 20922e6 of spec repo --- .generator/schemas/v2/openapi.yaml | 154 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 35 ++++ .../stegadography/GetStegadographyWidgets.py | 13 ++ .../v2/api/stegadography_api.py | 65 ++++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../stegadography_get_widgets_request.py | 34 ++++ .../stegadography_get_widgets_response.py | 40 +++++ .../v2/model/stegadography_widget.py | 54 ++++++ .../model/stegadography_widget_attributes.py | 51 ++++++ .../v2/model/stegadography_widget_type.py | 35 ++++ src/datadog_api_client/v2/models/__init__.py | 10 ++ tests/v2/features/stegadography.feature | 25 +++ tests/v2/features/undo.json | 6 + 14 files changed, 531 insertions(+) create mode 100644 examples/v2/stegadography/GetStegadographyWidgets.py create mode 100644 src/datadog_api_client/v2/api/stegadography_api.py create mode 100644 src/datadog_api_client/v2/model/stegadography_get_widgets_request.py create mode 100644 src/datadog_api_client/v2/model/stegadography_get_widgets_response.py create mode 100644 src/datadog_api_client/v2/model/stegadography_widget.py create mode 100644 src/datadog_api_client/v2/model/stegadography_widget_attributes.py create mode 100644 src/datadog_api_client/v2/model/stegadography_widget_type.py create mode 100644 tests/v2/features/stegadography.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4bc99f94bc..347c49b18c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -83901,6 +83901,89 @@ components: type: string x-enum-varnames: - USERS + StegadographyGetWidgetsRequest: + description: Multipart form data containing the PNG image to scan for watermarks. + properties: + image: + description: PNG image file to scan for embedded watermarks. + example: "screenshot.png" + format: binary + type: string + required: + - image + type: object + StegadographyGetWidgetsResponse: + description: Response containing watermarked widgets recovered from an image. + properties: + data: + $ref: "#/components/schemas/StegadographyWidgetItems" + required: + - data + type: object + StegadographyWidget: + description: A single watermarked widget resource recovered from an image. + properties: + attributes: + $ref: "#/components/schemas/StegadographyWidgetAttributes" + id: + description: Composite identifier formed from the organization ID and watermark, separated by a colon. + example: "abc123:0123456789abcdef" + type: string + type: + $ref: "#/components/schemas/StegadographyWidgetType" + required: + - id + - type + - attributes + type: object + StegadographyWidgetAttributes: + description: Attributes of a watermarked widget recovered from an image. + properties: + locationx: + description: Horizontal pixel coordinate where the watermark was found in the image. + example: 100 + format: int64 + type: integer + locationy: + description: Vertical pixel coordinate where the watermark was found in the image. + example: 200 + format: int64 + type: integer + rawData: + description: JSON-encoded string representing the widget state. + example: '{"widgetType":"timeseries","requests":[]}' + type: string + watermark: + description: Hex-encoded watermark string identifying the widget. + example: "0123456789abcdef" + type: string + required: + - rawData + - watermark + - locationx + - locationy + type: object + StegadographyWidgetItems: + description: List of watermarked widget resources recovered from an image. + example: + - attributes: + locationx: 100 + locationy: 200 + rawData: '{"widgetType":"timeseries","requests":[]}' + watermark: "0123456789abcdef" + id: "abc123:0123456789abcdef" + type: widget + items: + $ref: "#/components/schemas/StegadographyWidget" + type: array + StegadographyWidgetType: + description: Stegadography widget resource type. + enum: + - widget + example: widget + type: string + x-enum-varnames: + - WIDGET Step: description: A Step is a sub-component of a workflow. Each Step performs an action. properties: @@ -161903,6 +161986,75 @@ paths: - status_pages_settings_write - status_pages_public_page_publish - status_pages_internal_page_publish + /api/v2/stegadography/get-widgets: + post: + description: |- + Extracts watermarks from a PNG image and returns the cached widget data + associated with each watermark found. The image must be uploaded as a + `multipart/form-data` request with the file in the `image` field. + Only widgets belonging to the authenticated organization are returned. + operationId: GetStegadographyWidgets + requestBody: + content: + multipart/form-data: + examples: + default: + value: + image: "screenshot.png" + schema: + $ref: "#/components/schemas/StegadographyGetWidgetsRequest" + description: PNG image to extract watermarks from. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + locationx: 100 + locationy: 200 + rawData: '{"widgetType":"timeseries","requests":[]}' + watermark: "0123456789abcdef" + id: "abc123:0123456789abcdef" + type: widget + schema: + $ref: "#/components/schemas/StegadographyGetWidgetsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "415": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unsupported Media Type + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get widgets from an image + tags: + - Stegadography /api/v2/synthetics/api-multistep/subtests/{public_id}: get: description: |- @@ -170201,6 +170353,8 @@ tags: name: Static Analysis - description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages + - description: Extract watermarks embedded in dashboard screenshots to retrieve cached widget state. + name: Stegadography - description: |- Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored. name: Storage Management diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 7ec5d64245..0dd12927e9 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -753,6 +753,13 @@ datadog\_api\_client.v2.api.status\_pages\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.stegadography\_api module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.stegadography_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.storage\_management\_api module ----------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5d1f8d7e30..72d4e843af 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -36607,6 +36607,41 @@ datadog\_api\_client.v2.model.status\_pages\_user\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.stegadography\_get\_widgets\_request module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.stegadography_get_widgets_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.stegadography\_get\_widgets\_response module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.stegadography_get_widgets_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.stegadography\_widget module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.stegadography_widget + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.stegadography\_widget\_attributes module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.stegadography_widget_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.stegadography\_widget\_type module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.stegadography_widget_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.step module ----------------------------------------- diff --git a/examples/v2/stegadography/GetStegadographyWidgets.py b/examples/v2/stegadography/GetStegadographyWidgets.py new file mode 100644 index 0000000000..bc2953d852 --- /dev/null +++ b/examples/v2/stegadography/GetStegadographyWidgets.py @@ -0,0 +1,13 @@ +""" +Get widgets from an image returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.stegadography_api import StegadographyApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StegadographyApi(api_client) + response = api_instance.get_stegadography_widgets() + + print(response) diff --git a/src/datadog_api_client/v2/api/stegadography_api.py b/src/datadog_api_client/v2/api/stegadography_api.py new file mode 100644 index 0000000000..d7c59392f0 --- /dev/null +++ b/src/datadog_api_client/v2/api/stegadography_api.py @@ -0,0 +1,65 @@ +# 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.model_utils import ( + file_type, +) +from datadog_api_client.v2.model.stegadography_get_widgets_response import StegadographyGetWidgetsResponse + + +class StegadographyApi: + """ + Extract watermarks embedded in dashboard screenshots to retrieve cached widget state. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_stegadography_widgets_endpoint = _Endpoint( + settings={ + "response_type": (StegadographyGetWidgetsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/stegadography/get-widgets", + "operation_id": "get_stegadography_widgets", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "image": { + "required": True, + "openapi_types": (file_type,), + "attribute": "image", + "location": "form", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["multipart/form-data"]}, + api_client=api_client, + ) + + def get_stegadography_widgets( + self, + image: file_type, + ) -> StegadographyGetWidgetsResponse: + """Get widgets from an image. + + Extracts watermarks from a PNG image and returns the cached widget data + associated with each watermark found. The image must be uploaded as a + ``multipart/form-data`` request with the file in the ``image`` field. + Only widgets belonging to the authenticated organization are returned. + + :param image: PNG image file to scan for embedded watermarks. + :type image: file_type + :rtype: StegadographyGetWidgetsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["image"] = image + + return self._get_stegadography_widgets_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 54b4eab8ed..eefd73e409 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -105,6 +105,7 @@ from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from datadog_api_client.v2.api.stegadography_api import StegadographyApi from datadog_api_client.v2.api.storage_management_api import StorageManagementApi from datadog_api_client.v2.api.synthetics_api import SyntheticsApi from datadog_api_client.v2.api.teams_api import TeamsApi @@ -224,6 +225,7 @@ "SpansMetricsApi", "StaticAnalysisApi", "StatusPagesApi", + "StegadographyApi", "StorageManagementApi", "SyntheticsApi", "TeamsApi", diff --git a/src/datadog_api_client/v2/model/stegadography_get_widgets_request.py b/src/datadog_api_client/v2/model/stegadography_get_widgets_request.py new file mode 100644 index 0000000000..b20435aaa0 --- /dev/null +++ b/src/datadog_api_client/v2/model/stegadography_get_widgets_request.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 ( + ModelNormal, + cached_property, + file_type, +) + + +class StegadographyGetWidgetsRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "image": (file_type,), + } + + attribute_map = { + "image": "image", + } + + def __init__(self_, image: file_type, **kwargs): + """ + Multipart form data containing the PNG image to scan for watermarks. + + :param image: PNG image file to scan for embedded watermarks. + :type image: file_type + """ + super().__init__(kwargs) + + self_.image = image diff --git a/src/datadog_api_client/v2/model/stegadography_get_widgets_response.py b/src/datadog_api_client/v2/model/stegadography_get_widgets_response.py new file mode 100644 index 0000000000..2dfef5208a --- /dev/null +++ b/src/datadog_api_client/v2/model/stegadography_get_widgets_response.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.stegadography_widget import StegadographyWidget + + +class StegadographyGetWidgetsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.stegadography_widget import StegadographyWidget + + return { + "data": ([StegadographyWidget],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[StegadographyWidget], **kwargs): + """ + Response containing watermarked widgets recovered from an image. + + :param data: List of watermarked widget resources recovered from an image. + :type data: [StegadographyWidget] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/stegadography_widget.py b/src/datadog_api_client/v2/model/stegadography_widget.py new file mode 100644 index 0000000000..298ee8f38b --- /dev/null +++ b/src/datadog_api_client/v2/model/stegadography_widget.py @@ -0,0 +1,54 @@ +# 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.stegadography_widget_attributes import StegadographyWidgetAttributes + from datadog_api_client.v2.model.stegadography_widget_type import StegadographyWidgetType + + +class StegadographyWidget(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.stegadography_widget_attributes import StegadographyWidgetAttributes + from datadog_api_client.v2.model.stegadography_widget_type import StegadographyWidgetType + + return { + "attributes": (StegadographyWidgetAttributes,), + "id": (str,), + "type": (StegadographyWidgetType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: StegadographyWidgetAttributes, id: str, type: StegadographyWidgetType, **kwargs): + """ + A single watermarked widget resource recovered from an image. + + :param attributes: Attributes of a watermarked widget recovered from an image. + :type attributes: StegadographyWidgetAttributes + + :param id: Composite identifier formed from the organization ID and watermark, separated by a colon. + :type id: str + + :param type: Stegadography widget resource type. + :type type: StegadographyWidgetType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/stegadography_widget_attributes.py b/src/datadog_api_client/v2/model/stegadography_widget_attributes.py new file mode 100644 index 0000000000..2a545ff06e --- /dev/null +++ b/src/datadog_api_client/v2/model/stegadography_widget_attributes.py @@ -0,0 +1,51 @@ +# 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 StegadographyWidgetAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "locationx": (int,), + "locationy": (int,), + "raw_data": (str,), + "watermark": (str,), + } + + attribute_map = { + "locationx": "locationx", + "locationy": "locationy", + "raw_data": "rawData", + "watermark": "watermark", + } + + def __init__(self_, locationx: int, locationy: int, raw_data: str, watermark: str, **kwargs): + """ + Attributes of a watermarked widget recovered from an image. + + :param locationx: Horizontal pixel coordinate where the watermark was found in the image. + :type locationx: int + + :param locationy: Vertical pixel coordinate where the watermark was found in the image. + :type locationy: int + + :param raw_data: JSON-encoded string representing the widget state. + :type raw_data: str + + :param watermark: Hex-encoded watermark string identifying the widget. + :type watermark: str + """ + super().__init__(kwargs) + + self_.locationx = locationx + self_.locationy = locationy + self_.raw_data = raw_data + self_.watermark = watermark diff --git a/src/datadog_api_client/v2/model/stegadography_widget_type.py b/src/datadog_api_client/v2/model/stegadography_widget_type.py new file mode 100644 index 0000000000..9e3a561283 --- /dev/null +++ b/src/datadog_api_client/v2/model/stegadography_widget_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 StegadographyWidgetType(ModelSimple): + """ + Stegadography widget resource type. + + :param value: If omitted defaults to "widget". Must be one of ["widget"]. + :type value: str + """ + + allowed_values = { + "widget", + } + WIDGET: ClassVar["StegadographyWidgetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +StegadographyWidgetType.WIDGET = StegadographyWidgetType("widget") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index cea5bec21d..17535b003a 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7470,6 +7470,11 @@ from datadog_api_client.v2.model.status_pages_user import StatusPagesUser from datadog_api_client.v2.model.status_pages_user_attributes import StatusPagesUserAttributes from datadog_api_client.v2.model.status_pages_user_type import StatusPagesUserType +from datadog_api_client.v2.model.stegadography_get_widgets_request import StegadographyGetWidgetsRequest +from datadog_api_client.v2.model.stegadography_get_widgets_response import StegadographyGetWidgetsResponse +from datadog_api_client.v2.model.stegadography_widget import StegadographyWidget +from datadog_api_client.v2.model.stegadography_widget_attributes import StegadographyWidgetAttributes +from datadog_api_client.v2.model.stegadography_widget_type import StegadographyWidgetType from datadog_api_client.v2.model.step import Step from datadog_api_client.v2.model.step_display import StepDisplay from datadog_api_client.v2.model.step_display_bounds import StepDisplayBounds @@ -13722,6 +13727,11 @@ "StatusPagesUser", "StatusPagesUserAttributes", "StatusPagesUserType", + "StegadographyGetWidgetsRequest", + "StegadographyGetWidgetsResponse", + "StegadographyWidget", + "StegadographyWidgetAttributes", + "StegadographyWidgetType", "Step", "StepDisplay", "StepDisplayBounds", diff --git a/tests/v2/features/stegadography.feature b/tests/v2/features/stegadography.feature new file mode 100644 index 0000000000..074f179559 --- /dev/null +++ b/tests/v2/features/stegadography.feature @@ -0,0 +1,25 @@ +@endpoint(stegadography) @endpoint(stegadography-v2) +Feature: Stegadography + Extract watermarks embedded in dashboard screenshots to retrieve cached + widget state. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Stegadography" API + And new "GetStegadographyWidgets" request + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Get widgets from an image returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Get widgets from an image returns "OK" response + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Get widgets from an image returns "Unsupported Media Type" response + When the request is sent + Then the response status is 415 Unsupported Media Type diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index b6003df868..32dd3bda46 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7640,6 +7640,12 @@ "type": "idempotent" } }, + "GetStegadographyWidgets": { + "tag": "Stegadography", + "undo": { + "type": "safe" + } + }, "GetApiMultistepSubtests": { "tag": "Synthetics", "undo": {