Skip to content

Commit c078285

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 646862c of spec repo
1 parent e130c51 commit c078285

7 files changed

+239
-6
lines changed

examples/v2/teams/DeleteTeamMembership.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
# there is a valid "dd_team" in the system
1010
DD_TEAM_DATA_ID = environ["DD_TEAM_DATA_ID"]
1111

12+
# there is a valid "user" in the system
13+
USER_DATA_ID = environ["USER_DATA_ID"]
14+
1215
configuration = Configuration()
1316
with ApiClient(configuration) as api_client:
1417
api_instance = TeamsApi(api_client)
1518
api_instance.delete_team_membership(
1619
team_id=DD_TEAM_DATA_ID,
17-
user_id="user_id",
20+
user_id=USER_DATA_ID,
1821
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Update a team with partial update returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.teams_api import TeamsApi
8+
from datadog_api_client.v2.model.team_type import TeamType
9+
from datadog_api_client.v2.model.team_update import TeamUpdate
10+
from datadog_api_client.v2.model.team_update_attributes import TeamUpdateAttributes
11+
from datadog_api_client.v2.model.team_update_request import TeamUpdateRequest
12+
13+
# there is a valid "dd_team" in the system
14+
DD_TEAM_DATA_ATTRIBUTES_HANDLE = environ["DD_TEAM_DATA_ATTRIBUTES_HANDLE"]
15+
DD_TEAM_DATA_ATTRIBUTES_NAME = environ["DD_TEAM_DATA_ATTRIBUTES_NAME"]
16+
DD_TEAM_DATA_ID = environ["DD_TEAM_DATA_ID"]
17+
18+
body = TeamUpdateRequest(
19+
data=TeamUpdate(
20+
attributes=TeamUpdateAttributes(
21+
handle=DD_TEAM_DATA_ATTRIBUTES_HANDLE,
22+
name="Example Team updated",
23+
),
24+
type=TeamType.TEAM,
25+
),
26+
)
27+
28+
configuration = Configuration()
29+
with ApiClient(configuration) as api_client:
30+
api_instance = TeamsApi(api_client)
31+
response = api_instance.update_team(team_id=DD_TEAM_DATA_ID, body=body)
32+
33+
print(response)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-25T10:51:13.320Z
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"handle":"test-handle-789e569afaa52bde","name":"test-name-789e569afaa52bde"},"type":"team"}}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/team
11+
response:
12+
body:
13+
string: '{"data":{"id":"1d059472-0eff-4857-a6c8-5e5041448b54","type":"team","attributes":{"avatar":null,"banner":5,"created_at":"2026-03-25T10:51:13.938804+00:00","description":null,"handle":"test-handle-789e569afaa52bde","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-25T10:51:13.938804+00:00","name":"test-name-789e569afaa52bde","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/permission-settings"}}}}}'
14+
headers:
15+
content-type:
16+
- application/vnd.api+json
17+
status:
18+
code: 201
19+
message: Created
20+
- request:
21+
body: '{"data":{"attributes":{"email":"Test-Remove_a_user_from_a_team_returns_No_Content_response-1774435873@datadoghq.com","title":"user
22+
title"},"type":"users"}}'
23+
headers:
24+
accept:
25+
- application/json
26+
content-type:
27+
- application/json
28+
method: POST
29+
uri: https://api.datadoghq.com/api/v2/users
30+
response:
31+
body:
32+
string: '{"data": {"type": "users", "id": "66e25b0b-3f3b-427e-b162-e779f4535abb",
33+
"attributes": {"name": null, "handle": "test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com",
34+
"created_at": "2026-03-25T10:51:14.481612+00:00", "modified_at": "2026-03-25T10:51:14.481612+00:00",
35+
"email": "test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com",
36+
"icon": "https://secure.gravatar.com/avatar/be9f1c5abecde28b4c01cc8aa0680377?s=48&d=retro",
37+
"title": "user title", "verified": false, "service_account": false, "disabled":
38+
false, "allowed_login_methods": [], "status": "Pending", "last_login_time":
39+
null}, "relationships": {"roles": {"data": []}, "org": {"data": {"type": "orgs",
40+
"id": "4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}'
41+
headers:
42+
content-type:
43+
- application/json
44+
status:
45+
code: 201
46+
message: Created
47+
- request:
48+
body: '{"data":{"attributes":{"role":"admin"},"relationships":{"user":{"data":{"id":"66e25b0b-3f3b-427e-b162-e779f4535abb","type":"users"}}},"type":"team_memberships"}}'
49+
headers:
50+
accept:
51+
- application/json
52+
content-type:
53+
- application/json
54+
method: POST
55+
uri: https://api.datadoghq.com/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships
56+
response:
57+
body:
58+
string: '{"data":{"id":"TeamMembership-1d059472-0eff-4857-a6c8-5e5041448b54-66092046","type":"team_memberships","attributes":{"provisioned_by":null,"provisioned_by_id":"a1d5ff5a-c6dd-11f0-9cb6-06640ca27ad4","role":"admin"},"relationships":{"user":{"data":{"id":"66e25b0b-3f3b-427e-b162-e779f4535abb","type":"users"}}}},"included":[{"id":"66e25b0b-3f3b-427e-b162-e779f4535abb","type":"users","attributes":{"disabled":false,"email":"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com","handle":"test-remove_a_user_from_a_team_returns_no_content_response-1774435873@datadoghq.com","icon":"https://secure.gravatar.com/avatar/be9f1c5abecde28b4c01cc8aa0680377?d=retro\u0026s=48","name":null,"service_account":false,"status":"Pending"}}]}'
59+
headers:
60+
content-type:
61+
- application/vnd.api+json
62+
status:
63+
code: 200
64+
message: OK
65+
- request:
66+
body: null
67+
headers:
68+
accept:
69+
- '*/*'
70+
method: DELETE
71+
uri: https://api.datadoghq.com/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships/66e25b0b-3f3b-427e-b162-e779f4535abb
72+
response:
73+
body:
74+
string: ''
75+
headers: {}
76+
status:
77+
code: 204
78+
message: No Content
79+
- request:
80+
body: null
81+
headers:
82+
accept:
83+
- '*/*'
84+
method: DELETE
85+
uri: https://api.datadoghq.com/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54/memberships/66e25b0b-3f3b-427e-b162-e779f4535abb
86+
response:
87+
body:
88+
string: '{"errors":["User 66e25b0b-3f3b-427e-b162-e779f4535abb is not a member
89+
of Team 1d059472-0eff-4857-a6c8-5e5041448b54 not found"]}'
90+
headers:
91+
content-type:
92+
- application/json
93+
status:
94+
code: 404
95+
message: Not Found
96+
- request:
97+
body: null
98+
headers:
99+
accept:
100+
- '*/*'
101+
method: DELETE
102+
uri: https://api.datadoghq.com/api/v2/users/66e25b0b-3f3b-427e-b162-e779f4535abb
103+
response:
104+
body:
105+
string: ''
106+
headers: {}
107+
status:
108+
code: 204
109+
message: No Content
110+
- request:
111+
body: null
112+
headers:
113+
accept:
114+
- '*/*'
115+
method: DELETE
116+
uri: https://api.datadoghq.com/api/v2/team/1d059472-0eff-4857-a6c8-5e5041448b54
117+
response:
118+
body:
119+
string: ''
120+
headers: {}
121+
status:
122+
code: 204
123+
message: No Content
124+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-25T11:58:33.497Z
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"handle":"test-handle-1aa8ea88c040ca48","name":"test-name-1aa8ea88c040ca48"},"type":"team"}}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/team
11+
response:
12+
body:
13+
string: '{"data":{"id":"5f6e649c-340c-46e7-96bc-bc5ececc7839","type":"team","attributes":{"avatar":null,"banner":15,"created_at":"2026-03-25T11:58:34.181069+00:00","description":null,"handle":"test-handle-1aa8ea88c040ca48","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-25T11:58:34.181069+00:00","name":"test-name-1aa8ea88c040ca48","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/permission-settings"}}}}}'
14+
headers:
15+
content-type:
16+
- application/vnd.api+json
17+
status:
18+
code: 201
19+
message: Created
20+
- request:
21+
body: '{"data":{"attributes":{"handle":"test-handle-1aa8ea88c040ca48","name":"test-name-1aa8ea88c040ca48
22+
updated"},"type":"team"}}'
23+
headers:
24+
accept:
25+
- application/json
26+
content-type:
27+
- application/json
28+
method: PATCH
29+
uri: https://api.datadoghq.com/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839
30+
response:
31+
body:
32+
string: '{"data":{"type":"team","id":"5f6e649c-340c-46e7-96bc-bc5ececc7839","attributes":{"name":"test-name-1aa8ea88c040ca48
33+
updated","handle":"test-handle-1aa8ea88c040ca48","summary":null,"description":null,"avatar":null,"banner":15,"visible_modules":null,"hidden_modules":null,"created_at":"2026-03-25T11:58:34.181069+00:00","modified_at":"2026-03-25T11:58:34.727617+00:00","user_count":0,"link_count":0,"is_managed":false},"relationships":{"team_links":{"links":{"related":"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839/permission-settings"}}}}}
34+
35+
'
36+
headers:
37+
content-type:
38+
- application/json
39+
status:
40+
code: 200
41+
message: OK
42+
- request:
43+
body: null
44+
headers:
45+
accept:
46+
- '*/*'
47+
method: DELETE
48+
uri: https://api.datadoghq.com/api/v2/team/5f6e649c-340c-46e7-96bc-bc5ececc7839
49+
response:
50+
body:
51+
string: ''
52+
headers: {}
53+
status:
54+
code: 204
55+
message: No Content
56+
version: 1

