Skip to content

Commit c32efb9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2546358 of spec repo
1 parent 717dd5c commit c32efb9

16 files changed

+596
-47
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "69305be",
3-
"generated": "2025-08-05 16:20:40.645"
2+
"spec_repo_commit": "2546358",
3+
"generated": "2025-08-05 17:47:30.590"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42161,6 +42161,68 @@ components:
4216142161
urgency:
4216242162
$ref: '#/components/schemas/Urgency'
4216342163
type: object
42164+
TeamSyncAttributes:
42165+
description: Team sync attributes.
42166+
properties:
42167+
source:
42168+
$ref: '#/components/schemas/TeamSyncAttributesSource'
42169+
type:
42170+
$ref: '#/components/schemas/TeamSyncAttributesType'
42171+
required:
42172+
- source
42173+
- type
42174+
type: object
42175+
TeamSyncAttributesSource:
42176+
description: The external source platform for team synchronization. Only "github"
42177+
is supported.
42178+
enum:
42179+
- github
42180+
example: github
42181+
type: string
42182+
x-enum-varnames:
42183+
- GITHUB
42184+
TeamSyncAttributesType:
42185+
description: The type of synchronization operation. Only "link" is supported,
42186+
which links existing teams by matching names.
42187+
enum:
42188+
- link
42189+
example: link
42190+
type: string
42191+
x-enum-varnames:
42192+
- LINK
42193+
TeamSyncBulkType:
42194+
description: Team sync bulk type.
42195+
enum:
42196+
- team_sync_bulk
42197+
example: team_sync_bulk
42198+
type: string
42199+
x-enum-varnames:
42200+
- TEAM_SYNC_BULK
42201+
TeamSyncData:
42202+
description: Team sync data.
42203+
properties:
42204+
attributes:
42205+
$ref: '#/components/schemas/TeamSyncAttributes'
42206+
type:
42207+
$ref: '#/components/schemas/TeamSyncBulkType'
42208+
required:
42209+
- attributes
42210+
- type
42211+
type: object
42212+
TeamSyncRequest:
42213+
description: Team sync request.
42214+
example:
42215+
data:
42216+
attributes:
42217+
source: github
42218+
type: link
42219+
type: team_sync_bulk
42220+
properties:
42221+
data:
42222+
$ref: '#/components/schemas/TeamSyncData'
42223+
required:
42224+
- data
42225+
type: object
4216442226
TeamTarget:
4216542227
description: Represents a team target for an escalation policy step, including
4216642228
the team's ID and resource type.
@@ -65207,6 +65269,73 @@ paths:
6520765269
permissions:
6520865270
- teams_read
6520965271
- teams_manage
65272+
/api/v2/team/sync:
65273+
post:
65274+
description: 'This endpoint attempts to link your existing Datadog teams with
65275+
GitHub teams by matching their names.
65276+
65277+
It evaluates all current Datadog teams and compares them against teams in
65278+
the GitHub organization
65279+
65280+
connected to your Datadog account, based on Datadog Team handle and GitHub
65281+
Team slug
65282+
65283+
(lowercased and kebab-cased).
65284+
65285+
65286+
This operation is read-only on the GitHub side, no teams will be modified
65287+
or created.
65288+
65289+
65290+
A GitHub organization must be connected to your Datadog account. The Datadog
65291+
user must have the
65292+
65293+
`Teams Manage` permission, and the GitHub App integrated with Datadog must
65294+
have the `Members Read`
65295+
65296+
permission. Matching is performed by comparing the Datadog team handle to
65297+
the GitHub team slug
65298+
65299+
using a normalized exact match; case is ignored and spaces are removed. No
65300+
modifications are made
65301+
65302+
to teams in GitHub. This will not create new Teams in Datadog.'
65303+
operationId: SyncTeams
65304+
requestBody:
65305+
content:
65306+
application/json:
65307+
schema:
65308+
$ref: '#/components/schemas/TeamSyncRequest'
65309+
required: true
65310+
responses:
65311+
'200':
65312+
description: OK
65313+
'403':
65314+
$ref: '#/components/responses/ForbiddenResponse'
65315+
'429':
65316+
$ref: '#/components/responses/TooManyRequestsResponse'
65317+
'500':
65318+
content:
65319+
application/json:
65320+
schema:
65321+
$ref: '#/components/schemas/APIErrorResponse'
65322+
description: Internal Server Error - Unexpected error during linking.
65323+
security:
65324+
- apiKeyAuth: []
65325+
appKeyAuth: []
65326+
- AuthZ:
65327+
- teams_manage
65328+
summary: Link Teams with GitHub Teams
65329+
tags:
65330+
- Teams
65331+
x-codegen-request-body-name: body
65332+
x-permission:
65333+
operator: AND
65334+
permissions:
65335+
- teams_manage
65336+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
65337+
65338+
contact [Datadog support](https://docs.datadoghq.com/help/).'
6521065339
/api/v2/team/{super_team_id}/member_teams:
6521165340
get:
6521265341
description: Get all member teams.

docs/datadog_api_client.v2.model.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18764,6 +18764,48 @@ datadog\_api\_client.v2.model.team\_routing\_rules\_request\_rule module
1876418764
:members:
1876518765
:show-inheritance:
1876618766

18767+
datadog\_api\_client.v2.model.team\_sync\_attributes module
18768+
-----------------------------------------------------------
18769+
18770+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes
18771+
:members:
18772+
:show-inheritance:
18773+
18774+
datadog\_api\_client.v2.model.team\_sync\_attributes\_source module
18775+
-------------------------------------------------------------------
18776+
18777+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes_source
18778+
:members:
18779+
:show-inheritance:
18780+
18781+
datadog\_api\_client.v2.model.team\_sync\_attributes\_type module
18782+
-----------------------------------------------------------------
18783+
18784+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes_type
18785+
:members:
18786+
:show-inheritance:
18787+
18788+
datadog\_api\_client.v2.model.team\_sync\_bulk\_type module
18789+
-----------------------------------------------------------
18790+
18791+
.. automodule:: datadog_api_client.v2.model.team_sync_bulk_type
18792+
:members:
18793+
:show-inheritance:
18794+
18795+
datadog\_api\_client.v2.model.team\_sync\_data module
18796+
-----------------------------------------------------
18797+
18798+
.. automodule:: datadog_api_client.v2.model.team_sync_data
18799+
:members:
18800+
:show-inheritance:
18801+
18802+
datadog\_api\_client.v2.model.team\_sync\_request module
18803+
--------------------------------------------------------
18804+
18805+
.. automodule:: datadog_api_client.v2.model.team_sync_request
18806+
:members:
18807+
:show-inheritance:
18808+
1876718809
datadog\_api\_client.v2.model.team\_target module
1876818810
-------------------------------------------------
1876918811

examples/v2/teams/SyncTeams.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Link Teams with GitHub Teams returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.teams_api import TeamsApi
7+
from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes
8+
from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource
9+
from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType
10+
from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType
11+
from datadog_api_client.v2.model.team_sync_data import TeamSyncData
12+
from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest
13+
14+
body = TeamSyncRequest(
15+
data=TeamSyncData(
16+
attributes=TeamSyncAttributes(
17+
source=TeamSyncAttributesSource.GITHUB,
18+
type=TeamSyncAttributesType.LINK,
19+
),
20+
type=TeamSyncBulkType.TEAM_SYNC_BULK,
21+
),
22+
)
23+
24+
configuration = Configuration()
25+
configuration.unstable_operations["sync_teams"] = True
26+
with ApiClient(configuration) as api_client:
27+
api_instance = TeamsApi(api_client)
28+
api_instance.sync_teams(body=body)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Sync teams returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.teams_api import TeamsApi
7+
from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes
8+
from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource
9+
from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType
10+
from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType
11+
from datadog_api_client.v2.model.team_sync_data import TeamSyncData
12+
from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest
13+
14+
body = TeamSyncRequest(
15+
data=TeamSyncData(
16+
attributes=TeamSyncAttributes(
17+
source=TeamSyncAttributesSource.GITHUB,
18+
type=TeamSyncAttributesType.LINK,
19+
),
20+
type=TeamSyncBulkType.TEAM_SYNC_BULK,
21+
),
22+
)
23+
24+
configuration = Configuration()
25+
with ApiClient(configuration) as api_client:
26+
api_instance = TeamsApi(api_client)
27+
api_instance.sync_teams(body=body)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ def __init__(
326326
"v2.add_member_team": False,
327327
"v2.list_member_teams": False,
328328
"v2.remove_member_team": False,
329+
"v2.sync_teams": False,
329330
"v2.create_incident_team": False,
330331
"v2.delete_incident_team": False,
331332
"v2.get_incident_team": False,

src/datadog_api_client/v2/api/teams_api.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from datadog_api_client.v2.model.team import Team
2222
from datadog_api_client.v2.model.team_response import TeamResponse
2323
from datadog_api_client.v2.model.team_create_request import TeamCreateRequest
24+
from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest
2425
from datadog_api_client.v2.model.add_member_team_request import AddMemberTeamRequest
2526
from datadog_api_client.v2.model.team_update_request import TeamUpdateRequest
2627
from datadog_api_client.v2.model.team_links_response import TeamLinksResponse
@@ -512,6 +513,26 @@ def __init__(self, api_client=None):
512513
api_client=api_client,
513514
)
514515

516+
self._sync_teams_endpoint = _Endpoint(
517+
settings={
518+
"response_type": None,
519+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
520+
"endpoint_path": "/api/v2/team/sync",
521+
"operation_id": "sync_teams",
522+
"http_method": "POST",
523+
"version": "v2",
524+
},
525+
params_map={
526+
"body": {
527+
"required": True,
528+
"openapi_types": (TeamSyncRequest,),
529+
"location": "body",
530+
},
531+
},
532+
headers_map={"accept": ["*/*"], "content_type": ["application/json"]},
533+
api_client=api_client,
534+
)
535+
515536
self._update_team_endpoint = _Endpoint(
516537
settings={
517538
"response_type": (TeamResponse,),
@@ -1191,6 +1212,33 @@ def remove_member_team(
11911212

11921213
return self._remove_member_team_endpoint.call_with_http_info(**kwargs)
11931214

1215+
def sync_teams(
1216+
self,
1217+
body: TeamSyncRequest,
1218+
) -> None:
1219+
"""Link Teams with GitHub Teams.
1220+
1221+
This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
1222+
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
1223+
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
1224+
(lowercased and kebab-cased).
1225+
1226+
This operation is read-only on the GitHub side, no teams will be modified or created.
1227+
1228+
A GitHub organization must be connected to your Datadog account. The Datadog user must have the
1229+
``Teams Manage`` permission, and the GitHub App integrated with Datadog must have the ``Members Read``
1230+
permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug
1231+
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
1232+
to teams in GitHub. This will not create new Teams in Datadog.
1233+
1234+
:type body: TeamSyncRequest
1235+
:rtype: None
1236+
"""
1237+
kwargs: Dict[str, Any] = {}
1238+
kwargs["body"] = body
1239+
1240+
return self._sync_teams_endpoint.call_with_http_info(**kwargs)
1241+
11941242
def update_team(
11951243
self,
11961244
team_id: str,
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource
16+
from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType
17+
18+
19+
class TeamSyncAttributes(ModelNormal):
20+
@cached_property
21+
def openapi_types(_):
22+
from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource
23+
from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType
24+
25+
return {
26+
"source": (TeamSyncAttributesSource,),
27+
"type": (TeamSyncAttributesType,),
28+
}
29+
30+
attribute_map = {
31+
"source": "source",
32+
"type": "type",
33+
}
34+
35+
def __init__(self_, source: TeamSyncAttributesSource, type: TeamSyncAttributesType, **kwargs):
36+
"""
37+
Team sync attributes.
38+
39+
:param source: The external source platform for team synchronization. Only "github" is supported.
40+
:type source: TeamSyncAttributesSource
41+
42+
:param type: The type of synchronization operation. Only "link" is supported, which links existing teams by matching names.
43+
:type type: TeamSyncAttributesType
44+
"""
45+
super().__init__(kwargs)
46+
47+
self_.source = source
48+
self_.type = type

0 commit comments

Comments
 (0)