diff --git a/packages/api/src/microsoft/teams/api/models/account.py b/packages/api/src/microsoft/teams/api/models/account.py index 29f5c9f5..2f3ddf8e 100644 --- a/packages/api/src/microsoft/teams/api/models/account.py +++ b/packages/api/src/microsoft/teams/api/models/account.py @@ -3,9 +3,10 @@ Licensed under the MIT License. """ -from typing import Any, Dict, Literal, Optional +from typing import Any, Dict, List, Literal, Optional from .custom_base_model import CustomBaseModel +from .membership_source import MembershipSource AccountRole = Literal["user", "bot"] @@ -35,6 +36,7 @@ class Account(CustomBaseModel): """ The name of the account. """ + membershipSources: Optional[List[MembershipSource]] = None class ConversationAccount(CustomBaseModel): diff --git a/packages/api/src/microsoft/teams/api/models/channel_data/__init__.py b/packages/api/src/microsoft/teams/api/models/channel_data/__init__.py index dd960c93..ba3599b3 100644 --- a/packages/api/src/microsoft/teams/api/models/channel_data/__init__.py +++ b/packages/api/src/microsoft/teams/api/models/channel_data/__init__.py @@ -3,11 +3,22 @@ Licensed under the MIT License. """ +from .app_info import AppInfo from .channel_data import ChannelData from .channel_info import ChannelInfo from .notification_info import NotificationInfo +from .on_behalf_of import OnBehalfOf from .settings import ChannelDataSettings from .team_info import TeamInfo from .tenant_info import TenantInfo -__all__ = ["ChannelInfo", "NotificationInfo", "ChannelDataSettings", "TeamInfo", "TenantInfo", "ChannelData"] +__all__ = [ + "ChannelInfo", + "NotificationInfo", + "ChannelDataSettings", + "TeamInfo", + "TenantInfo", + "ChannelData", + "AppInfo", + "OnBehalfOf", +] diff --git a/packages/api/src/microsoft/teams/api/models/channel_data/app_info.py b/packages/api/src/microsoft/teams/api/models/channel_data/app_info.py new file mode 100644 index 00000000..a65c04d2 --- /dev/null +++ b/packages/api/src/microsoft/teams/api/models/channel_data/app_info.py @@ -0,0 +1,20 @@ +""" +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the MIT License. +""" + +from typing import Optional + +from ..custom_base_model import CustomBaseModel + + +class AppInfo(CustomBaseModel): + """ + An app info object that describes an app + """ + + id: str + "Unique identifier representing an app" + + version: Optional[str] = None + "Version of the app manifest." diff --git a/packages/api/src/microsoft/teams/api/models/channel_data/channel_data.py b/packages/api/src/microsoft/teams/api/models/channel_data/channel_data.py index 216d56e0..0529b866 100644 --- a/packages/api/src/microsoft/teams/api/models/channel_data/channel_data.py +++ b/packages/api/src/microsoft/teams/api/models/channel_data/channel_data.py @@ -3,12 +3,15 @@ Licensed under the MIT License. """ -from typing import Literal, Optional +from typing import List, Literal, Optional from ..custom_base_model import CustomBaseModel from ..meetings import MeetingInfo +from ..membership_source import MembershipSource +from .app_info import AppInfo from .channel_info import ChannelInfo from .notification_info import NotificationInfo +from .on_behalf_of import OnBehalfOf from .settings import ChannelDataSettings from .team_info import TeamInfo from .tenant_info import TenantInfo @@ -54,3 +57,20 @@ class ChannelData(CustomBaseModel): Sequence number of the message in the stream. Starts at 1 for the first message and increments from there. """ + + on_behalf_of: Optional[List[OnBehalfOf]] = None + """Information about the users on behalf of whom the action is performed.""" + + shared_with_teams: Optional[List[TeamInfo]] = None + """List of teams that a channel was shared with.""" + + unshared_from_teams: Optional[List[TeamInfo]] = None + """List of teams that a channel was unshared from.""" + + membership_source: Optional[MembershipSource] = None + """Information about the source of the member that was added or removed froma shared channel.""" + + app: Optional[AppInfo] = None + """ + Information about the app sending this activity. + """ diff --git a/packages/api/src/microsoft/teams/api/models/channel_data/on_behalf_of.py b/packages/api/src/microsoft/teams/api/models/channel_data/on_behalf_of.py new file mode 100644 index 00000000..7b7ed008 --- /dev/null +++ b/packages/api/src/microsoft/teams/api/models/channel_data/on_behalf_of.py @@ -0,0 +1,26 @@ +""" +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the MIT License. +""" + +from typing import Optional + +from ..custom_base_model import CustomBaseModel + + +class OnBehalfOf(CustomBaseModel): + """ + Represents information about a user on behalf of whom an action is performed. + """ + + item_id: int = 0 + "The ID of the item." + + mention_type: str + "The type of mention." + + mri: str + "The Microsoft Resource Identifier (MRI) of the user." + + display_name: Optional[str] = None + "The display name of the user." diff --git a/packages/api/src/microsoft/teams/api/models/channel_data/team_info.py b/packages/api/src/microsoft/teams/api/models/channel_data/team_info.py index e873bf37..e2970fb9 100644 --- a/packages/api/src/microsoft/teams/api/models/channel_data/team_info.py +++ b/packages/api/src/microsoft/teams/api/models/channel_data/team_info.py @@ -20,7 +20,10 @@ class TeamInfo(CustomBaseModel): name: Optional[str] = None "Name of team." - team_type: Optional[Literal["standard", "sharedChannel", "privateChannel"]] = None + tenant_id: Optional[str] = None + "The tenant ID for the team." + + type: Optional[Literal["standard", "sharedChannel", "privateChannel"]] = None "The type of the team" member_count: Optional[int] = None diff --git a/packages/api/src/microsoft/teams/api/models/membership_source.py b/packages/api/src/microsoft/teams/api/models/membership_source.py new file mode 100644 index 00000000..6d88166d --- /dev/null +++ b/packages/api/src/microsoft/teams/api/models/membership_source.py @@ -0,0 +1,29 @@ +""" +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the MIT License. +""" + +from typing import Literal + +from .custom_base_model import CustomBaseModel + + +class MembershipSource(CustomBaseModel): + """ + Represents the source of a membership. + """ + + id: str + "The unique identifier for the membership source." + + sourceType: Literal["channel", "team"] + "The type of roster the user is a member of." + + membershipType: Literal["direct", "transitive"] + "The user's relationship to the current channel." + + tenantId: str + "The tenant ID of the user." + + teamGroupId: str + "The group ID of the team associated with this membership source."