Skip to content

Commit 77b9371

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0ffe1af of spec repo
1 parent eb021a1 commit 77b9371

28 files changed

Lines changed: 2898 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 594 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Create a widget returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiCreateWidgetRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
definition: {
15+
title: "My Widget",
16+
type: "bar_chart",
17+
},
18+
tags: [],
19+
},
20+
type: "widgets",
21+
},
22+
},
23+
experienceType: "ccm_reports",
24+
};
25+
26+
apiInstance
27+
.createWidget(params)
28+
.then((data: v2.WidgetResponse) => {
29+
console.log(
30+
"API called successfully. Returned data: " + JSON.stringify(data)
31+
);
32+
})
33+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete a widget returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiDeleteWidgetRequest = {
11+
experienceType: "ccm_reports",
12+
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.deleteWidget(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

examples/v2/widgets/GetWidget.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get a widget returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiGetWidgetRequest = {
11+
experienceType: "ccm_reports",
12+
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.getWidget(params)
17+
.then((data: v2.WidgetResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Search widgets returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiSearchWidgetsRequest = {
11+
experienceType: "ccm_reports",
12+
};
13+
14+
apiInstance
15+
.searchWidgets(params)
16+
.then((data: v2.WidgetListResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Update a widget returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiUpdateWidgetRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
definition: {
15+
title: "My Widget",
16+
type: "bar_chart",
17+
},
18+
tags: [],
19+
},
20+
type: "widgets",
21+
},
22+
},
23+
experienceType: "ccm_reports",
24+
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
25+
};
26+
27+
apiInstance
28+
.updateWidget(params)
29+
.then((data: v2.WidgetResponse) => {
30+
console.log(
31+
"API called successfully. Returned data: " + JSON.stringify(data)
32+
);
33+
})
34+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11744,6 +11744,93 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
1174411744
},
1174511745
"operationResponseType": "PermissionsResponse",
1174611746
},
11747+
"v2.SearchWidgets": {
11748+
"experienceType": {
11749+
"type": "WidgetExperienceType",
11750+
"format": "",
11751+
},
11752+
"filterWidgetType": {
11753+
"type": "WidgetType",
11754+
"format": "",
11755+
},
11756+
"filterCreatorHandle": {
11757+
"type": "string",
11758+
"format": "",
11759+
},
11760+
"filterIsFavorited": {
11761+
"type": "boolean",
11762+
"format": "",
11763+
},
11764+
"filterTitle": {
11765+
"type": "string",
11766+
"format": "",
11767+
},
11768+
"filterTags": {
11769+
"type": "string",
11770+
"format": "",
11771+
},
11772+
"sort": {
11773+
"type": "string",
11774+
"format": "",
11775+
},
11776+
"pageNumber": {
11777+
"type": "number",
11778+
"format": "",
11779+
},
11780+
"pageSize": {
11781+
"type": "number",
11782+
"format": "",
11783+
},
11784+
"operationResponseType": "WidgetListResponse",
11785+
},
11786+
"v2.CreateWidget": {
11787+
"experienceType": {
11788+
"type": "WidgetExperienceType",
11789+
"format": "",
11790+
},
11791+
"body": {
11792+
"type": "CreateOrUpdateWidgetRequest",
11793+
"format": "",
11794+
},
11795+
"operationResponseType": "WidgetResponse",
11796+
},
11797+
"v2.GetWidget": {
11798+
"experienceType": {
11799+
"type": "WidgetExperienceType",
11800+
"format": "",
11801+
},
11802+
"uuid": {
11803+
"type": "string",
11804+
"format": "uuid",
11805+
},
11806+
"operationResponseType": "WidgetResponse",
11807+
},
11808+
"v2.UpdateWidget": {
11809+
"experienceType": {
11810+
"type": "WidgetExperienceType",
11811+
"format": "",
11812+
},
11813+
"uuid": {
11814+
"type": "string",
11815+
"format": "uuid",
11816+
},
11817+
"body": {
11818+
"type": "CreateOrUpdateWidgetRequest",
11819+
"format": "",
11820+
},
11821+
"operationResponseType": "WidgetResponse",
11822+
},
11823+
"v2.DeleteWidget": {
11824+
"experienceType": {
11825+
"type": "WidgetExperienceType",
11826+
"format": "",
11827+
},
11828+
"uuid": {
11829+
"type": "string",
11830+
"format": "uuid",
11831+
},
11832+
"operationResponseType": "{}",
11833+
},
1174711834
"v2.CreateWorkflow": {
1174811835
"body": {
1174911836
"type": "CreateWorkflowRequest",

features/v2/undo.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6351,6 +6351,47 @@
63516351
"type": "safe"
63526352
}
63536353
},
6354+
"SearchWidgets": {
6355+
"tag": "Widgets",
6356+
"undo": {
6357+
"type": "safe"
6358+
}
6359+
},
6360+
"CreateWidget": {
6361+
"tag": "Widgets",
6362+
"undo": {
6363+
"operationId": "DeleteWidget",
6364+
"parameters": [
6365+
{
6366+
"name": "experience_type",
6367+
"source": "experience_type"
6368+
},
6369+
{
6370+
"name": "uuid",
6371+
"source": "data.id"
6372+
}
6373+
],
6374+
"type": "unsafe"
6375+
}
6376+
},
6377+
"DeleteWidget": {
6378+
"tag": "Widgets",
6379+
"undo": {
6380+
"type": "idempotent"
6381+
}
6382+
},
6383+
"GetWidget": {
6384+
"tag": "Widgets",
6385+
"undo": {
6386+
"type": "safe"
6387+
}
6388+
},
6389+
"UpdateWidget": {
6390+
"tag": "Widgets",
6391+
"undo": {
6392+
"type": "safe"
6393+
}
6394+
},
63546395
"CreateWorkflow": {
63556396
"tag": "Workflow Automation",
63566397
"undo": {

features/v2/widgets.feature

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
@endpoint(widgets) @endpoint(widgets-v2)
2+
Feature: Widgets
3+
Create, read, update, and delete saved widgets. Widgets are reusable
4+
visualization components stored independently from any dashboard or
5+
notebook, partitioned by experience type and identified by a UUID.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "Widgets" API
11+
12+
@generated @skip @team:DataDog/reporting-and-sharing
13+
Scenario: Create a widget returns "Bad Request" response
14+
Given new "CreateWidget" request
15+
And request contains "experience_type" parameter from "REPLACE.ME"
16+
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
17+
When the request is sent
18+
Then the response status is 400 Bad Request
19+
20+
@generated @skip @team:DataDog/reporting-and-sharing
21+
Scenario: Create a widget returns "OK" response
22+
Given new "CreateWidget" request
23+
And request contains "experience_type" parameter from "REPLACE.ME"
24+
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
25+
When the request is sent
26+
Then the response status is 200 OK
27+
28+
@generated @skip @team:DataDog/reporting-and-sharing
29+
Scenario: Delete a widget returns "Bad Request" response
30+
Given new "DeleteWidget" request
31+
And request contains "experience_type" parameter from "REPLACE.ME"
32+
And request contains "uuid" parameter from "REPLACE.ME"
33+
When the request is sent
34+
Then the response status is 400 Bad Request
35+
36+
@generated @skip @team:DataDog/reporting-and-sharing
37+
Scenario: Delete a widget returns "No Content" response
38+
Given new "DeleteWidget" request
39+
And request contains "experience_type" parameter from "REPLACE.ME"
40+
And request contains "uuid" parameter from "REPLACE.ME"
41+
When the request is sent
42+
Then the response status is 204 No Content
43+
44+
@generated @skip @team:DataDog/reporting-and-sharing
45+
Scenario: Delete a widget returns "Not Found" response
46+
Given new "DeleteWidget" request
47+
And request contains "experience_type" parameter from "REPLACE.ME"
48+
And request contains "uuid" parameter from "REPLACE.ME"
49+
When the request is sent
50+
Then the response status is 404 Not Found
51+
52+
@generated @skip @team:DataDog/reporting-and-sharing
53+
Scenario: Get a widget returns "Bad Request" response
54+
Given new "GetWidget" request
55+
And request contains "experience_type" parameter from "REPLACE.ME"
56+
And request contains "uuid" parameter from "REPLACE.ME"
57+
When the request is sent
58+
Then the response status is 400 Bad Request
59+
60+
@generated @skip @team:DataDog/reporting-and-sharing
61+
Scenario: Get a widget returns "Not Found" response
62+
Given new "GetWidget" request
63+
And request contains "experience_type" parameter from "REPLACE.ME"
64+
And request contains "uuid" parameter from "REPLACE.ME"
65+
When the request is sent
66+
Then the response status is 404 Not Found
67+
68+
@generated @skip @team:DataDog/reporting-and-sharing
69+
Scenario: Get a widget returns "OK" response
70+
Given new "GetWidget" request
71+
And request contains "experience_type" parameter from "REPLACE.ME"
72+
And request contains "uuid" parameter from "REPLACE.ME"
73+
When the request is sent
74+
Then the response status is 200 OK
75+
76+
@generated @skip @team:DataDog/reporting-and-sharing
77+
Scenario: Search widgets returns "Bad Request" response
78+
Given new "SearchWidgets" request
79+
And request contains "experience_type" parameter from "REPLACE.ME"
80+
When the request is sent
81+
Then the response status is 400 Bad Request
82+
83+
@generated @skip @team:DataDog/reporting-and-sharing
84+
Scenario: Search widgets returns "OK" response
85+
Given new "SearchWidgets" request
86+
And request contains "experience_type" parameter from "REPLACE.ME"
87+
When the request is sent
88+
Then the response status is 200 OK
89+
90+
@generated @skip @team:DataDog/reporting-and-sharing
91+
Scenario: Update a widget returns "Bad Request" response
92+
Given new "UpdateWidget" request
93+
And request contains "experience_type" parameter from "REPLACE.ME"
94+
And request contains "uuid" parameter from "REPLACE.ME"
95+
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
96+
When the request is sent
97+
Then the response status is 400 Bad Request
98+
99+
@generated @skip @team:DataDog/reporting-and-sharing
100+
Scenario: Update a widget returns "Not Found" response
101+
Given new "UpdateWidget" request
102+
And request contains "experience_type" parameter from "REPLACE.ME"
103+
And request contains "uuid" parameter from "REPLACE.ME"
104+
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
105+
When the request is sent
106+
Then the response status is 404 Not Found
107+
108+
@generated @skip @team:DataDog/reporting-and-sharing
109+
Scenario: Update a widget returns "OK" response
110+
Given new "UpdateWidget" request
111+
And request contains "experience_type" parameter from "REPLACE.ME"
112+
And request contains "uuid" parameter from "REPLACE.ME"
113+
And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
114+
When the request is sent
115+
Then the response status is 200 OK

0 commit comments

Comments
 (0)