Skip to content

Commit 72ca596

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 061e4ab of spec repo
1 parent 87dea61 commit 72ca596

32 files changed

+3108
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 429 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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
body = DatadogAPIClient::V2::TeamConnectionDeleteRequest.new({
10+
data: [
11+
DatadogAPIClient::V2::TeamConnectionDeleteRequestDataItem.new({
12+
id: "12345678-1234-5678-9abc-123456789012",
13+
type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION,
14+
}),
15+
],
16+
})
17+
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
@@ -3150,6 +3150,22 @@
31503150
"v2.GetUserMemberships" => {
31513151
"user_uuid" => "String",
31523152
},
3153+
"v2.DeleteTeamConnections" => {
3154+
"body" => "TeamConnectionDeleteRequest",
3155+
},
3156+
"v2.ListTeamConnections" => {
3157+
"page_size" => "Integer",
3158+
"page_number" => "Integer",
3159+
"page_offset" => "Integer",
3160+
"page_limit" => "Integer",
3161+
"filter_sources" => "Array<String>",
3162+
"filter_team_ids" => "Array<String>",
3163+
"filter_connected_team_ids" => "Array<String>",
3164+
"filter_connection_ids" => "Array<String>",
3165+
},
3166+
"v2.CreateTeamConnections" => {
3167+
"body" => "TeamConnectionCreateRequest",
3168+
},
31533169
"v2.ListIncidentTeams" => {
31543170
"include" => "IncidentRelatedObject",
31553171
"page_size" => "Integer",

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)