Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/api/src/microsoft/teams/api/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -35,6 +36,7 @@ class Account(CustomBaseModel):
"""
The name of the account.
"""
membershipSources: Optional[List[MembershipSource]] = None


Comment on lines 40 to 41
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The membershipSources field is missing a docstring. Add a comment or docstring explaining its purpose, consistent with the documentation style used for other fields in this class.

Suggested change
"""
The sources that provide membership information for the account.
"""

Copilot uses AI. Check for mistakes.
class ConversationAccount(CustomBaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."""
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spacing in 'froma' to 'from a'.

Suggested change
"""Information about the source of the member that was added or removed froma shared channel."""
"""Information about the source of the member that was added or removed from a shared channel."""

Copilot uses AI. Check for mistakes.

app: Optional[AppInfo] = None
"""
Information about the app sending this activity.
"""
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions packages/api/src/microsoft/teams/api/models/membership_source.py
Original file line number Diff line number Diff line change
@@ -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."