Skip to content

Commit f4e933f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fcc78bf of spec repo
1 parent e2642e4 commit f4e933f

33 files changed

+2254
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 383 additions & 0 deletions
Large diffs are not rendered by default.

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": {

packages/datadog-api-client/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ apiInstance
437437
| Static Analysis | @datadog/datadog-api-client-static-analysis | [README.md](../../services/static-analysis/README.md) |
438438
| Synthetics | @datadog/datadog-api-client-synthetics | [README.md](../../services/synthetics/README.md) |
439439
| Tags | @datadog/datadog-api-client-tags | [README.md](../../services/tags/README.md) |
440+
| Team Connections | @datadog/datadog-api-client-team-connections | [README.md](../../services/team-connections/README.md) |
440441
| Teams | @datadog/datadog-api-client-teams | [README.md](../../services/teams/README.md) |
441442
| Test Optimization | @datadog/datadog-api-client-test-optimization | [README.md](../../services/test-optimization/README.md) |
442443
| Usage Metering | @datadog/datadog-api-client-usage-metering | [README.md](../../services/usage-metering/README.md) |

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8910,6 +8910,55 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
89108910
},
89118911
operationResponseType: "UserTeamsResponse",
89128912
},
8913+
"TeamConnectionsApi.V2.ListTeamConnections": {
8914+
pageSize: {
8915+
type: "number",
8916+
format: "int64",
8917+
},
8918+
pageNumber: {
8919+
type: "number",
8920+
format: "int64",
8921+
},
8922+
pageOffset: {
8923+
type: "number",
8924+
format: "int64",
8925+
},
8926+
pageLimit: {
8927+
type: "number",
8928+
format: "int64",
8929+
},
8930+
filterSources: {
8931+
type: "Array<string>",
8932+
format: "",
8933+
},
8934+
filterTeamIds: {
8935+
type: "Array<string>",
8936+
format: "",
8937+
},
8938+
filterConnectedTeamIds: {
8939+
type: "Array<string>",
8940+
format: "",
8941+
},
8942+
filterConnectionIds: {
8943+
type: "Array<string>",
8944+
format: "",
8945+
},
8946+
operationResponseType: "TeamConnectionsResponse",
8947+
},
8948+
"TeamConnectionsApi.V2.CreateTeamConnections": {
8949+
body: {
8950+
type: "TeamConnectionCreateRequest",
8951+
format: "",
8952+
},
8953+
operationResponseType: "TeamConnectionsResponse",
8954+
},
8955+
"TeamConnectionsApi.V2.DeleteTeamConnections": {
8956+
body: {
8957+
type: "TeamConnectionDeleteRequest",
8958+
format: "",
8959+
},
8960+
operationResponseType: "{}",
8961+
},
89138962
"IncidentTeamsApi.V2.ListIncidentTeams": {
89148963
include: {
89158964
type: "IncidentRelatedObject",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# @datadog/datadog-api-client-team-connections
2+
3+
## Description
4+
5+
View and manage relationships between Datadog teams and teams from external sources, such as GitHub.
6+
7+
## Navigation
8+
9+
- [Installation](#installation)
10+
- [Getting Started](#getting-started)
11+
12+
## Installation
13+
14+
```sh
15+
# NPM
16+
npm install @datadog/datadog-api-client-team-connections
17+
# Yarn
18+
yarn add @datadog/datadog-api-client-team-connections
19+
```
20+
21+
## Getting Started
22+
```ts
23+
import { createConfiguration } from "@datadog/datadog-api-client";
24+
import { TeamConnectionsApiV2 } from "@datadog/datadog-api-client-team-connections";
25+
import { v2 } from "@datadog/datadog-api-client-team-connections";
26+
27+
const configuration = createConfiguration();
28+
// Enable unstable operations
29+
const configurationOpts = {
30+
unstableOperations: {
31+
"TeamConnectionsApi.v2.listTeamConnections": true
32+
}
33+
}
34+
35+
const configuration = createConfiguration(configurationOpts);
36+
const apiInstance = new TeamConnectionsApiV2(configuration);
37+
const params = {/* parameters */};
38+
39+
apiInstance.listTeamConnections(params).then((data) => {
40+
console.log("API called successfully. Returned data: " + JSON.stringify(data));
41+
}).catch((error) => {
42+
console.error("Error calling API: " + error);
43+
});
44+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@datadog/datadog-api-client-team-connections",
3+
"description": "",
4+
"author": "",
5+
"keywords": [
6+
"api",
7+
"fetch",
8+
"typescript"
9+
],
10+
"license": "Apache-2.0",
11+
"licenses": [
12+
{
13+
"type": "Apache-2.0",
14+
"url": "http://www.apache.org/licenses/LICENSE-2.0"
15+
}
16+
],
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/DataDog/datadog-api-client-typescript.git",
20+
"directory": "services/team-connections"
21+
},
22+
"files": [
23+
"dist/**/*"
24+
],
25+
"main": "./dist/index.js",
26+
"typings": "./dist/index.d.ts",
27+
"scripts": {
28+
"prepack": "yarn workspace @datadog/datadog-api-client build && yarn build",
29+
"build": "yarn generate-version-files && tsc",
30+
"generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts"
31+
},
32+
"dependencies": {
33+
"@datadog/datadog-api-client": "^2.0.0-beta.0"
34+
},
35+
"devDependencies": {
36+
"typescript": "5.8.3"
37+
},
38+
"engines": {
39+
"node": ">=18.0.0"
40+
},
41+
"version": "0.0.1",
42+
"packageManager": "[email protected]"
43+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * as v2 from "./v2";
2+
3+
export { TeamConnectionsApi as TeamConnectionsApiV2 } from "./v2/TeamConnectionsApi";

0 commit comments

Comments
 (0)