diff --git a/.generated-info b/.generated-info index bdcbb99f48..bfde251ed1 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "d02c8a3", - "generated": "2025-08-08 12:07:20.979" + "spec_repo_commit": "07f8772", + "generated": "2025-08-11 21:19:54.357" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4f155402b7..7b67effcc4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -42273,6 +42273,68 @@ components: urgency: $ref: '#/components/schemas/Urgency' type: object + TeamSyncAttributes: + description: Team sync attributes. + properties: + source: + $ref: '#/components/schemas/TeamSyncAttributesSource' + type: + $ref: '#/components/schemas/TeamSyncAttributesType' + required: + - source + - type + type: object + TeamSyncAttributesSource: + description: The external source platform for team synchronization. Only "github" + is supported. + enum: + - github + example: github + type: string + x-enum-varnames: + - GITHUB + TeamSyncAttributesType: + description: The type of synchronization operation. Only "link" is supported, + which links existing teams by matching names. + enum: + - link + example: link + type: string + x-enum-varnames: + - LINK + TeamSyncBulkType: + description: Team sync bulk type. + enum: + - team_sync_bulk + example: team_sync_bulk + type: string + x-enum-varnames: + - TEAM_SYNC_BULK + TeamSyncData: + description: Team sync data. + properties: + attributes: + $ref: '#/components/schemas/TeamSyncAttributes' + type: + $ref: '#/components/schemas/TeamSyncBulkType' + required: + - attributes + - type + type: object + TeamSyncRequest: + description: Team sync request. + example: + data: + attributes: + source: github + type: link + type: team_sync_bulk + properties: + data: + $ref: '#/components/schemas/TeamSyncData' + required: + - data + type: object TeamTarget: description: Represents a team target for an escalation policy step, including the team's ID and resource type. @@ -65313,6 +65375,71 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team/sync: + post: + description: 'This endpoint attempts to link your existing Datadog teams with + GitHub teams by matching their names. + + It evaluates all current Datadog teams and compares them against teams in + the GitHub organization + + connected to your Datadog account, based on Datadog Team handle and GitHub + Team slug + + (lowercased and kebab-cased). + + + This operation is read-only on the GitHub side, no teams will be modified + or created. + + + [A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/), + + 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 + + using a normalized exact match; case is ignored and spaces are removed. No + modifications are made + + to teams in GitHub. This will not create new Teams in Datadog.' + operationId: SyncTeams + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamSyncRequest' + required: true + responses: + '200': + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Internal Server Error - Unexpected error during linking. + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_manage + summary: Link Teams with GitHub Teams + tags: + - Teams + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - teams_manage + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: description: Get all member teams. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 3164dbe560..4a6438698b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -18785,6 +18785,48 @@ datadog\_api\_client.v2.model.team\_routing\_rules\_request\_rule module :members: :show-inheritance: +datadog\_api\_client.v2.model.team\_sync\_attributes module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_sync\_attributes\_source module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_attributes_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_sync\_attributes\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_attributes_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_sync\_bulk\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_bulk_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_sync\_data module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_sync\_request module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_sync_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.team\_target module ------------------------------------------------- diff --git a/examples/v2/teams/SyncTeams.py b/examples/v2/teams/SyncTeams.py new file mode 100644 index 0000000000..8b94c37a2c --- /dev/null +++ b/examples/v2/teams/SyncTeams.py @@ -0,0 +1,28 @@ +""" +Link Teams with GitHub Teams returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi +from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes +from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource +from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType +from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType +from datadog_api_client.v2.model.team_sync_data import TeamSyncData +from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest + +body = TeamSyncRequest( + data=TeamSyncData( + attributes=TeamSyncAttributes( + source=TeamSyncAttributesSource.GITHUB, + type=TeamSyncAttributesType.LINK, + ), + type=TeamSyncBulkType.TEAM_SYNC_BULK, + ), +) + +configuration = Configuration() +configuration.unstable_operations["sync_teams"] = True +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + api_instance.sync_teams(body=body) diff --git a/examples/v2/teams/SyncTeams_3215592344.py b/examples/v2/teams/SyncTeams_3215592344.py new file mode 100644 index 0000000000..18e47d2f42 --- /dev/null +++ b/examples/v2/teams/SyncTeams_3215592344.py @@ -0,0 +1,27 @@ +""" +Sync teams returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi +from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes +from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource +from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType +from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType +from datadog_api_client.v2.model.team_sync_data import TeamSyncData +from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest + +body = TeamSyncRequest( + data=TeamSyncData( + attributes=TeamSyncAttributes( + source=TeamSyncAttributesSource.GITHUB, + type=TeamSyncAttributesType.LINK, + ), + type=TeamSyncBulkType.TEAM_SYNC_BULK, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + api_instance.sync_teams(body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index ae85238361..4f0446b2b2 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -324,6 +324,7 @@ def __init__( "v2.add_member_team": False, "v2.list_member_teams": False, "v2.remove_member_team": False, + "v2.sync_teams": False, "v2.create_incident_team": False, "v2.delete_incident_team": False, "v2.get_incident_team": False, diff --git a/src/datadog_api_client/v2/api/teams_api.py b/src/datadog_api_client/v2/api/teams_api.py index 5de3850c8a..5154e5e7ac 100644 --- a/src/datadog_api_client/v2/api/teams_api.py +++ b/src/datadog_api_client/v2/api/teams_api.py @@ -21,6 +21,7 @@ from datadog_api_client.v2.model.team import Team from datadog_api_client.v2.model.team_response import TeamResponse from datadog_api_client.v2.model.team_create_request import TeamCreateRequest +from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest from datadog_api_client.v2.model.add_member_team_request import AddMemberTeamRequest from datadog_api_client.v2.model.team_update_request import TeamUpdateRequest from datadog_api_client.v2.model.team_links_response import TeamLinksResponse @@ -512,6 +513,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._sync_teams_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/team/sync", + "operation_id": "sync_teams", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (TeamSyncRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_team_endpoint = _Endpoint( settings={ "response_type": (TeamResponse,), @@ -1191,6 +1212,32 @@ def remove_member_team( return self._remove_member_team_endpoint.call_with_http_info(**kwargs) + def sync_teams( + self, + body: TeamSyncRequest, + ) -> None: + """Link Teams with GitHub Teams. + + This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. + It evaluates all current Datadog teams and compares them against teams in the GitHub organization + connected to your Datadog account, based on Datadog Team handle and GitHub Team slug + (lowercased and kebab-cased). + + This operation is read-only on the GitHub side, no teams will be modified or created. + + `A GitHub organization must be connected to your Datadog account `_ , + 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 + using a normalized exact match; case is ignored and spaces are removed. No modifications are made + to teams in GitHub. This will not create new Teams in Datadog. + + :type body: TeamSyncRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._sync_teams_endpoint.call_with_http_info(**kwargs) + def update_team( self, team_id: str, diff --git a/src/datadog_api_client/v2/model/team_sync_attributes.py b/src/datadog_api_client/v2/model/team_sync_attributes.py new file mode 100644 index 0000000000..d569c3dc9e --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_attributes.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource + from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType + + +class TeamSyncAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource + from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType + + return { + "source": (TeamSyncAttributesSource,), + "type": (TeamSyncAttributesType,), + } + + attribute_map = { + "source": "source", + "type": "type", + } + + def __init__(self_, source: TeamSyncAttributesSource, type: TeamSyncAttributesType, **kwargs): + """ + Team sync attributes. + + :param source: The external source platform for team synchronization. Only "github" is supported. + :type source: TeamSyncAttributesSource + + :param type: The type of synchronization operation. Only "link" is supported, which links existing teams by matching names. + :type type: TeamSyncAttributesType + """ + super().__init__(kwargs) + + self_.source = source + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_sync_attributes_source.py b/src/datadog_api_client/v2/model/team_sync_attributes_source.py new file mode 100644 index 0000000000..6a3cdc6d6e --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_attributes_source.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TeamSyncAttributesSource(ModelSimple): + """ + The external source platform for team synchronization. Only "github" is supported. + + :param value: If omitted defaults to "github". Must be one of ["github"]. + :type value: str + """ + + allowed_values = { + "github", + } + GITHUB: ClassVar["TeamSyncAttributesSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TeamSyncAttributesSource.GITHUB = TeamSyncAttributesSource("github") diff --git a/src/datadog_api_client/v2/model/team_sync_attributes_type.py b/src/datadog_api_client/v2/model/team_sync_attributes_type.py new file mode 100644 index 0000000000..4068a43eee --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_attributes_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TeamSyncAttributesType(ModelSimple): + """ + The type of synchronization operation. Only "link" is supported, which links existing teams by matching names. + + :param value: If omitted defaults to "link". Must be one of ["link"]. + :type value: str + """ + + allowed_values = { + "link", + } + LINK: ClassVar["TeamSyncAttributesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TeamSyncAttributesType.LINK = TeamSyncAttributesType("link") diff --git a/src/datadog_api_client/v2/model/team_sync_bulk_type.py b/src/datadog_api_client/v2/model/team_sync_bulk_type.py new file mode 100644 index 0000000000..07d6ad0cf2 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_bulk_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TeamSyncBulkType(ModelSimple): + """ + Team sync bulk type. + + :param value: If omitted defaults to "team_sync_bulk". Must be one of ["team_sync_bulk"]. + :type value: str + """ + + allowed_values = { + "team_sync_bulk", + } + TEAM_SYNC_BULK: ClassVar["TeamSyncBulkType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TeamSyncBulkType.TEAM_SYNC_BULK = TeamSyncBulkType("team_sync_bulk") diff --git a/src/datadog_api_client/v2/model/team_sync_data.py b/src/datadog_api_client/v2/model/team_sync_data.py new file mode 100644 index 0000000000..e5fb0ded6c --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes + from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType + + +class TeamSyncData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes + from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType + + return { + "attributes": (TeamSyncAttributes,), + "type": (TeamSyncBulkType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: TeamSyncAttributes, type: TeamSyncBulkType, **kwargs): + """ + Team sync data. + + :param attributes: Team sync attributes. + :type attributes: TeamSyncAttributes + + :param type: Team sync bulk type. + :type type: TeamSyncBulkType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_sync_request.py b/src/datadog_api_client/v2/model/team_sync_request.py new file mode 100644 index 0000000000..7bb7648cfd --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_sync_data import TeamSyncData + + +class TeamSyncRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_sync_data import TeamSyncData + + return { + "data": (TeamSyncData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TeamSyncData, **kwargs): + """ + Team sync request. + + :param data: Team sync data. + :type data: TeamSyncData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 52e92ab3f7..38dad2299d 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3628,6 +3628,12 @@ from datadog_api_client.v2.model.team_routing_rules_request_data_attributes import TeamRoutingRulesRequestDataAttributes from datadog_api_client.v2.model.team_routing_rules_request_data_type import TeamRoutingRulesRequestDataType from datadog_api_client.v2.model.team_routing_rules_request_rule import TeamRoutingRulesRequestRule +from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes +from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource +from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType +from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType +from datadog_api_client.v2.model.team_sync_data import TeamSyncData +from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest from datadog_api_client.v2.model.team_target import TeamTarget from datadog_api_client.v2.model.team_target_type import TeamTargetType from datadog_api_client.v2.model.team_type import TeamType @@ -6511,6 +6517,12 @@ "TeamRoutingRulesRequestDataAttributes", "TeamRoutingRulesRequestDataType", "TeamRoutingRulesRequestRule", + "TeamSyncAttributes", + "TeamSyncAttributesSource", + "TeamSyncAttributesType", + "TeamSyncBulkType", + "TeamSyncData", + "TeamSyncRequest", "TeamTarget", "TeamTargetType", "TeamType", diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index 4cdf61f0fa..5d9cd3fc93 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -9,7 +9,7 @@ Feature: Teams And a valid "appKeyAuth" key in the system And an instance of "Teams" API - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Add a member team returns "API error response." response Given operation "AddMemberTeam" enabled And new "AddMemberTeam" request @@ -18,7 +18,7 @@ Feature: Teams When the request is sent Then the response status is 409 API error response. - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Add a member team returns "Added" response Given operation "AddMemberTeam" enabled And new "AddMemberTeam" request @@ -27,7 +27,7 @@ Feature: Teams When the request is sent Then the response status is 204 Added - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Add a user to a team returns "API error response." response Given new "CreateTeamMembership" request And request contains "team_id" parameter from "REPLACE.ME" @@ -35,7 +35,7 @@ Feature: Teams When the request is sent Then the response status is 409 API error response. - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Add a user to a team returns "Represents a user's association to a team" response Given new "CreateTeamMembership" request And request contains "team_id" parameter from "REPLACE.ME" @@ -43,7 +43,7 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request And there is a valid "dd_team" in the system @@ -52,7 +52,7 @@ Feature: Teams When the request is sent Then the response status is 422 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Create a team link returns "OK" response Given new "CreateTeamLink" request And there is a valid "dd_team" in the system @@ -64,7 +64,7 @@ Feature: Teams And the response "data.attributes.url" is equal to "https://example.com" And the response "data.attributes.position" is equal to 0 - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Create a team returns "API error response." response Given new "CreateTeam" request And there is a valid "dd_team" in the system @@ -72,7 +72,7 @@ Feature: Teams When the request is sent Then the response status is 409 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Create a team returns "CREATED" response Given new "CreateTeam" request And body with value {"data": {"attributes": {"handle": "test-handle-{{ unique_hash }}", "name": "test-name-{{ unique_hash }}"}, "relationships": {"users": {"data": []}}, "type": "team"}} @@ -82,7 +82,7 @@ Feature: Teams And the response "data.attributes.handle" is equal to "test-handle-{{ unique_hash }}" And the response "data.attributes.name" is equal to "test-name-{{ unique_hash }}" - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Create a team with V2 fields returns "CREATED" response Given new "CreateTeam" request And body with value {"data": {"attributes": {"handle": "test-handle-{{ unique_hash }}","name": "test-name-{{ unique_hash }}", "avatar": "🥑", "banner": 7, "visible_modules": ["m1","m2"], "hidden_modules": ["m3"]}, "type": "team"}} @@ -96,7 +96,7 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request And there is a valid "dd_team" in the system @@ -105,7 +105,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get a team link returns "OK" response Given new "GetTeamLink" request And there is a valid "dd_team" in the system @@ -115,14 +115,14 @@ Feature: Teams When the request is sent Then the response status is 200 OK - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get a team returns "API error response." response Given new "GetTeam" request And request contains "team_id" parameter with value "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get a team returns "OK" response Given new "GetTeam" request And there is a valid "dd_team" in the system @@ -130,7 +130,7 @@ Feature: Teams When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Get all member teams returns "API error response." response Given operation "ListMemberTeams" enabled And new "ListMemberTeams" request @@ -138,7 +138,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Get all member teams returns "OK" response Given operation "ListMemberTeams" enabled And new "ListMemberTeams" request @@ -146,7 +146,7 @@ Feature: Teams When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-app @with-pagination + @generated @skip @team:DataDog/aaa-omg @with-pagination Scenario: Get all member teams returns "OK" response with pagination Given operation "ListMemberTeams" enabled And new "ListMemberTeams" request @@ -154,7 +154,7 @@ Feature: Teams When the request with pagination is sent Then the response status is 200 OK - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get all teams returns "OK" response Given new "ListTeams" request And there is a valid "dd_team" in the system @@ -162,7 +162,7 @@ Feature: Teams Then the response status is 200 OK And the response "data" has item with field "id" with value "{{ dd_team.data.id }}" - @replay-only @skip-validation @team:DataDog/core-app @with-pagination + @replay-only @skip-validation @team:DataDog/aaa-omg @with-pagination Scenario: Get all teams returns "OK" response with pagination Given new "ListTeams" request And request contains "page[size]" parameter with value 2 @@ -170,7 +170,7 @@ Feature: Teams Then the response status is 200 OK And the response has 3 items - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get all teams with fields_team parameter returns "OK" response Given new "ListTeams" request And there is a valid "dd_team" in the system @@ -181,14 +181,14 @@ Feature: Teams And the response "data[0].attributes" has field "name" And the response "data[0].attributes" has field "handle" - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get links for a team returns "API error response." response Given new "GetTeamLinks" request And request contains "team_id" parameter with value "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get links for a team returns "OK" response Given new "GetTeamLinks" request And there is a valid "dd_team" in the system @@ -196,14 +196,14 @@ Feature: Teams When the request is sent Then the response status is 200 OK - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get permission settings for a team returns "API error response." response Given new "GetTeamPermissionSettings" request And request contains "team_id" parameter with value "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get permission settings for a team returns "OK" response Given new "GetTeamPermissionSettings" request And there is a valid "dd_team" in the system @@ -211,14 +211,14 @@ Feature: Teams When the request is sent Then the response status is 200 OK - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request And request contains "team_id" parameter with value "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get team memberships returns "Represents a user's association to a team" response Given new "GetTeamMemberships" request And there is a valid "dd_team" in the system @@ -226,7 +226,7 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team - @replay-only @skip-validation @team:DataDog/core-app @with-pagination + @replay-only @skip-validation @team:DataDog/aaa-omg @with-pagination Scenario: Get team memberships returns "Represents a user's association to a team" response with pagination Given new "GetTeamMemberships" request And request contains "team_id" parameter with value "2e06bf2c-193b-41d4-b3c2-afccc080458f" @@ -235,14 +235,14 @@ Feature: Teams Then the response status is 200 OK And the response has 3 items - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Get user memberships returns "API error response." response Given new "GetUserMemberships" request And request contains "user_uuid" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Get user memberships returns "Represents a user's association to a team" response Given new "GetUserMemberships" request And there is a valid "user" in the system @@ -251,7 +251,15 @@ Feature: Teams Then the response status is 200 Represents a user's association to a team And the response "data" has length 0 - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg + Scenario: Link Teams with GitHub Teams returns "OK" response + Given operation "SyncTeams" enabled + And new "SyncTeams" request + And body with value {"data": {"attributes": {"source": "github", "type": "link"}, "type": "team_sync_bulk"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg Scenario: Remove a member team returns "API error response." response Given operation "RemoveMemberTeam" enabled And new "RemoveMemberTeam" request @@ -260,7 +268,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Remove a member team returns "No Content" response Given operation "RemoveMemberTeam" enabled And new "RemoveMemberTeam" request @@ -269,7 +277,7 @@ Feature: Teams When the request is sent Then the response status is 204 No Content - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request And there is a valid "dd_team" in the system @@ -278,7 +286,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Remove a team link returns "No Content" response Given new "DeleteTeamLink" request And there is a valid "dd_team" in the system @@ -288,14 +296,14 @@ Feature: Teams When the request is sent Then the response status is 204 No Content - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Remove a team returns "API error response." response Given new "DeleteTeam" request And request contains "team_id" parameter with value "REPLACE.ME" When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Remove a team returns "No Content" response Given new "DeleteTeam" request And there is a valid "dd_team" in the system @@ -303,7 +311,7 @@ Feature: Teams When the request is sent Then the response status is 204 No Content - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Remove a user from a team returns "API error response." response Given new "DeleteTeamMembership" request And there is a valid "dd_team" in the system @@ -312,7 +320,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @skip @team:DataDog/core-app + @skip @team:DataDog/aaa-omg Scenario: Remove a user from a team returns "No Content" response Given new "DeleteTeamMembership" request And there is a valid "dd_team" in the system @@ -321,7 +329,14 @@ Feature: Teams When the request is sent Then the response status is 204 No Content - @team:DataDog/core-app + @team:DataDog/aaa-omg + Scenario: Sync teams returns "OK" response + Given new "SyncTeams" request + And body with value {"data": {"attributes": {"source": "github", "type": "link"}, "type": "team_sync_bulk"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/aaa-omg Scenario: Update a team link returns "API error response." response Given new "UpdateTeamLink" request And there is a valid "dd_team" in the system @@ -331,7 +346,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Update a team link returns "OK" response Given new "UpdateTeamLink" request And there is a valid "dd_team" in the system @@ -346,7 +361,7 @@ Feature: Teams And the response "data.attributes.label" is equal to "New Label" And the response "data.attributes.url" is equal to "https://example.com" - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Update a team returns "API error response." response Given new "UpdateTeam" request And request contains "team_id" parameter from "REPLACE.ME" @@ -354,7 +369,7 @@ Feature: Teams When the request is sent Then the response status is 409 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Update a team returns "OK" response Given new "UpdateTeam" request And there is a valid "dd_team" in the system @@ -370,7 +385,7 @@ Feature: Teams And the response "data.attributes.hidden_modules" is equal to ["m3"] And the response "data.attributes.visible_modules" is equal to ["m1", "m2"] - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Update a user's membership attributes on a team returns "API error response." response Given new "UpdateTeamMembership" request And request contains "team_id" parameter from "REPLACE.ME" @@ -379,7 +394,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @generated @skip @team:DataDog/core-app + @generated @skip @team:DataDog/aaa-omg Scenario: Update a user's membership attributes on a team returns "Represents a user's association to a team" response Given new "UpdateTeamMembership" request And request contains "team_id" parameter from "REPLACE.ME" @@ -388,7 +403,7 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Update a user's role on a team returns "API error response." response Given new "UpdateTeamMembership" request And there is a valid "dd_team" in the system @@ -398,7 +413,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Update permission setting for team returns "API error response." response Given new "UpdateTeamPermissionSetting" request And there is a valid "dd_team" in the system @@ -408,7 +423,7 @@ Feature: Teams When the request is sent Then the response status is 404 API error response. - @team:DataDog/core-app + @team:DataDog/aaa-omg Scenario: Update permission setting for team returns "OK" response Given new "UpdateTeamPermissionSetting" request And there is a valid "dd_team" in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index fd14fad093..6f5c5499f1 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3411,6 +3411,12 @@ "type": "unsafe" } }, + "SyncTeams": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, "ListMemberTeams": { "tag": "Teams", "undo": {