Skip to content
Open
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
601 changes: 601 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions examples/v2/widgets/CreateWidget.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Create a widget returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WidgetsAPI.new

body = DatadogAPIClient::V2::CreateOrUpdateWidgetRequest.new({
data: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestData.new({
attributes: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestAttributes.new({
definition: DatadogAPIClient::V2::WidgetDefinition.new({
title: "My Widget",
type: DatadogAPIClient::V2::WidgetType::BAR_CHART,
}),
tags: [],
}),
type: "widgets",
}),
})
p api_instance.create_widget(WidgetExperienceType::CCM_REPORTS, body)
5 changes: 5 additions & 0 deletions examples/v2/widgets/DeleteWidget.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a widget returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WidgetsAPI.new
api_instance.delete_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
5 changes: 5 additions & 0 deletions examples/v2/widgets/GetWidget.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get a widget returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WidgetsAPI.new
p api_instance.get_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
5 changes: 5 additions & 0 deletions examples/v2/widgets/SearchWidgets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Search widgets returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WidgetsAPI.new
p api_instance.search_widgets(WidgetExperienceType::CCM_REPORTS)
18 changes: 18 additions & 0 deletions examples/v2/widgets/UpdateWidget.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Update a widget returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WidgetsAPI.new

body = DatadogAPIClient::V2::CreateOrUpdateWidgetRequest.new({
data: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestData.new({
attributes: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestAttributes.new({
definition: DatadogAPIClient::V2::WidgetDefinition.new({
title: "My Widget",
type: DatadogAPIClient::V2::WidgetType::BAR_CHART,
}),
tags: [],
}),
type: "widgets",
}),
})
p api_instance.update_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
28 changes: 28 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4164,6 +4164,34 @@
"v2.ListUserPermissions" => {
"user_id" => "String",
},
"v2.SearchWidgets" => {
"experience_type" => "WidgetExperienceType",
"filter_widget_type" => "WidgetType",
"filter_creator_handle" => "String",
"filter_is_favorited" => "Boolean",
"filter_title" => "String",
"filter_tags" => "String",
"sort" => "String",
"page_number" => "Integer",
"page_size" => "Integer",
},
"v2.CreateWidget" => {
"experience_type" => "WidgetExperienceType",
"body" => "CreateOrUpdateWidgetRequest",
},
"v2.DeleteWidget" => {
"experience_type" => "WidgetExperienceType",
"uuid" => "UUID",
},
"v2.GetWidget" => {
"experience_type" => "WidgetExperienceType",
"uuid" => "UUID",
},
"v2.UpdateWidget" => {
"experience_type" => "WidgetExperienceType",
"uuid" => "UUID",
"body" => "CreateOrUpdateWidgetRequest",
},
"v2.CreateWorkflow" => {
"body" => "CreateWorkflowRequest",
},
Expand Down
41 changes: 41 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6356,6 +6356,47 @@
"type": "safe"
}
},
"SearchWidgets": {
"tag": "Widgets",
"undo": {
"type": "safe"
}
},
"CreateWidget": {
"tag": "Widgets",
"undo": {
"operationId": "DeleteWidget",
"parameters": [
{
"name": "experience_type",
"source": "experience_type"
},
{
"name": "uuid",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteWidget": {
"tag": "Widgets",
"undo": {
"type": "idempotent"
}
},
"GetWidget": {
"tag": "Widgets",
"undo": {
"type": "safe"
}
},
"UpdateWidget": {
"tag": "Widgets",
"undo": {
"type": "safe"
}
},
"CreateWorkflow": {
"tag": "Workflow Automation",
"undo": {
Expand Down
115 changes: 115 additions & 0 deletions features/v2/widgets.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@endpoint(widgets) @endpoint(widgets-v2)
Feature: Widgets
Create, read, update, and delete saved widgets. Widgets are reusable
visualization components stored independently from any dashboard or
notebook, partitioned by experience type and identified by a UUID.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "Widgets" API

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a widget returns "Bad Request" response
Given new "CreateWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a widget returns "OK" response
Given new "CreateWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Delete a widget returns "Bad Request" response
Given new "DeleteWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Delete a widget returns "No Content" response
Given new "DeleteWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Delete a widget returns "Not Found" response
Given new "DeleteWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Get a widget returns "Bad Request" response
Given new "GetWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Get a widget returns "Not Found" response
Given new "GetWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Get a widget returns "OK" response
Given new "GetWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Search widgets returns "Bad Request" response
Given new "SearchWidgets" request
And request contains "experience_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Search widgets returns "OK" response
Given new "SearchWidgets" request
And request contains "experience_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a widget returns "Bad Request" response
Given new "UpdateWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a widget returns "Not Found" response
Given new "UpdateWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a widget returns "OK" response
Given new "UpdateWidget" request
And request contains "experience_type" parameter from "REPLACE.ME"
And request contains "uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
When the request is sent
Then the response status is 200 OK
17 changes: 17 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,9 @@ def overrides
"v2.create_open_api_response" => "CreateOpenAPIResponse",
"v2.create_open_api_response_attributes" => "CreateOpenAPIResponseAttributes",
"v2.create_open_api_response_data" => "CreateOpenAPIResponseData",
"v2.create_or_update_widget_request" => "CreateOrUpdateWidgetRequest",
"v2.create_or_update_widget_request_attributes" => "CreateOrUpdateWidgetRequestAttributes",
"v2.create_or_update_widget_request_data" => "CreateOrUpdateWidgetRequestData",
"v2.create_page_request" => "CreatePageRequest",
"v2.create_page_request_data" => "CreatePageRequestData",
"v2.create_page_request_data_attributes" => "CreatePageRequestDataAttributes",
Expand Down Expand Up @@ -5665,7 +5668,20 @@ def overrides
"v2.watcher_data_attributes" => "WatcherDataAttributes",
"v2.watcher_data_type" => "WatcherDataType",
"v2.weekday" => "Weekday",
"v2.widget_attributes" => "WidgetAttributes",
"v2.widget_data" => "WidgetData",
"v2.widget_definition" => "WidgetDefinition",
"v2.widget_experience_type" => "WidgetExperienceType",
"v2.widget_included_user" => "WidgetIncludedUser",
"v2.widget_included_user_attributes" => "WidgetIncludedUserAttributes",
"v2.widget_list_response" => "WidgetListResponse",
"v2.widget_live_span" => "WidgetLiveSpan",
"v2.widget_relationship_data" => "WidgetRelationshipData",
"v2.widget_relationship_item" => "WidgetRelationshipItem",
"v2.widget_relationships" => "WidgetRelationships",
"v2.widget_response" => "WidgetResponse",
"v2.widget_search_meta" => "WidgetSearchMeta",
"v2.widget_type" => "WidgetType",
"v2.workflow_data" => "WorkflowData",
"v2.workflow_data_attributes" => "WorkflowDataAttributes",
"v2.workflow_data_relationships" => "WorkflowDataRelationships",
Expand Down Expand Up @@ -5829,6 +5845,7 @@ def overrides
"v2.test_optimization_api" => "TestOptimizationAPI",
"v2.usage_metering_api" => "UsageMeteringAPI",
"v2.users_api" => "UsersAPI",
"v2.widgets_api" => "WidgetsAPI",
"v2.workflow_automation_api" => "WorkflowAutomationAPI"
}
end
Expand Down
Loading
Loading