Skip to content

Commit fc9f781

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d03a328 of spec repo
1 parent 4aa1ffa commit fc9f781

13 files changed

Lines changed: 896 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86739,6 +86739,77 @@ components:
8673986739
required:
8674086740
- data
8674186741
type: object
86742+
StegadographyGetWidgetsFormData:
86743+
description: The form data submitted to look up widgets from a watermarked image.
86744+
properties:
86745+
image:
86746+
description: A PNG image (for example, a dashboard screenshot) containing embedded widget watermarks.
86747+
format: binary
86748+
type: string
86749+
x-mimetype: image/png
86750+
type: object
86751+
StegadographyWidgetAttributes:
86752+
description: Attributes of a widget recovered from an image watermark.
86753+
properties:
86754+
locationx:
86755+
description: Horizontal pixel coordinate of the watermark within the image.
86756+
example: 120
86757+
format: int64
86758+
type: integer
86759+
locationy:
86760+
description: Vertical pixel coordinate of the watermark within the image.
86761+
example: 240
86762+
format: int64
86763+
type: integer
86764+
rawData:
86765+
description: Stored snapshot of the widget state, returned exactly as it was cached.
86766+
example: '{"definition":{"type":"timeseries"}}'
86767+
type: string
86768+
watermark:
86769+
description: The watermark value extracted from the image that this widget was matched against.
86770+
example: "abc123"
86771+
type: string
86772+
required:
86773+
- rawData
86774+
- watermark
86775+
- locationx
86776+
- locationy
86777+
type: object
86778+
StegadographyWidgetData:
86779+
description: A single widget recovered from an image watermark.
86780+
properties:
86781+
attributes:
86782+
$ref: "#/components/schemas/StegadographyWidgetAttributes"
86783+
id:
86784+
description: Identifier of the cached widget, scoped to the organization.
86785+
example: "1a2b:abc123"
86786+
type: string
86787+
type:
86788+
$ref: "#/components/schemas/StegadographyWidgetType"
86789+
required:
86790+
- id
86791+
- type
86792+
- attributes
86793+
type: object
86794+
StegadographyWidgetType:
86795+
description: Widget resource type.
86796+
enum:
86797+
- widget
86798+
example: widget
86799+
type: string
86800+
x-enum-varnames:
86801+
- WIDGET
86802+
StegadographyWidgetsResponse:
86803+
description: Response containing the widgets recovered from the uploaded image.
86804+
properties:
86805+
data:
86806+
description: List of widgets matched to watermarks found in the image.
86807+
items:
86808+
$ref: "#/components/schemas/StegadographyWidgetData"
86809+
type: array
86810+
required:
86811+
- data
86812+
type: object
8674286813
Step:
8674386814
description: A Step is a sub-component of a workflow. Each Step performs an action.
8674486815
properties:
@@ -167338,6 +167409,76 @@ paths:
167338167409
- status_pages_settings_write
167339167410
- status_pages_public_page_publish
167340167411
- status_pages_internal_page_publish
167412+
/api/v2/stegadography/get-widgets:
167413+
post:
167414+
description: |-
167415+
Extracts embedded watermarks from an uploaded PNG image (for example, a dashboard screenshot)
167416+
and returns the cached widget state matching each watermark found.
167417+
operationId: GetWidgetsFromImage
167418+
requestBody:
167419+
content:
167420+
multipart/form-data:
167421+
examples:
167422+
default:
167423+
value: {}
167424+
schema:
167425+
$ref: "#/components/schemas/StegadographyGetWidgetsFormData"
167426+
description: The image to extract widget watermarks from.
167427+
required: true
167428+
responses:
167429+
"200":
167430+
content:
167431+
application/json:
167432+
examples:
167433+
default:
167434+
value:
167435+
data:
167436+
- attributes:
167437+
locationx: 120
167438+
locationy: 240
167439+
rawData: '{"definition":{"type":"timeseries"}}'
167440+
watermark: "abc123"
167441+
id: "1a2b:abc123"
167442+
type: widget
167443+
schema:
167444+
$ref: "#/components/schemas/StegadographyWidgetsResponse"
167445+
description: OK
167446+
"400":
167447+
content:
167448+
application/json:
167449+
schema:
167450+
$ref: "#/components/schemas/JSONAPIErrorResponse"
167451+
description: Bad Request
167452+
"403":
167453+
content:
167454+
application/json:
167455+
schema:
167456+
$ref: "#/components/schemas/JSONAPIErrorResponse"
167457+
description: Forbidden
167458+
"415":
167459+
content:
167460+
application/json:
167461+
schema:
167462+
$ref: "#/components/schemas/JSONAPIErrorResponse"
167463+
description: Unsupported Media Type
167464+
"429":
167465+
$ref: "#/components/responses/TooManyRequestsResponse"
167466+
"500":
167467+
content:
167468+
application/json:
167469+
schema:
167470+
$ref: "#/components/schemas/JSONAPIErrorResponse"
167471+
description: Internal Server Error
167472+
security:
167473+
- apiKeyAuth: []
167474+
appKeyAuth: []
167475+
summary: Get widgets from an image
167476+
tags:
167477+
- Stegadography
167478+
x-codegen-request-body-name: body
167479+
x-unstable: |-
167480+
**Note**: This endpoint is in preview and is subject to change.
167481+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
167341167482
/api/v2/synthetics/api-multistep/subtests/{public_id}:
167342167483
get:
167343167484
description: |-
@@ -175651,6 +175792,8 @@ tags:
175651175792
externalDocs:
175652175793
url: https://docs.datadoghq.com/api/latest/statuspage-integration
175653175794
name: Statuspage Integration
175795+
- description: Recover dashboard widget data from watermarks embedded in images.
175796+
name: Stegadography
175654175797
- description: |-
175655175798
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.
175656175799
name: Storage Management
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get widgets from an image returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_widgets_from_image".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::StegadographyAPI.new
8+
p api_instance.get_widgets_from_image()

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5171,6 +5171,9 @@
51715171
"v2.UnpublishStatusPage" => {
51725172
"page_id" => "UUID",
51735173
},
5174+
"v2.GetWidgetsFromImage" => {
5175+
"image" => "File",
5176+
},
51745177
"v2.GetApiMultistepSubtests" => {
51755178
"public_id" => "String",
51765179
},

