Skip to content

Commit 7661e4e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5595fb6 of spec repo
1 parent 4e2e2a8 commit 7661e4e

16 files changed

+593
-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": "8001cbb",
3-
"generated": "2025-08-13 20:27:33.480"
2+
"spec_repo_commit": "5595fb6",
3+
"generated": "2025-08-13 22:12:36.825"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42830,6 +42830,68 @@ components:
4283042830
urgency:
4283142831
$ref: '#/components/schemas/Urgency'
4283242832
type: object
42833+
TeamSyncAttributes:
42834+
description: Team sync attributes.
42835+
properties:
42836+
source:
42837+
$ref: '#/components/schemas/TeamSyncAttributesSource'
42838+
type:
42839+
$ref: '#/components/schemas/TeamSyncAttributesType'
42840+
required:
42841+
- source
42842+
- type
42843+
type: object
42844+
TeamSyncAttributesSource:
42845+
description: The external source platform for team synchronization. Only "github"
42846+
is supported.
42847+
enum:
42848+
- github
42849+
example: github
42850+
type: string
42851+
x-enum-varnames:
42852+
- GITHUB
42853+
TeamSyncAttributesType:
42854+
description: The type of synchronization operation. Only "link" is supported,
42855+
which links existing teams by matching names.
42856+
enum:
42857+
- link
42858+
example: link
42859+
type: string
42860+
x-enum-varnames:
42861+
- LINK
42862+
TeamSyncBulkType:
42863+
description: Team sync bulk type.
42864+
enum:
42865+
- team_sync_bulk
42866+
example: team_sync_bulk
42867+
type: string
42868+
x-enum-varnames:
42869+
- TEAM_SYNC_BULK
42870+
TeamSyncData:
42871+
description: Team sync data.
42872+
properties:
42873+
attributes:
42874+
$ref: '#/components/schemas/TeamSyncAttributes'
42875+
type:
42876+
$ref: '#/components/schemas/TeamSyncBulkType'
42877+
required:
42878+
- attributes
42879+
- type
42880+
type: object
42881+
TeamSyncRequest:
42882+
description: Team sync request.
42883+
example:
42884+
data:
42885+
attributes:
42886+
source: github
42887+
type: link
42888+
type: team_sync_bulk
42889+
properties:
42890+
data:
42891+
$ref: '#/components/schemas/TeamSyncData'
42892+
required:
42893+
- data
42894+
type: object
4283342895
TeamTarget:
4283442896
description: Represents a team target for an escalation policy step, including
4283542897
the team's ID and resource type.
@@ -65870,6 +65932,71 @@ paths:
6587065932
permissions:
6587165933
- teams_read
6587265934
- teams_manage
65935+
/api/v2/team/sync:
65936+
post:
65937+
description: 'This endpoint attempts to link your existing Datadog teams with
65938+
GitHub teams by matching their names.
65939+
65940+
It evaluates all current Datadog teams and compares them against teams in
65941+
the GitHub organization
65942+
65943+
connected to your Datadog account, based on Datadog Team handle and GitHub
65944+
Team slug
65945+
65946+
(lowercased and kebab-cased).
65947+
65948+
65949+
This operation is read-only on the GitHub side, no teams will be modified
65950+
or created.
65951+
65952+
65953+
[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
65954+
65955+
and the GitHub App integrated with Datadog must have the `Members Read` permission.
65956+
Matching is performed by comparing the Datadog team handle to the GitHub team
65957+
slug
65958+
65959+
using a normalized exact match; case is ignored and spaces are removed. No
65960+
modifications are made
65961+
65962+
to teams in GitHub. This will not create new Teams in Datadog.'
65963+
operationId: SyncTeams
65964+
requestBody:
65965+
content:
65966+
application/json:
65967+
schema:
65968+
$ref: '#/components/schemas/TeamSyncRequest'
65969+
required: true
65970+
responses:
65971+
'200':
65972+
description: OK
65973+
'403':
65974+
$ref: '#/components/responses/ForbiddenResponse'
65975+
'429':
65976+
$ref: '#/components/responses/TooManyRequestsResponse'
65977+
'500':
65978+
content:
65979+
application/json:
65980+
schema:
65981+
$ref: '#/components/schemas/APIErrorResponse'
65982+
description: Internal Server Error - Unexpected error during linking.
65983+
security:
65984+
- apiKeyAuth: []
65985+
appKeyAuth: []
65986+
- AuthZ:
65987+
- teams_manage
65988+
summary: Link Teams with GitHub Teams
65989+
tags:
65990+
- Teams
65991+
x-codegen-request-body-name: body
65992+
x-permission:
65993+
operator: AND
65994+
permissions:
65995+
- teams_manage
65996+
x-unstable: '**Note**: This endpoint is in Preview. To request access, fill
65997+
out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/).
65998+
65999+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6587366000
/api/v2/team/{super_team_id}/member_teams:
6587466001
get:
6587566002
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
@@ -19058,6 +19058,48 @@ datadog\_api\_client.v2.model.team\_routing\_rules\_request\_rule module
1905819058
:members:
1905919059
:show-inheritance:
1906019060

