Skip to content

Commit 2b59f99

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 061e4ab of spec repo
1 parent 1173408 commit 2b59f99

33 files changed

+2475
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Create team connections returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createTeamConnections"] = true;
9+
const apiInstance = new v2.TeamConnectionsApi(configuration);
10+
11+
// there is a valid "dd_team" in the system
12+
const DD_TEAM_DATA_ID = process.env.DD_TEAM_DATA_ID as string;
13+
14+
const params: v2.TeamConnectionsApiCreateTeamConnectionsRequest = {
15+
body: {
16+
data: [
17+
{
18+
type: "team_connection",
19+
attributes: {
20+
source: "github",
21+
managedBy: "datadog",
22+
},
23+
relationships: {
24+
team: {
25+
data: {
26+
id: DD_TEAM_DATA_ID,
27+
type: "team",
28+
},
29+
},
30+
connectedTeam: {
31+
data: {
32+
id: "@MyGitHubAccount/my-team-name",
33+
type: "github_team",
34+
},
35+
},
36+
},
37+
},
38+
],
39+
},
40+
};
41+
42+
apiInstance
43+
.createTeamConnections(params)
44+
.then((data: v2.TeamConnectionsResponse) => {
45+
console.log(
46+
"API called successfully. Returned data: " + JSON.stringify(data)
47+
);
48+
})
49+
.catch((error: any) => console.error(error));
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Delete team connections 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.deleteTeamConnections"] = true;
9+
const apiInstance = new v2.TeamConnectionsApi(configuration);
10+
11+
const params: v2.TeamConnectionsApiDeleteTeamConnectionsRequest = {
12+
body: {
13+
data: [
14+
{
15+
id: "12345678-1234-5678-9abc-123456789012",
16+
type: "team_connection",
17+
},
18+
],
19+
},
20+
};
21+
22+
apiInstance
23+
.deleteTeamConnections(params)
24+
.then((data: any) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.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 team connections returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listTeamConnections"] = true;
9+
const apiInstance = new v2.TeamConnectionsApi(configuration);
10+
11+
apiInstance
12+
.listTeamConnections()
13+
.then((data: v2.TeamConnectionsResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* List team connections with filters returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listTeamConnections"] = true;
9+
const apiInstance = new v2.TeamConnectionsApi(configuration);
10+
11+
const params: v2.TeamConnectionsApiListTeamConnectionsRequest = {
12+
pageSize: 10,
13+
filterSources: ["github"],
14+
};
15+
16+
apiInstance
17+
.listTeamConnections(params)
18+
.then((data: v2.TeamConnectionsResponse) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* List team connections returns "OK" response with pagination
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listTeamConnections"] = true;
9+
const apiInstance = new v2.TeamConnectionsApi(configuration);
10+
11+
(async () => {
12+
try {
13+
for await (const item of apiInstance.listTeamConnectionsWithPagination()) {
14+
console.log(item);
15+
}
16+
} catch (error) {
17+
console.error(error);
18+
}
19+
})();

features/support/scenarios_model_mapping.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8900,6 +8900,55 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
89008900
},
89018901
"operationResponseType": "UserTeamsResponse",
89028902
},
8903+
"v2.ListTeamConnections": {
8904+
"pageSize": {
8905+
"type": "number",
8906+
"format": "int64",
8907+
},
8908+
"pageNumber": {
8909+
"type": "number",
8910+
"format": "int64",
8911+
},
8912+
"pageOffset": {
8913+
"type": "number",
8914+
"format": "int64",
8915+
},
8916+
"pageLimit": {
8917+
"type": "number",
8918+
"format": "int64",
8919+
},
8920+
"filterSources": {
8921+
"type": "Array<string>",
8922+
"format": "",
8923+
},
8924+
"filterTeamIds": {
8925+
"type": "Array<string>",
8926+
"format": "",
8927+
},
8928+
"filterConnectedTeamIds": {
8929+
"type": "Array<string>",
8930+
"format": "",
8931+
},
8932+
"filterConnectionIds": {
8933+
"type": "Array<string>",
8934+
"format": "",
8935+
},
8936+
"operationResponseType": "TeamConnectionsResponse",
8937+
},
8938+
"v2.CreateTeamConnections": {
8939+
"body": {
8940+
"type": "TeamConnectionCreateRequest",
8941+
"format": "",
8942+
},
8943+
"operationResponseType": "TeamConnectionsResponse",
8944+
},
8945+
"v2.DeleteTeamConnections": {
8946+
"body": {
8947+
"type": "TeamConnectionDeleteRequest",
8948+
"format": "",
8949+
},
8950+
"operationResponseType": "{}",
8951+
},
89038952
"v2.ListIncidentTeams": {
89048953
"include": {
89058954
"type": "IncidentRelatedObject",

features/v2/given.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,13 @@
11411141
"tag": "Teams",
11421142
"operationId": "CreateTeam"
11431143
},
1144+
{
1145+
"source": "data.data[0]",
1146+
"step": "there is a valid \"team_connection\" in the system",
1147+
"key": "team_connection",
1148+
"tag": "Team Connections",
1149+
"operationId": "CreateTeamConnections"
1150+
},
11441151
{
11451152
"parameters": [
11461153
{
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
@endpoint(team-connections) @endpoint(team-connections-v2)
2+
Feature: Team Connections
3+
View and manage relationships between Datadog teams and teams from
4+
external sources, such as GitHub.
5+
6+
Background:
7+
Given a valid "apiKeyAuth" key in the system
8+
And a valid "appKeyAuth" key in the system
9+
And an instance of "TeamConnections" API
10+
11+
@skip @team:DataDog/aaa-omg
12+
Scenario: Create team connections returns "Bad Request" response
13+
Given operation "CreateTeamConnections" enabled
14+
And new "CreateTeamConnections" request
15+
And body with value {"data": [{"attributes": {"source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"type": "team"}}}, "type": "team_connection"}]}
16+
When the request is sent
17+
Then the response status is 400 Bad Request
18+
19+
@generated @skip @team:DataDog/aaa-omg
20+
Scenario: Create team connections returns "Conflict" response
21+
Given operation "CreateTeamConnections" enabled
22+
And new "CreateTeamConnections" request
23+
And body with value {"data": [{"attributes": {"managed_by": "github_sync", "source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"id": "87654321-4321-8765-dcba-210987654321", "type": "team"}}}, "type": "team_connection"}]}
24+
When the request is sent
25+
Then the response status is 409 Conflict
26+
27+
@skip @team:DataDog/aaa-omg
28+
Scenario: Create team connections returns "Created" response
29+
Given operation "CreateTeamConnections" enabled
30+
And new "CreateTeamConnections" request
31+
And there is a valid "dd_team" in the system
32+
And body with value {"data": [{"type": "team_connection", "attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}, "connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}}}]}
33+
When the request is sent
34+
Then the response status is 201 Created
35+
And the response "data.data[0].attributes.source" is equal to "github"
36+
And the response "data.data[0].attributes.managed_by" is equal to "datadog"
37+
And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}"
38+
And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name"
39+
And the response "data.data[0].type" is equal to "team_connection"
40+
41+
@skip @team:DataDog/aaa-omg
42+
Scenario: Delete team connections returns "Bad Request" response
43+
Given operation "DeleteTeamConnections" enabled
44+
And new "DeleteTeamConnections" request
45+
And body with value {"data": [{"type": "team_connection"}]}
46+
When the request is sent
47+
Then the response status is 400 Bad Request
48+
49+
@generated @skip @team:DataDog/aaa-omg
50+
Scenario: Delete team connections returns "No Content" response
51+
Given operation "DeleteTeamConnections" enabled
52+
And new "DeleteTeamConnections" request
53+
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
54+
When the request is sent
55+
Then the response status is 204 No Content
56+
57+
@generated @skip @team:DataDog/aaa-omg
58+
Scenario: Delete team connections returns "Not Found" response
59+
Given operation "DeleteTeamConnections" enabled
60+
And new "DeleteTeamConnections" request
61+
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
62+
When the request is sent
63+
Then the response status is 404 Not Found
64+
65+
@generated @skip @team:DataDog/aaa-omg
66+
Scenario: List team connections returns "Bad Request" response
67+
Given operation "ListTeamConnections" enabled
68+
And new "ListTeamConnections" request
69+
When the request is sent
70+
Then the response status is 400 Bad Request
71+
72+
@skip @team:DataDog/aaa-omg
73+
Scenario: List team connections returns "OK" response
74+
Given operation "ListTeamConnections" enabled
75+
And new "ListTeamConnections" request
76+
When the request is sent
77+
Then the response status is 200 OK
78+
79+
@generated @skip @team:DataDog/aaa-omg @with-pagination
80+
Scenario: List team connections returns "OK" response with pagination
81+
Given operation "ListTeamConnections" enabled
82+
And new "ListTeamConnections" request
83+
When the request with pagination is sent
84+
Then the response status is 200 OK
85+
86+
@skip @team:DataDog/aaa-omg
87+
Scenario: List team connections with filters returns "OK" response
88+
Given operation "ListTeamConnections" enabled
89+
And new "ListTeamConnections" request
90+
And request contains "filter[sources]" parameter with value ["github"]
91+
And request contains "page[size]" parameter with value 10
92+
When the request is sent
93+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4268,6 +4268,25 @@
42684268
"type": "unsafe"
42694269
}
42704270
},
4271+
"DeleteTeamConnections": {
4272+
"tag": "Team Connections",
4273+
"undo": {
4274+
"type": "idempotent"
4275+
}
4276+
},
4277+
"ListTeamConnections": {
4278+
"tag": "Team Connections",
4279+
"undo": {
4280+
"type": "safe"
4281+
}
4282+
},
4283+
"CreateTeamConnections": {
4284+
"tag": "Team Connections",
4285+
"undo": {
4286+
"operationId": "DeleteTeamConnections",
4287+
"type": "unsafe"
4288+
}
4289+
},
42714290
"SyncTeams": {
42724291
"tag": "Teams",
42734292
"undo": {

0 commit comments

Comments
 (0)