From 7c8e5660acf3803987dc21bf0136b30860cb015c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 6 Mar 2026 10:40:37 +0000 Subject: [PATCH] Regenerate client from commit 988555f of spec repo --- .generator/schemas/v2/openapi.yaml | 98 +++++++++++++++++-- docs/datadog_api_client.v2.model.rst | 35 +++++++ examples/v2/teams/SyncTeams_3215592344.py | 27 ----- src/datadog_api_client/v2/api/teams_api.py | 4 + .../v2/model/team_sync_attributes.py | 14 ++- .../team_sync_selection_state_external_id.py | 55 +++++++++++ ...m_sync_selection_state_external_id_type.py | 40 ++++++++ .../model/team_sync_selection_state_item.py | 70 +++++++++++++ .../team_sync_selection_state_operation.py | 37 +++++++ .../model/team_sync_selection_state_scope.py | 37 +++++++ src/datadog_api_client/v2/models/__init__.py | 10 ++ ..._configurations_returns_ok_response.frozen | 1 + ...nc_configurations_returns_ok_response.yaml | 18 ++++ ...b_teams_returns_no_content_response.frozen | 1 + ...ub_teams_returns_no_content_response.yaml} | 10 +- ...test_sync_teams_returns_ok_response.frozen | 1 - tests/v2/features/teams.feature | 25 ++--- 17 files changed, 426 insertions(+), 57 deletions(-) delete mode 100644 examples/v2/teams/SyncTeams_3215592344.py create mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py create mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py create mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_item.py create mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_operation.py create mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_scope.py create mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen rename tests/v2/cassettes/test_scenarios/{test_sync_teams_returns_ok_response.yaml => test_link_teams_with_github_teams_returns_no_content_response.yaml} (51%) delete mode 100644 tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3c804abe22..051a589536 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -68031,6 +68031,8 @@ components: properties: frequency: $ref: '#/components/schemas/TeamSyncAttributesFrequency' + selection_state: + $ref: '#/components/schemas/TeamSyncAttributesSelectionState' source: $ref: '#/components/schemas/TeamSyncAttributesSource' sync_membership: @@ -68054,6 +68056,15 @@ 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. @@ -68126,6 +68137,78 @@ 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. @@ -107597,12 +107680,6 @@ 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: @@ -107634,6 +107711,13 @@ paths: 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. @@ -107655,6 +107739,8 @@ 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 e2c6c0447f..45d717fe1c 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -29929,6 +29929,41 @@ 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 deleted file mode 100644 index 18e47d2f42..0000000000 --- a/examples/v2/teams/SyncTeams_3215592344.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -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 e5b6af700e..f99db06547 100644 --- a/src/datadog_api_client/v2/api/teams_api.py +++ b/src/datadog_api_client/v2/api/teams_api.py @@ -1979,6 +1979,10 @@ def sync_teams( 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 fe18232f01..431ae8de98 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 Union, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,6 +15,7 @@ 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 @@ -23,11 +24,13 @@ 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,), @@ -35,6 +38,7 @@ def openapi_types(_): attribute_map = { "frequency": "frequency", + "selection_state": "selection_state", "source": "source", "sync_membership": "sync_membership", "type": "type", @@ -45,6 +49,7 @@ 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, ): @@ -54,6 +59,11 @@ 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 @@ -65,6 +75,8 @@ 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 new file mode 100644 index 0000000000..b36dd1e491 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py @@ -0,0 +1,55 @@ +# 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 new file mode 100644 index 0000000000..68d4e2c90e --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.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 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 new file mode 100644 index 0000000000..c548f3f103 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_selection_state_item.py @@ -0,0 +1,70 @@ +# 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 new file mode 100644 index 0000000000..f5068c4811 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py @@ -0,0 +1,37 @@ +# 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 new file mode 100644 index 0000000000..5518b78d8e --- /dev/null +++ b/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py @@ -0,0 +1,37 @@ +# 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 6b9a7bec23..a5a8d714f4 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6080,6 +6080,11 @@ 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 @@ -10722,6 +10727,11 @@ "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 new file mode 100644 index 0000000000..1332175b3b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000000..32050b75d8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml @@ -0,0 +1,18 @@ +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 new file mode 100644 index 0000000000..8e230ad671 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen @@ -0,0 +1 @@ +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.yaml b/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml similarity index 51% rename from tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml rename to tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml index 53217b4c1c..2c763c4501 100644 --- a/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"source":"github","type":"link"},"type":"team_sync_bulk"}}' + body: '{"data":{"attributes":{"selection_state":[{"external_id":{"type":"organization","value":"1"}}],"source":"github","type":"link"},"type":"team_sync_bulk"}}' headers: accept: - '*/*' @@ -11,10 +11,8 @@ interactions: response: body: string: '' - headers: - content-type: - - text/plain + headers: {} status: - code: 200 - message: OK + code: 204 + message: No Content version: 1 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 deleted file mode 100644 index 8723edd4fb..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-08-15T17:48:19.712Z \ No newline at end of file diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index 26bf0130d4..480e3215e9 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -431,20 +431,13 @@ Feature: Teams Then the response status is 200 OK And the response "data" has length 1 - @generated @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Get team sync configurations returns "OK" response Given new "GetTeamSync" request - And request contains "filter[source]" parameter from "REPLACE.ME" + And request contains "filter[source]" parameter with value "github" 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 @@ -461,6 +454,13 @@ 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,13 +582,6 @@ 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