tests/v2/features/teams.feature

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,14 @@ Feature: Teams
573573
When the request is sent
574574
Then the response status is 404 API error response.
575575

576-
@skip @team:DataDog/aaa-omg
576+
@team:DataDog/aaa-omg
577577
Scenario: Remove a user from a team returns "No Content" response
578578
Given new "DeleteTeamMembership" request
579579
And there is a valid "dd_team" in the system
580+
And there is a valid "user" in the system
581+
And there is a valid "team_membership" in the system
580582
And request contains "team_id" parameter from "dd_team.data.id"
581-
And request contains "user_id" parameter from "REPLACE.ME"
583+
And request contains "user_id" parameter from "user.data.id"
582584
When the request is sent
583585
Then the response status is 204 No Content
584586

@@ -607,11 +609,13 @@ Feature: Teams
607609
And the response "data.attributes.label" is equal to "New Label"
608610
And the response "data.attributes.url" is equal to "https://example.com"
609611

610-
@generated @skip @team:DataDog/aaa-omg
612+
@skip @team:DataDog/aaa-omg
611613
Scenario: Update a team returns "API error response." response
612614
Given new "UpdateTeam" request
613-
And request contains "team_id" parameter from "REPLACE.ME"
614-
And body with value {"data": {"attributes": {"avatar": "\ud83e\udd51", "banner": null, "handle": "example-team", "hidden_modules": [], "name": "Example Team", "visible_modules": []}, "relationships": {"team_links": {"data": [{"id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001", "type": "team_links"}], "links": {"related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"}}}, "type": "team"}}
615+
And there is a valid "dd_team" in the system
616+
And there is a valid "dd_team_2" in the system
617+
And request contains "team_id" parameter from "dd_team.data.id"
618+
And body with value {"data": {"attributes": {"handle": "{{dd_team_2.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}}"}, "type": "team"}}
615619
When the request is sent
616620
Then the response status is 409 API error response.
617621

@@ -631,6 +635,17 @@ Feature: Teams
631635
And the response "data.attributes.hidden_modules" is equal to ["m3"]
632636
And the response "data.attributes.visible_modules" is equal to ["m1", "m2"]
633637

638+
@team:DataDog/aaa-omg
639+
Scenario: Update a team with partial update returns "OK" response
640+
Given new "UpdateTeam" request
641+
And there is a valid "dd_team" in the system
642+
And request contains "team_id" parameter from "dd_team.data.id"
643+
And body with value {"data": {"attributes": {"handle": "{{dd_team.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}} updated"}, "type": "team"}}
644+
When the request is sent
645+
Then the response status is 200 OK
646+
And the response "data.attributes.name" is equal to "{{dd_team.data.attributes.name}} updated"
647+
And the response "data.attributes.handle" is equal to "{{dd_team.data.attributes.handle}}"
648+
634649
@team:DataDog/aaa-omg
635650
Scenario: Update a user's membership attributes on a team returns "API error response." response
636651
Given new "UpdateTeamMembership" request

0 commit comments

Comments
 (0)