Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
383 changes: 383 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,13 @@
"tag": "Teams",
"operationId": "CreateTeam"
},
{
"source": "data.data[0]",
"step": "there is a valid \"team_connection\" in the system",
"key": "team_connection",
"tag": "Team Connections",
"operationId": "CreateTeamConnections"
},
{
"parameters": [
{
Expand Down
93 changes: 93 additions & 0 deletions features/v2/team_connections.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
@endpoint(team-connections) @endpoint(team-connections-v2)
Feature: Team Connections
View and manage relationships between Datadog teams and teams from
external sources, such as GitHub.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "TeamConnections" API

@skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Bad Request" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
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"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Conflict" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
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"}]}
When the request is sent
Then the response status is 409 Conflict

@skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Created" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
And there is a valid "dd_team" in the system
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"}}}}]}
When the request is sent
Then the response status is 201 Created
And the response "data.data[0].attributes.source" is equal to "github"
And the response "data.data[0].attributes.managed_by" is equal to "datadog"
And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}"
And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name"
And the response "data.data[0].type" is equal to "team_connection"

@skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "Bad Request" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"type": "team_connection"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "No Content" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "Not Found" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/aaa-omg
Scenario: List team connections returns "Bad Request" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/aaa-omg
Scenario: List team connections returns "OK" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-omg @with-pagination
Scenario: List team connections returns "OK" response with pagination
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request with pagination is sent
Then the response status is 200 OK

@skip @team:DataDog/aaa-omg
Scenario: List team connections with filters returns "OK" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
And request contains "filter[sources]" parameter with value ["github"]
And request contains "page[size]" parameter with value 10
When the request is sent
Then the response status is 200 OK
19 changes: 19 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4268,6 +4268,25 @@
"type": "unsafe"
}
},
"DeleteTeamConnections": {
"tag": "Team Connections",
"undo": {
"type": "idempotent"
}
},
"ListTeamConnections": {
"tag": "Team Connections",
"undo": {
"type": "safe"
}
},
"CreateTeamConnections": {
"tag": "Team Connections",
"undo": {
"operationId": "DeleteTeamConnections",
"type": "unsafe"
}
},
"SyncTeams": {
"tag": "Teams",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ apiInstance
| Static Analysis | @datadog/datadog-api-client-static-analysis | [README.md](../../services/static-analysis/README.md) |
| Synthetics | @datadog/datadog-api-client-synthetics | [README.md](../../services/synthetics/README.md) |
| Tags | @datadog/datadog-api-client-tags | [README.md](../../services/tags/README.md) |
| Team Connections | @datadog/datadog-api-client-team-connections | [README.md](../../services/team-connections/README.md) |
| Teams | @datadog/datadog-api-client-teams | [README.md](../../services/teams/README.md) |
| Test Optimization | @datadog/datadog-api-client-test-optimization | [README.md](../../services/test-optimization/README.md) |
| Usage Metering | @datadog/datadog-api-client-usage-metering | [README.md](../../services/usage-metering/README.md) |
Expand Down
49 changes: 49 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8910,6 +8910,55 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "UserTeamsResponse",
},
"TeamConnectionsApi.V2.ListTeamConnections": {
pageSize: {
type: "number",
format: "int64",
},
pageNumber: {
type: "number",
format: "int64",
},
pageOffset: {
type: "number",
format: "int64",
},
pageLimit: {
type: "number",
format: "int64",
},
filterSources: {
type: "Array<string>",
format: "",
},
filterTeamIds: {
type: "Array<string>",
format: "",
},
filterConnectedTeamIds: {
type: "Array<string>",
format: "",
},
filterConnectionIds: {
type: "Array<string>",
format: "",
},
operationResponseType: "TeamConnectionsResponse",
},
"TeamConnectionsApi.V2.CreateTeamConnections": {
body: {
type: "TeamConnectionCreateRequest",
format: "",
},
operationResponseType: "TeamConnectionsResponse",
},
"TeamConnectionsApi.V2.DeleteTeamConnections": {
body: {
type: "TeamConnectionDeleteRequest",
format: "",
},
operationResponseType: "{}",
},
"IncidentTeamsApi.V2.ListIncidentTeams": {
include: {
type: "IncidentRelatedObject",
Expand Down
1 change: 1 addition & 0 deletions services/team_connections/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
44 changes: 44 additions & 0 deletions services/team_connections/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# @datadog/datadog-api-client-team-connections

## Description

View and manage relationships between Datadog teams and teams from external sources, such as GitHub.

## Navigation

- [Installation](#installation)
- [Getting Started](#getting-started)

## Installation

```sh
# NPM
npm install @datadog/datadog-api-client-team-connections
# Yarn
yarn add @datadog/datadog-api-client-team-connections
```

## Getting Started
```ts
import { createConfiguration } from "@datadog/datadog-api-client";
import { TeamConnectionsApiV2 } from "@datadog/datadog-api-client-team-connections";
import { v2 } from "@datadog/datadog-api-client-team-connections";

const configuration = createConfiguration();
// Enable unstable operations
const configurationOpts = {
unstableOperations: {
"TeamConnectionsApi.v2.listTeamConnections": true
}
}

const configuration = createConfiguration(configurationOpts);
const apiInstance = new TeamConnectionsApiV2(configuration);
const params = {/* parameters */};

apiInstance.listTeamConnections(params).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}).catch((error) => {
console.error("Error calling API: " + error);
});
```
43 changes: 43 additions & 0 deletions services/team_connections/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@datadog/datadog-api-client-team-connections",
"description": "",
"author": "",
"keywords": [
"api",
"fetch",
"typescript"
],
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/DataDog/datadog-api-client-typescript.git",
"directory": "services/team-connections"
},
"files": [
"dist/**/*"
],
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"prepack": "yarn workspace @datadog/datadog-api-client build && yarn build",
"build": "yarn generate-version-files && tsc",
"generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts"
},
"dependencies": {
"@datadog/datadog-api-client": "^2.0.0-beta.0"
},
"devDependencies": {
"typescript": "5.8.3"
},
"engines": {
"node": ">=18.0.0"
},
"version": "0.0.1",
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions services/team_connections/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * as v2 from "./v2";

export { TeamConnectionsApi as TeamConnectionsApiV2 } from "./v2/TeamConnectionsApi";
Loading