Skip to content

Commit 436a523

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7a48a05 of spec repo
1 parent 3149b18 commit 436a523

30 files changed

+2751
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 437 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Create team connections returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_team_connections".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new
8+
9+
# there is a valid "dd_team" in the system
10+
DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"]
11+
12+
body = DatadogAPIClient::V2::TeamConnectionCreateRequest.new({
13+
data: [
14+
DatadogAPIClient::V2::TeamConnectionCreateData.new({
15+
type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION,
16+
attributes: DatadogAPIClient::V2::TeamConnectionAttributes.new({
17+
source: "github",
18+
managed_by: "datadog",
19+
}),
20+
relationships: DatadogAPIClient::V2::TeamConnectionRelationships.new({
21+
team: DatadogAPIClient::V2::TeamRef.new({
22+
data: DatadogAPIClient::V2::TeamRefData.new({
23+
id: DD_TEAM_DATA_ID,
24+
type: DatadogAPIClient::V2::TeamRefDataType::TEAM,
25+
}),
26+
}),
27+
connected_team: DatadogAPIClient::V2::ConnectedTeamRef.new({
28+
data: DatadogAPIClient::V2::ConnectedTeamRefData.new({
29+
id: "@MyGitHubAccount/my-team-name",
30+
type: DatadogAPIClient::V2::ConnectedTeamRefDataType::GITHUB_TEAM,
31+
}),
32+
}),
33+
}),
34+
}),
35+
],
36+
})
37+
p api_instance.create_team_connections(body)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Delete team connections returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_team_connections".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new
8+
9+
# there is a valid "team_connection" in the system
10+
TEAM_CONNECTION_ID = ENV["TEAM_CONNECTION_ID"]
11+
12+
body = DatadogAPIClient::V2::TeamConnectionDeleteRequest.new({
13+
data: [
14+
DatadogAPIClient::V2::TeamConnectionDeleteRequestDataItems.new({
15+
id: TEAM_CONNECTION_ID,
16+
type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION,
17+
}),
18+
],
19+
})
20+
api_instance.delete_team_connections(body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List team connections returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_team_connections".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new
8+
p api_instance.list_team_connections()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# List team connections with filters returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_team_connections".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new
8+
opts = {
9+
filter_sources: [
10+
"github",
11+
],
12+
page_size: 10,
13+
}
14+
p api_instance.list_team_connections(opts)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List team connections returns "OK" response with pagination
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_team_connections".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new
8+
api_instance.list_team_connections_with_pagination() { |item| puts item }

features/scenarios_model_mapping.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,6 +2970,22 @@
29702970
"v2.GetUserMemberships" => {
29712971
"user_uuid" => "String",
29722972
},
2973+
"v2.DeleteTeamConnections" => {
2974+
"body" => "TeamConnectionDeleteRequest",
2975+
},
2976+
"v2.ListTeamConnections" => {
2977+
"page_size" => "Integer",
2978+
"page_number" => "Integer",
2979+
"page_offset" => "Integer",
2980+
"page_limit" => "Integer",
2981+
"filter_sources" => "Array<String>",
2982+
"filter_team_ids" => "Array<String>",
2983+
"filter_connected_team_ids" => "Array<String>",
2984+
"filter_connection_ids" => "Array<String>",
2985+
},
2986+
"v2.CreateTeamConnections" => {
2987+
"body" => "TeamConnectionCreateRequest",
2988+
},
29732989
"v2.ListIncidentTeams" => {
29742990
"include" => "IncidentRelatedObject",
29752991
"page_size" => "Integer",

features/v2/given.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,13 @@
10351035
"tag": "Teams",
10361036
"operationId": "CreateTeam"
10371037
},
1038+
{
1039+
"source": "data.data[0]",
1040+
"step": "there is a valid \"team_connection\" in the system",
1041+
"key": "team_connection",
1042+
"tag": "Team Connections",
1043+
"operationId": "CreateTeamConnections"
1044+
},
10381045
{
10391046
"parameters": [
10401047
{
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
@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+
@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+
@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+
@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 there is a valid "dd_team" in the system
54+
And there is a valid "team_connection" in the system
55+
And body with value {"data": [{"id": "{{ team_connection.id }}", "type": "team_connection"}]}
56+
When the request is sent
57+
Then the response status is 204 No Content
58+
59+
@generated @skip @team:DataDog/aaa-omg
60+
Scenario: Delete team connections returns "Not Found" response
61+
Given operation "DeleteTeamConnections" enabled
62+
And new "DeleteTeamConnections" request
63+
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
64+
When the request is sent
65+
Then the response status is 404 Not Found
66+
67+
@generated @skip @team:DataDog/aaa-omg
68+
Scenario: List team connections returns "Bad Request" response
69+
Given operation "ListTeamConnections" enabled
70+
And new "ListTeamConnections" request
71+
When the request is sent
72+
Then the response status is 400 Bad Request
73+
74+
@team:DataDog/aaa-omg
75+
Scenario: List team connections returns "OK" response
76+
Given operation "ListTeamConnections" enabled
77+
And new "ListTeamConnections" request
78+
When the request is sent
79+
Then the response status is 200 OK
80+
81+
@generated @skip @team:DataDog/aaa-omg @with-pagination
82+
Scenario: List team connections returns "OK" response with pagination
83+
Given operation "ListTeamConnections" enabled
84+
And new "ListTeamConnections" request
85+
When the request with pagination is sent
86+
Then the response status is 200 OK
87+
88+
@team:DataDog/aaa-omg
89+
Scenario: List team connections with filters returns "OK" response
90+
Given operation "ListTeamConnections" enabled
91+
And new "ListTeamConnections" request
92+
And request contains "filter[sources]" parameter with value ["github"]
93+
And request contains "page[size]" parameter with value 10
94+
When the request is sent
95+
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
@@ -3853,6 +3853,25 @@
38533853
"type": "unsafe"
38543854
}
38553855
},
3856+
"DeleteTeamConnections": {
3857+
"tag": "Team Connections",
3858+
"undo": {
3859+
"type": "idempotent"
3860+
}
3861+
},
3862+
"ListTeamConnections": {
3863+
"tag": "Team Connections",
3864+
"undo": {
3865+
"type": "safe"
3866+
}
3867+
},
3868+
"CreateTeamConnections": {
3869+
"tag": "Team Connections",
3870+
"undo": {
3871+
"operationId": "DeleteTeamConnections",
3872+
"type": "unsafe"
3873+
}
3874+
},
38563875
"SyncTeams": {
38573876
"tag": "Teams",
38583877
"undo": {

0 commit comments

Comments
 (0)