diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1fe1b58cae..a5b836b66b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65885,8 +65885,6 @@ components: properties: frequency: $ref: "#/components/schemas/TeamSyncAttributesFrequency" - selection_state: - $ref: "#/components/schemas/TeamSyncAttributesSelectionState" source: $ref: "#/components/schemas/TeamSyncAttributesSource" sync_membership: @@ -65909,14 +65907,6 @@ components: - ONCE - CONTINUOUSLY - PAUSED - TeamSyncAttributesSelectionState: - description: |- - Specifies which teams or organizations to sync. When - provided, synchronization is limited to the specified - items and their subtrees. - items: - $ref: "#/components/schemas/TeamSyncSelectionStateItem" - type: array TeamSyncAttributesSource: description: The external source platform for team synchronization. Only "github" is supported. enum: @@ -65926,7 +65916,6 @@ components: x-enum-varnames: - GITHUB TeamSyncAttributesSyncMembership: - default: false description: Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided. example: true type: boolean @@ -65986,72 +65975,6 @@ components: $ref: "#/components/schemas/TeamSyncData" type: array type: object - TeamSyncSelectionStateExternalId: - description: The external identifier for a team or organization in the source platform. - properties: - type: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalIdType" - value: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalIdValue" - required: - - type - - value - type: object - TeamSyncSelectionStateExternalIdType: - description: |- - The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are `team` and - `organization`. - enum: - - team - - organization - example: team - type: string - x-enum-varnames: - - TEAM - - ORGANIZATION - TeamSyncSelectionStateExternalIdValue: - description: |- - The external identifier value from the source - platform. For GitHub, this is the string - representation of a GitHub organization ID or team - ID. - example: "1" - type: string - TeamSyncSelectionStateItem: - description: Identifies a team or organization hierarchy to include in synchronization. - properties: - external_id: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalId" - operation: - $ref: "#/components/schemas/TeamSyncSelectionStateOperation" - scope: - $ref: "#/components/schemas/TeamSyncSelectionStateScope" - required: - - external_id - type: object - TeamSyncSelectionStateOperation: - description: |- - The operation to perform on the selected hierarchy. - When set to `include`, synchronization covers the - referenced teams or organizations. - enum: - - include - example: include - type: string - x-enum-varnames: - - INCLUDE - TeamSyncSelectionStateScope: - description: |- - The scope of the selection. When set to `subtree`, - synchronization includes the referenced team or - organization and everything nested under it. - enum: - - subtree - example: subtree - type: string - x-enum-varnames: - - SUBTREE TeamTarget: description: "Represents a team target for an escalation policy step, including the team's ID and resource type." properties: @@ -105511,6 +105434,12 @@ paths: description: OK "403": $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Team sync configurations not found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -105527,17 +105456,13 @@ paths: - teams_read post: description: |- - This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names. + 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. - Optionally, provide `selection_state` to limit synchronization - to specific teams or organizations and their subtrees, instead - of syncing all teams. - [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 @@ -105552,8 +105477,6 @@ paths: responses: "200": description: OK - "204": - description: No Content "403": $ref: "#/components/responses/ForbiddenResponse" "429": diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 559286621a..8dbf4eef3a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -30468,41 +30468,6 @@ datadog\_api\_client.v2.model.team\_sync\_response module :members: :show-inheritance: -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_external\_id module -------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_external_id - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_external\_id\_type module -------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_external_id_type - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_item module ------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_item - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_operation module ----------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_operation - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_scope module ------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_scope - :members: - :show-inheritance: - datadog\_api\_client.v2.model.team\_target module ------------------------------------------------- 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/v2/api/teams_api.py b/src/datadog_api_client/v2/api/teams_api.py index f0cea6d425..e5b6af700e 100644 --- a/src/datadog_api_client/v2/api/teams_api.py +++ b/src/datadog_api_client/v2/api/teams_api.py @@ -1972,17 +1972,13 @@ def sync_teams( ) -> None: """Link Teams with GitHub Teams. - This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names. + 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. - Optionally, provide ``selection_state`` to limit synchronization - to specific teams or organizations and their subtrees, instead - of syncing all teams. - `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 diff --git a/src/datadog_api_client/v2/model/team_sync_attributes.py b/src/datadog_api_client/v2/model/team_sync_attributes.py index 431ae8de98..fe18232f01 100644 --- a/src/datadog_api_client/v2/model/team_sync_attributes.py +++ b/src/datadog_api_client/v2/model/team_sync_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.team_sync_attributes_frequency import TeamSyncAttributesFrequency - from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType @@ -24,13 +23,11 @@ class TeamSyncAttributes(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.team_sync_attributes_frequency import TeamSyncAttributesFrequency - from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem 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 { "frequency": (TeamSyncAttributesFrequency,), - "selection_state": ([TeamSyncSelectionStateItem],), "source": (TeamSyncAttributesSource,), "sync_membership": (bool,), "type": (TeamSyncAttributesType,), @@ -38,7 +35,6 @@ def openapi_types(_): attribute_map = { "frequency": "frequency", - "selection_state": "selection_state", "source": "source", "sync_membership": "sync_membership", "type": "type", @@ -49,7 +45,6 @@ def __init__( source: TeamSyncAttributesSource, type: TeamSyncAttributesType, frequency: Union[TeamSyncAttributesFrequency, UnsetType] = unset, - selection_state: Union[List[TeamSyncSelectionStateItem], UnsetType] = unset, sync_membership: Union[bool, UnsetType] = unset, **kwargs, ): @@ -59,11 +54,6 @@ def __init__( :param frequency: How often the sync process should be run. Defaults to ``once`` when not provided. :type frequency: TeamSyncAttributesFrequency, optional - :param selection_state: Specifies which teams or organizations to sync. When - provided, synchronization is limited to the specified - items and their subtrees. - :type selection_state: [TeamSyncSelectionStateItem], optional - :param source: The external source platform for team synchronization. Only "github" is supported. :type source: TeamSyncAttributesSource @@ -75,8 +65,6 @@ def __init__( """ if frequency is not unset: kwargs["frequency"] = frequency - if selection_state is not unset: - kwargs["selection_state"] = selection_state if sync_membership is not unset: kwargs["sync_membership"] = sync_membership super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py deleted file mode 100644 index b36dd1e491..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_selection_state_external_id_type import ( - TeamSyncSelectionStateExternalIdType, - ) - - -class TeamSyncSelectionStateExternalId(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_sync_selection_state_external_id_type import ( - TeamSyncSelectionStateExternalIdType, - ) - - return { - "type": (TeamSyncSelectionStateExternalIdType,), - "value": (str,), - } - - attribute_map = { - "type": "type", - "value": "value", - } - - def __init__(self_, type: TeamSyncSelectionStateExternalIdType, value: str, **kwargs): - """ - The external identifier for a team or organization in the source platform. - - :param type: The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are ``team`` and - ``organization``. - :type type: TeamSyncSelectionStateExternalIdType - - :param value: The external identifier value from the source - platform. For GitHub, this is the string - representation of a GitHub organization ID or team - ID. - :type value: str - """ - super().__init__(kwargs) - - self_.type = type - self_.value = value diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py deleted file mode 100644 index 68d4e2c90e..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TeamSyncSelectionStateExternalIdType(ModelSimple): - """ - The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are `team` and - `organization`. - - :param value: Must be one of ["team", "organization"]. - :type value: str - """ - - allowed_values = { - "team", - "organization", - } - TEAM: ClassVar["TeamSyncSelectionStateExternalIdType"] - ORGANIZATION: ClassVar["TeamSyncSelectionStateExternalIdType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamSyncSelectionStateExternalIdType.TEAM = TeamSyncSelectionStateExternalIdType("team") -TeamSyncSelectionStateExternalIdType.ORGANIZATION = TeamSyncSelectionStateExternalIdType("organization") diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_item.py b/src/datadog_api_client/v2/model/team_sync_selection_state_item.py deleted file mode 100644 index c548f3f103..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_item.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId - from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation - from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope - - -class TeamSyncSelectionStateItem(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId - from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation - from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope - - return { - "external_id": (TeamSyncSelectionStateExternalId,), - "operation": (TeamSyncSelectionStateOperation,), - "scope": (TeamSyncSelectionStateScope,), - } - - attribute_map = { - "external_id": "external_id", - "operation": "operation", - "scope": "scope", - } - - def __init__( - self_, - external_id: TeamSyncSelectionStateExternalId, - operation: Union[TeamSyncSelectionStateOperation, UnsetType] = unset, - scope: Union[TeamSyncSelectionStateScope, UnsetType] = unset, - **kwargs, - ): - """ - Identifies a team or organization hierarchy to include in synchronization. - - :param external_id: The external identifier for a team or organization in the source platform. - :type external_id: TeamSyncSelectionStateExternalId - - :param operation: The operation to perform on the selected hierarchy. - When set to ``include`` , synchronization covers the - referenced teams or organizations. - :type operation: TeamSyncSelectionStateOperation, optional - - :param scope: The scope of the selection. When set to ``subtree`` , - synchronization includes the referenced team or - organization and everything nested under it. - :type scope: TeamSyncSelectionStateScope, optional - """ - if operation is not unset: - kwargs["operation"] = operation - if scope is not unset: - kwargs["scope"] = scope - super().__init__(kwargs) - - self_.external_id = external_id diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py b/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py deleted file mode 100644 index f5068c4811..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 TeamSyncSelectionStateOperation(ModelSimple): - """ - The operation to perform on the selected hierarchy. - When set to `include`, synchronization covers the - referenced teams or organizations. - - :param value: If omitted defaults to "include". Must be one of ["include"]. - :type value: str - """ - - allowed_values = { - "include", - } - INCLUDE: ClassVar["TeamSyncSelectionStateOperation"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamSyncSelectionStateOperation.INCLUDE = TeamSyncSelectionStateOperation("include") diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py b/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py deleted file mode 100644 index 5518b78d8e..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 TeamSyncSelectionStateScope(ModelSimple): - """ - The scope of the selection. When set to `subtree`, - synchronization includes the referenced team or - organization and everything nested under it. - - :param value: If omitted defaults to "subtree". Must be one of ["subtree"]. - :type value: str - """ - - allowed_values = { - "subtree", - } - SUBTREE: ClassVar["TeamSyncSelectionStateScope"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamSyncSelectionStateScope.SUBTREE = TeamSyncSelectionStateScope("subtree") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0a5073a5ba..1fca8f4351 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6209,11 +6209,6 @@ 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_sync_response import TeamSyncResponse -from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId -from datadog_api_client.v2.model.team_sync_selection_state_external_id_type import TeamSyncSelectionStateExternalIdType -from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem -from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation -from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope 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 @@ -10943,11 +10938,6 @@ "TeamSyncData", "TeamSyncRequest", "TeamSyncResponse", - "TeamSyncSelectionStateExternalId", - "TeamSyncSelectionStateExternalIdType", - "TeamSyncSelectionStateItem", - "TeamSyncSelectionStateOperation", - "TeamSyncSelectionStateScope", "TeamTarget", "TeamTargetType", "TeamType", diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen deleted file mode 100644 index 1332175b3b..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2026-03-04T16:01:00.945Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml deleted file mode 100644 index 32050b75d8..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml +++ /dev/null @@ -1,18 +0,0 @@ -interactions: -- request: - body: null - headers: - accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/team/sync?filter%5Bsource%5D=github - response: - body: - string: '{"data":[{"id":"3d33cc55-aea4-4801-bb75-139d347298c9","type":"team_sync_bulk","attributes":{"frequency":"once","selection_state":[{"external_id":{"type":"organization","value":"1"},"operation":"include","scope":"subtree"}],"source":"github","sync_membership":false,"type":"link"}}]}' - headers: - content-type: - - application/vnd.api+json - status: - code: 200 - message: OK -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen deleted file mode 100644 index 8e230ad671..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2026-03-04T16:01:34.366Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen new file mode 100644 index 0000000000..8723edd4fb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-15T17:48:19.712Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml similarity index 51% rename from tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml rename to tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml index 2c763c4501..53217b4c1c 100644 --- a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"selection_state":[{"external_id":{"type":"organization","value":"1"}}],"source":"github","type":"link"},"type":"team_sync_bulk"}}' + body: '{"data":{"attributes":{"source":"github","type":"link"},"type":"team_sync_bulk"}}' headers: accept: - '*/*' @@ -11,8 +11,10 @@ interactions: response: body: string: '' - headers: {} + headers: + content-type: + - text/plain status: - code: 204 - message: No Content + code: 200 + message: OK version: 1 diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index 480e3215e9..26bf0130d4 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -431,13 +431,20 @@ Feature: Teams Then the response status is 200 OK And the response "data" has length 1 - @team:DataDog/aaa-omg + @generated @skip @team:DataDog/aaa-omg Scenario: Get team sync configurations returns "OK" response Given new "GetTeamSync" request - And request contains "filter[source]" parameter with value "github" + And request contains "filter[source]" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team sync configurations returns "Team sync configurations not found" response + Given new "GetTeamSync" request + And request contains "filter[source]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Team sync configurations not found + @generated @skip @team:DataDog/aaa-omg Scenario: Get user memberships returns "API error response." response Given new "GetUserMemberships" request @@ -454,13 +461,6 @@ Feature: Teams Then the response status is 200 Represents a user's association to a team And the response "data" has length 0 - @team:DataDog/aaa-omg - Scenario: Link Teams with GitHub Teams returns "No Content" response - Given new "SyncTeams" request - And body with value {"data": {"attributes": {"source": "github", "type": "link", "selection_state": [{"external_id": {"type": "organization", "value": "1"}}]}, "type": "team_sync_bulk"}} - When the request is sent - Then the response status is 204 No Content - @generated @skip @team:DataDog/aaa-omg Scenario: Link Teams with GitHub Teams returns "OK" response Given new "SyncTeams" request @@ -582,6 +582,13 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @replay-only @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