diff --git a/libraries/botbuilder-core/tests/teams/test_teams_channel_data.py b/libraries/botbuilder-core/tests/teams/test_teams_channel_data.py new file mode 100644 index 000000000..e468526bc --- /dev/null +++ b/libraries/botbuilder-core/tests/teams/test_teams_channel_data.py @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import aiounittest + +from botbuilder.schema import Activity +from botbuilder.schema.teams import TeamsChannelData +from botbuilder.core.teams import teams_get_team_info + + +class TestTeamsChannelData(aiounittest.AsyncTestCase): + def test_teams_aad_group_id_deserialize(self): + # Arrange + raw_channel_data = {"team": {"aadGroupId": "teamGroup123"}} + + # Act + channel_data = TeamsChannelData().deserialize(raw_channel_data) + + # Assert + assert channel_data.team.aad_group_id == "teamGroup123" + + def test_teams_get_team_info(self): + # Arrange + activity = Activity(channel_data={"team": {"aadGroupId": "teamGroup123"}}) + + # Act + team_info = teams_get_team_info(activity) + + # Assert + assert team_info.aad_group_id == "teamGroup123" diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py b/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py index 7b82da917..c44c22c21 100644 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py +++ b/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py @@ -1508,17 +1508,21 @@ class TeamInfo(Model): :type id: str :param name: Name of team. :type name: str + :param name: Azure AD Teams group ID. + :type name: str """ _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, + "aad_group_id": {"key": "aadGroupId", "type": "str"}, } def __init__(self, **kwargs): super(TeamInfo, self).__init__(**kwargs) self.id = kwargs.get("id", None) self.name = kwargs.get("name", None) + self.aad_group_id = kwargs.get("aad_group_id", None) class TeamsChannelAccount(ChannelAccount): diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py index e8be1dc85..5a5db5174 100644 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py +++ b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py @@ -1773,17 +1773,23 @@ class TeamInfo(Model): :type id: str :param name: Name of team. :type name: str + :param name: Azure AD Teams group ID. + :type name: str """ _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, + "aad_group_id": {"key": "aadGroupId", "type": "str"}, } - def __init__(self, *, id: str = None, name: str = None, **kwargs) -> None: + def __init__( + self, *, id: str = None, name: str = None, aad_group_id: str = None, **kwargs + ) -> None: super(TeamInfo, self).__init__(**kwargs) self.id = id self.name = name + self.aad_group_id = aad_group_id class TeamsChannelAccount(ChannelAccount):