Skip to content

Commit 096a46d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add API spec for team hierarchy APIs (#671)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d8fcb2c commit 096a46d

15 files changed

+1254
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-16 16:45:05.509389",
8-
"spec_repo_commit": "6e1eb13f"
7+
"regenerated": "2025-06-17 14:56:00.539225",
8+
"spec_repo_commit": "b359fdcc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-16 16:45:05.525751",
13-
"spec_repo_commit": "6e1eb13f"
12+
"regenerated": "2025-06-17 14:56:00.555372",
13+
"spec_repo_commit": "b359fdcc"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,14 @@ components:
22002200
type: string
22012201
x-enum-varnames:
22022202
- BILLING_DIMENSIONS
2203+
AddMemberTeamRequest:
2204+
description: Request to add a member team to super team's hierarchy
2205+
properties:
2206+
data:
2207+
$ref: '#/components/schemas/MemberTeam'
2208+
required:
2209+
- data
2210+
type: object
22032211
Advisory:
22042212
description: Advisory.
22052213
properties:
@@ -21300,6 +21308,28 @@ components:
2130021308
- ms_channel_name
2130121309
- redirect_url
2130221310
type: object
21311+
MemberTeam:
21312+
description: A member team
21313+
properties:
21314+
id:
21315+
description: The member team's identifier
21316+
example: aeadc05e-98a8-11ec-ac2c-da7ad0900001
21317+
type: string
21318+
type:
21319+
$ref: '#/components/schemas/MemberTeamType'
21320+
required:
21321+
- id
21322+
- type
21323+
type: object
21324+
MemberTeamType:
21325+
default: member_teams
21326+
description: Member team type
21327+
enum:
21328+
- member_teams
21329+
example: member_teams
21330+
type: string
21331+
x-enum-varnames:
21332+
- MEMBER_TEAMS
2130321333
Metadata:
2130421334
description: The metadata related to this request.
2130521335
properties:
@@ -60442,6 +60472,156 @@ paths:
6044260472
permissions:
6044360473
- teams_read
6044460474
- teams_manage
60475+
/api/v2/team/{super_team_id}/member_teams:
60476+
get:
60477+
description: Get all member teams.
60478+
operationId: ListMemberTeams
60479+
parameters:
60480+
- description: None
60481+
in: path
60482+
name: super_team_id
60483+
required: true
60484+
schema:
60485+
type: string
60486+
- $ref: '#/components/parameters/PageSize'
60487+
- $ref: '#/components/parameters/PageNumber'
60488+
- description: List of fields that need to be fetched.
60489+
explode: false
60490+
in: query
60491+
name: fields[team]
60492+
required: false
60493+
schema:
60494+
items:
60495+
$ref: '#/components/schemas/TeamsField'
60496+
type: array
60497+
responses:
60498+
'200':
60499+
content:
60500+
application/json:
60501+
schema:
60502+
$ref: '#/components/schemas/TeamsResponse'
60503+
description: OK
60504+
'403':
60505+
$ref: '#/components/responses/ForbiddenResponse'
60506+
'404':
60507+
content:
60508+
application/json:
60509+
schema:
60510+
$ref: '#/components/schemas/APIErrorResponse'
60511+
description: API error response.
60512+
'429':
60513+
$ref: '#/components/responses/TooManyRequestsResponse'
60514+
security:
60515+
- apiKeyAuth: []
60516+
appKeyAuth: []
60517+
- AuthZ:
60518+
- teams_read
60519+
summary: Get all member teams
60520+
tags:
60521+
- Teams
60522+
x-pagination:
60523+
limitParam: page[size]
60524+
pageParam: page[number]
60525+
resultsPath: data
60526+
x-permission:
60527+
operator: OR
60528+
permissions:
60529+
- teams_read
60530+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
60531+
60532+
contact [Datadog support](https://docs.datadoghq.com/help/).'
60533+
post:
60534+
description: 'Add a member team.
60535+
60536+
Adds the team given by the `id` in the body as a member team of the super
60537+
team.'
60538+
operationId: AddMemberTeam
60539+
parameters:
60540+
- description: None
60541+
in: path
60542+
name: super_team_id
60543+
required: true
60544+
schema:
60545+
type: string
60546+
requestBody:
60547+
content:
60548+
application/json:
60549+
schema:
60550+
$ref: '#/components/schemas/AddMemberTeamRequest'
60551+
required: true
60552+
responses:
60553+
'204':
60554+
description: Added
60555+
'403':
60556+
$ref: '#/components/responses/ForbiddenResponse'
60557+
'409':
60558+
content:
60559+
application/json:
60560+
schema:
60561+
$ref: '#/components/schemas/APIErrorResponse'
60562+
description: API error response.
60563+
'429':
60564+
$ref: '#/components/responses/TooManyRequestsResponse'
60565+
security:
60566+
- apiKeyAuth: []
60567+
appKeyAuth: []
60568+
- AuthZ:
60569+
- teams_read
60570+
summary: Add a member team
60571+
tags:
60572+
- Teams
60573+
x-permission:
60574+
operator: OR
60575+
permissions:
60576+
- teams_read
60577+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
60578+
60579+
contact [Datadog support](https://docs.datadoghq.com/help/).'
60580+
/api/v2/team/{super_team_id}/member_teams/{member_team_id}:
60581+
delete:
60582+
description: Remove a super team's member team identified by `member_team_id`.
60583+
operationId: RemoveMemberTeam
60584+
parameters:
60585+
- description: None
60586+
in: path
60587+
name: super_team_id
60588+
required: true
60589+
schema:
60590+
type: string
60591+
- description: None
60592+
in: path
60593+
name: member_team_id
60594+
required: true
60595+
schema:
60596+
type: string
60597+
responses:
60598+
'204':
60599+
description: No Content
60600+
'403':
60601+
$ref: '#/components/responses/ForbiddenResponse'
60602+
'404':
60603+
content:
60604+
application/json:
60605+
schema:
60606+
$ref: '#/components/schemas/APIErrorResponse'
60607+
description: API error response.
60608+
'429':
60609+
$ref: '#/components/responses/TooManyRequestsResponse'
60610+
security:
60611+
- apiKeyAuth: []
60612+
appKeyAuth: []
60613+
- AuthZ:
60614+
- teams_read
60615+
summary: Remove a member team
60616+
tags:
60617+
- Teams
60618+
x-permission:
60619+
operator: OR
60620+
permissions:
60621+
- teams_read
60622+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
60623+
60624+
contact [Datadog support](https://docs.datadoghq.com/help/).'
6044560625
/api/v2/team/{team_id}:
6044660626
delete:
6044760627
description: Remove a team using the team's `id`.

examples/v2_teams_AddMemberTeam.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Add a member team returns "Added" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_teams::TeamsAPI;
4+
use datadog_api_client::datadogV2::model::AddMemberTeamRequest;
5+
use datadog_api_client::datadogV2::model::MemberTeam;
6+
use datadog_api_client::datadogV2::model::MemberTeamType;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let body = AddMemberTeamRequest::new(MemberTeam::new(
11+
"aeadc05e-98a8-11ec-ac2c-da7ad0900001".to_string(),
12+
MemberTeamType::MEMBER_TEAMS,
13+
));
14+
let mut configuration = datadog::Configuration::new();
15+
configuration.set_unstable_operation_enabled("v2.AddMemberTeam", true);
16+
let api = TeamsAPI::with_config(configuration);
17+
let resp = api.add_member_team("super_team_id".to_string(), body).await;
18+
if let Ok(value) = resp {
19+
println!("{:#?}", value);
20+
} else {
21+
println!("{:#?}", resp.unwrap_err());
22+
}
23+
}

examples/v2_teams_ListMemberTeams.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Get all member teams returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_teams::ListMemberTeamsOptionalParams;
4+
use datadog_api_client::datadogV2::api_teams::TeamsAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.ListMemberTeams", true);
10+
let api = TeamsAPI::with_config(configuration);
11+
let resp = api
12+
.list_member_teams(
13+
"super_team_id".to_string(),
14+
ListMemberTeamsOptionalParams::default(),
15+
)
16+
.await;
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get all member teams returns "OK" response with pagination
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_teams::ListMemberTeamsOptionalParams;
4+
use datadog_api_client::datadogV2::api_teams::TeamsAPI;
5+
use futures_util::pin_mut;
6+
use futures_util::stream::StreamExt;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.ListMemberTeams", true);
12+
let api = TeamsAPI::with_config(configuration);
13+
let response = api.list_member_teams_with_pagination(
14+
"super_team_id".to_string(),
15+
ListMemberTeamsOptionalParams::default(),
16+
);
17+
pin_mut!(response);
18+
while let Some(resp) = response.next().await {
19+
if let Ok(value) = resp {
20+
println!("{:#?}", value);
21+
} else {
22+
println!("{:#?}", resp.unwrap_err());
23+
}
24+
}
25+
}

examples/v2_teams_RemoveMemberTeam.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Remove a member team returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_teams::TeamsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.RemoveMemberTeam", true);
9+
let api = TeamsAPI::with_config(configuration);
10+
let resp = api
11+
.remove_member_team("super_team_id".to_string(), "member_team_id".to_string())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}

src/datadog/configuration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ impl Default for Configuration {
200200
("v2.create_slo_report_job".to_owned(), false),
201201
("v2.get_slo_report".to_owned(), false),
202202
("v2.get_slo_report_job_status".to_owned(), false),
203+
("v2.add_member_team".to_owned(), false),
204+
("v2.list_member_teams".to_owned(), false),
205+
("v2.remove_member_team".to_owned(), false),
203206
("v2.create_incident_team".to_owned(), false),
204207
("v2.delete_incident_team".to_owned(), false),
205208
("v2.get_incident_team".to_owned(), false),

0 commit comments

Comments
 (0)