Skip to content

Commit fd924c4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5d9a84b of spec repo
1 parent 08f243d commit fd924c4

67 files changed

Lines changed: 8019 additions & 289 deletions

File tree

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: 1526 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Create a new campaign returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createScorecardCampaign"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiCreateScorecardCampaignRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
description: "Campaign to improve security posture for Q1 2024.",
16+
dueDate: new Date(2024, 3, 31, 23, 59, 59, 0),
17+
entityScope: "kind:service AND team:platform",
18+
guidance: "Please ensure all services pass the security requirements.",
19+
key: "q1-security-2024",
20+
name: "Q1 Security Campaign",
21+
ownerId: "550e8400-e29b-41d4-a716-446655440000",
22+
ruleIds: ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"],
23+
startDate: new Date(2024, 1, 1, 0, 0, 0, 0),
24+
status: "in_progress",
25+
},
26+
type: "campaign",
27+
},
28+
},
29+
};
30+
31+
apiInstance
32+
.createScorecardCampaign(params)
33+
.then((data: v2.CampaignResponse) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.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 campaign returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteScorecardCampaign"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiDeleteScorecardCampaignRequest = {
12+
campaignId: "c10ODp0VCrrIpXmz",
13+
};
14+
15+
apiInstance
16+
.deleteScorecardCampaign(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));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete rule workflow returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteScorecardRuleWorkflow"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiDeleteScorecardRuleWorkflowRequest = {
12+
ruleId: "rule_id",
13+
};
14+
15+
apiInstance
16+
.deleteScorecardRuleWorkflow(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));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Generate campaign report returns "Accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.generateScorecardCampaignReport"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiGenerateScorecardCampaignReportRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
slack: {
16+
channelId: "C024BDQ4N",
17+
channelName: "service-scorecards",
18+
workspaceId: "T024BDQ4N",
19+
workspaceName: "datadog-workspace",
20+
},
21+
},
22+
type: "campaign-report",
23+
},
24+
},
25+
campaignId: "c10ODp0VCrrIpXmz",
26+
};
27+
28+
apiInstance
29+
.generateScorecardCampaignReport(params)
30+
.then((data: any) => {
31+
console.log(
32+
"API called successfully. Returned data: " + JSON.stringify(data)
33+
);
34+
})
35+
.catch((error: any) => console.error(error));
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Generate team-specific campaign reports returns "Accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.generateScorecardCampaignTeamReports"] =
9+
true;
10+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
11+
12+
const params: v2.ServiceScorecardsApiGenerateScorecardCampaignTeamReportsRequest =
13+
{
14+
body: {
15+
data: {
16+
attributes: {
17+
entityOwners: [
18+
{
19+
slack: {
20+
channelId: "C024BDQ4N",
21+
workspaceId: "T024BDQ4N",
22+
},
23+
teamId: "550e8400-e29b-41d4-a716-446655440000",
24+
},
25+
],
26+
},
27+
type: "campaign-team-report",
28+
},
29+
},
30+
campaignId: "c10ODp0VCrrIpXmz",
31+
};
32+
33+
apiInstance
34+
.generateScorecardCampaignTeamReports(params)
35+
.then((data: any) => {
36+
console.log(
37+
"API called successfully. Returned data: " + JSON.stringify(data)
38+
);
39+
})
40+
.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+
* Get a campaign returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getScorecardCampaign"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
const params: v2.ServiceScorecardsApiGetScorecardCampaignRequest = {
12+
campaignId: "c10ODp0VCrrIpXmz",
13+
};
14+
15+
apiInstance
16+
.getScorecardCampaign(params)
17+
.then((data: v2.CampaignResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List all campaigns returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listScorecardCampaigns"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
apiInstance
12+
.listScorecardCampaigns()
13+
.then((data: v2.ListCampaignsResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List default rules returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listScorecardDefaultRules"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
apiInstance
12+
.listScorecardDefaultRules()
13+
.then((data: v2.ListDefaultRulesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List entity facets returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listScorecardFacets"] = true;
9+
const apiInstance = new v2.ServiceScorecardsApi(configuration);
10+
11+
apiInstance
12+
.listScorecardFacets()
13+
.then((data: v2.ListFacetsResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)