features/v2/stegadography.feature

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@endpoint(stegadography) @endpoint(stegadography-v2)
2+
Feature: Stegadography
3+
Recover dashboard widget data from watermarks embedded in images.
4+
5+
Background:
6+
Given a valid "apiKeyAuth" key in the system
7+
And a valid "appKeyAuth" key in the system
8+
And an instance of "Stegadography" API
9+
And operation "GetWidgetsFromImage" enabled
10+
And new "GetWidgetsFromImage" request
11+
12+
@generated @skip @team:DataDog/dataviz-backend-maintainers
13+
Scenario: Get widgets from an image returns "Bad Request" response
14+
When the request is sent
15+
Then the response status is 400 Bad Request
16+
17+
@generated @skip @team:DataDog/dataviz-backend-maintainers
18+
Scenario: Get widgets from an image returns "OK" response
19+
When the request is sent
20+
Then the response status is 200 OK
21+
22+
@generated @skip @team:DataDog/dataviz-backend-maintainers
23+
Scenario: Get widgets from an image returns "Unsupported Media Type" response
24+
When the request is sent
25+
Then the response status is 415 Unsupported Media Type

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7918,6 +7918,12 @@
79187918
"type": "idempotent"
79197919
}
79207920
},
7921+
"GetWidgetsFromImage": {
7922+
"tag": "Stegadography",
7923+
"undo": {
7924+
"type": "safe"
7925+
}
7926+
},
79217927
"GetApiMultistepSubtests": {
79227928
"tag": "Synthetics",
79237929
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ def initialize
616616
"v2.revert_custom_rule_revision": false,
617617
"v2.update_ai_custom_ruleset": false,
618618
"v2.update_custom_ruleset": false,
619+
"v2.get_widgets_from_image": false,
619620
"v2.add_member_team": false,
620621
"v2.list_member_teams": false,
621622
"v2.remove_member_team": false,

lib/datadog_api_client/inflector.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6487,6 +6487,11 @@ def overrides
64876487
"v2.statuspage_url_setting_update_attributes" => "StatuspageUrlSettingUpdateAttributes",
64886488
"v2.statuspage_url_setting_update_data" => "StatuspageUrlSettingUpdateData",
64896489
"v2.statuspage_url_setting_update_request" => "StatuspageUrlSettingUpdateRequest",
6490+
"v2.stegadography_get_widgets_form_data" => "StegadographyGetWidgetsFormData",
6491+
"v2.stegadography_widget_attributes" => "StegadographyWidgetAttributes",
6492+
"v2.stegadography_widget_data" => "StegadographyWidgetData",
6493+
"v2.stegadography_widgets_response" => "StegadographyWidgetsResponse",
6494+
"v2.stegadography_widget_type" => "StegadographyWidgetType",
64906495
"v2.step" => "Step",
64916496
"v2.step_display" => "StepDisplay",
64926497
"v2.step_display_bounds" => "StepDisplayBounds",
@@ -7381,6 +7386,7 @@ def overrides
73817386
"v2.static_analysis_api" => "StaticAnalysisAPI",
73827387
"v2.status_pages_api" => "StatusPagesAPI",
73837388
"v2.statuspage_integration_api" => "StatuspageIntegrationAPI",
7389+
"v2.stegadography_api" => "StegadographyAPI",
73847390
"v2.storage_management_api" => "StorageManagementAPI",
73857391
"v2.synthetics_api" => "SyntheticsAPI",
73867392
"v2.teams_api" => "TeamsAPI",
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class StegadographyAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# Get widgets from an image.
27+
#
28+
# @see #get_widgets_from_image_with_http_info
29+
def get_widgets_from_image(opts = {})
30+
data, _status_code, _headers = get_widgets_from_image_with_http_info(opts)
31+
data
32+
end
33+
34+
# Get widgets from an image.
35+
#
36+
# Extracts embedded watermarks from an uploaded PNG image (for example, a dashboard screenshot)
37+
# and returns the cached widget state matching each watermark found.
38+
#
39+
# @param opts [Hash] the optional parameters
40+
# @option opts [File] :image A PNG image (for example, a dashboard screenshot) containing embedded widget watermarks.
41+
# @return [Array<(StegadographyWidgetsResponse, Integer, Hash)>] StegadographyWidgetsResponse data, response status code and response headers
42+
def get_widgets_from_image_with_http_info(opts = {})
43+
unstable_enabled = @api_client.config.unstable_operations["v2.get_widgets_from_image".to_sym]
44+
if unstable_enabled
45+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_widgets_from_image")
46+
else
47+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_widgets_from_image"))
48+
end
49+
50+
if @api_client.config.debugging
51+
@api_client.config.logger.debug 'Calling API: StegadographyAPI.get_widgets_from_image ...'
52+
end
53+
# resource path
54+
local_var_path = '/api/v2/stegadography/get-widgets'
55+
56+
# query parameters
57+
query_params = opts[:query_params] || {}
58+
59+
# header parameters
60+
header_params = opts[:header_params] || {}
61+
# HTTP header 'Accept' (if needed)
62+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63+
# HTTP header 'Content-Type'
64+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
65+
66+
# form parameters
67+
form_params = opts[:form_params] || {}
68+
form_params['image'] = opts[:'image'] if !opts[:'image'].nil?
69+
70+
# http body (model)
71+
post_body = opts[:debug_body]
72+
73+
# return_type
74+
return_type = opts[:debug_return_type] || 'StegadographyWidgetsResponse'
75+
76+
# auth_names
77+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
78+
79+
new_options = opts.merge(
80+
:operation => :get_widgets_from_image,
81+
:header_params => header_params,
82+
:query_params => query_params,
83+
:form_params => form_params,
84+
:body => post_body,
85+
:auth_names => auth_names,
86+
:return_type => return_type,
87+
:api_version => "V2"
88+
)
89+
90+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
91+
if @api_client.config.debugging
92+
@api_client.config.logger.debug "API called: StegadographyAPI#get_widgets_from_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93+
end
94+
return data, status_code, headers
95+
end
96+
end
97+
end

0 commit comments

Comments
 (0)