19061+
datadog\_api\_client.v2.model.team\_sync\_attributes module
19062+
-----------------------------------------------------------
19063+
19064+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes
19065+
:members:
19066+
:show-inheritance:
19067+
19068+
datadog\_api\_client.v2.model.team\_sync\_attributes\_source module
19069+
-------------------------------------------------------------------
19070+
19071+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes_source
19072+
:members:
19073+
:show-inheritance:
19074+
19075+
datadog\_api\_client.v2.model.team\_sync\_attributes\_type module
19076+
-----------------------------------------------------------------
19077+
19078+
.. automodule:: datadog_api_client.v2.model.team_sync_attributes_type
19079+
:members:
19080+
:show-inheritance:
19081+
19082+
datadog\_api\_client.v2.model.team\_sync\_bulk\_type module
19083+
-----------------------------------------------------------
19084+
19085+
.. automodule:: datadog_api_client.v2.model.team_sync_bulk_type
19086+
:members:
19087+
:show-inheritance:
19088+
19089+
datadog\_api\_client.v2.model.team\_sync\_data module
19090+
-----------------------------------------------------
19091+
19092+
.. automodule:: datadog_api_client.v2.model.team_sync_data
19093+
:members:
19094+
:show-inheritance:
19095+
19096+
datadog\_api\_client.v2.model.team\_sync\_request module
19097+
--------------------------------------------------------
19098+
19099+
.. automodule:: datadog_api_client.v2.model.team_sync_request
19100+
:members:
19101+
:show-inheritance:
19102+
1906119103
datadog\_api\_client.v2.model.team\_target module
1906219104
-------------------------------------------------
1906319105

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
@@ -324,6 +324,7 @@ def __init__(
324324
"v2.add_member_team": False,
325325
"v2.list_member_teams": False,
326326
"v2.remove_member_team": False,
327+
"v2.sync_teams": False,
327328
"v2.create_incident_team": False,
328329
"v2.delete_incident_team": False,
329330
"v2.get_incident_team": False,

src/datadog_api_client/v2/api/teams_api.py

Lines changed: 47 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,32 @@ 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 <https://docs.datadoghq.com/integrations/github/>`_ ,
1229+
and the GitHub App integrated with Datadog must have the ``Members Read`` permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug
1230+
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
1231+
to teams in GitHub. This will not create new Teams in Datadog.
1232+
1233+
:type body: TeamSyncRequest
1234+
:rtype: None
1235+
"""
1236+
kwargs: Dict[str, Any] = {}
1237+
kwargs["body"] = body
1238+
1239+
return self._sync_teams_endpoint.call_with_http_info(**kwargs)
1240+
11941241
def update_team(
11951242
self,
11961243
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)