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

Large diffs are not rendered by default.

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

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WidgetsApi(configuration);

const params: v2.WidgetsApiCreateWidgetRequest = {
body: {
data: {
attributes: {
definition: {
title: "My Widget",
type: "bar_chart",
},
tags: [],
},
type: "widgets",
},
},
experienceType: "ccm_reports",
};

apiInstance
.createWidget(params)
.then((data: v2.WidgetResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/widgets/DeleteWidget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Delete a widget returns "No Content" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WidgetsApi(configuration);

const params: v2.WidgetsApiDeleteWidgetRequest = {
experienceType: "ccm_reports",
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
.deleteWidget(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/widgets/GetWidget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Get a widget returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WidgetsApi(configuration);

const params: v2.WidgetsApiGetWidgetRequest = {
experienceType: "ccm_reports",
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
.getWidget(params)
.then((data: v2.WidgetResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
21 changes: 21 additions & 0 deletions examples/v2/widgets/SearchWidgets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Search widgets returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WidgetsApi(configuration);

const params: v2.WidgetsApiSearchWidgetsRequest = {
experienceType: "ccm_reports",
};

apiInstance
.searchWidgets(params)
.then((data: v2.WidgetListResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
34 changes: 34 additions & 0 deletions examples/v2/widgets/UpdateWidget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Update a widget returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WidgetsApi(configuration);

const params: v2.WidgetsApiUpdateWidgetRequest = {
body: {
data: {
attributes: {
definition: {
title: "My Widget",
type: "bar_chart",
},
tags: [],
},
type: "widgets",
},
},
experienceType: "ccm_reports",
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
.updateWidget(params)
.then((data: v2.WidgetResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
87 changes: 87 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11751,6 +11751,93 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "PermissionsResponse",
},
"v2.SearchWidgets": {
"experienceType": {
"type": "WidgetExperienceType",
"format": "",
},
"filterWidgetType": {
"type": "WidgetType",
"format": "",
},
"filterCreatorHandle": {
"type": "string",
"format": "",
},
"filterIsFavorited": {
"type": "boolean",
"format": "",
},
"filterTitle": {
"type": "string",
"format": "",
},
"filterTags": {
"type": "string",
"format": "",
},
"sort": {
"type": "string",
"format": "",
},
"pageNumber": {
"type": "number",
"format": "",
},
"pageSize": {
"type": "number",
"format": "",
},
"operationResponseType": "WidgetListResponse",
},
"v2.CreateWidget": {
"experienceType": {
"type": "WidgetExperienceType",
"format": "",
},
"body": {
"type": "CreateOrUpdateWidgetRequest",
"format": "",
},
"operationResponseType": "WidgetResponse",
},
"v2.GetWidget": {
"experienceType": {
"type": "WidgetExperienceType",
"format": "",
},
"uuid": {
"type": "string",
"format": "uuid",
},
"operationResponseType": "WidgetResponse",
},
"v2.UpdateWidget": {
"experienceType": {
"type": "WidgetExperienceType",
"format": "",
},
"uuid": {
"type": "string",
"format": "uuid",
},
"body": {
"type": "CreateOrUpdateWidgetRequest",
"format": "",
},
"operationResponseType": "WidgetResponse",
},
"v2.DeleteWidget": {
"experienceType": {
"type": "WidgetExperienceType",
"format": "",
},
"uuid": {
"type": "string",
"format": "uuid",
},
"operationResponseType": "{}",
},
"v2.CreateWorkflow": {
"body": {
"type": "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 @@ -6357,6 +6357,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
Loading
Loading