Skip to content

Commit ee8a521

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2bddf8c of spec repo
1 parent f18487c commit ee8a521

44 files changed

Lines changed: 4809 additions & 63 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 1031 additions & 63 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Abort a multipart upload of a test file 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.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiAbortTestFileMultipartUploadRequest = {
11+
body: {
12+
key: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",
13+
uploadId: "upload-id-abc123",
14+
},
15+
publicId: "abc-def-123",
16+
};
17+
18+
apiInstance
19+
.abortTestFileMultipartUpload(params)
20+
.then((data: any) => {
21+
console.log(
22+
"API called successfully. Returned data: " + JSON.stringify(data)
23+
);
24+
})
25+
.catch((error: any) => console.error(error));
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Complete a multipart upload of a test file 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.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiCompleteTestFileMultipartUploadRequest = {
11+
body: {
12+
key: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",
13+
parts: [
14+
{
15+
eTag: `"d41d8cd98f00b204e9800998ecf8427e"`,
16+
partNumber: 1,
17+
},
18+
],
19+
uploadId: "upload-id-abc123",
20+
},
21+
publicId: "abc-def-123",
22+
};
23+
24+
apiInstance
25+
.completeTestFileMultipartUpload(params)
26+
.then((data: any) => {
27+
console.log(
28+
"API called successfully. Returned data: " + JSON.stringify(data)
29+
);
30+
})
31+
.catch((error: any) => console.error(error));
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Get a presigned URL for downloading a test file 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.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiGetTestFileDownloadUrlRequest = {
11+
body: {
12+
bucketKey: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",
13+
},
14+
publicId: "abc-def-123",
15+
};
16+
17+
apiInstance
18+
.getTestFileDownloadUrl(params)
19+
.then((data: v2.SyntheticsTestFileDownloadResponse) => {
20+
console.log(
21+
"API called successfully. Returned data: " + JSON.stringify(data)
22+
);
23+
})
24+
.catch((error: any) => console.error(error));
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Get presigned URLs for uploading a test file 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.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiGetTestFileMultipartPresignedUrlsRequest = {
11+
body: {
12+
bucketKeyPrefix: "api-upload-file",
13+
parts: [
14+
{
15+
md5: "1B2M2Y8AsgTpgAmY7PhCfg==",
16+
partNumber: 1,
17+
},
18+
],
19+
},
20+
publicId: "abc-def-123",
21+
};
22+
23+
apiInstance
24+
.getTestFileMultipartPresignedUrls(params)
25+
.then((data: v2.SyntheticsTestFileMultipartPresignedUrlsResponse) => {
26+
console.log(
27+
"API called successfully. Returned data: " + JSON.stringify(data)
28+
);
29+
})
30+
.catch((error: any) => console.error(error));
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));

0 commit comments

Comments
 (0)