Skip to content
Merged
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
3 changes: 3 additions & 0 deletions packages/api/src/microsoft/teams/api/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
from .bot import __all__ as bot_all
from .conversation import * # noqa: F403
from .conversation import __all__ as conversation_all
from .meeting import * # noqa: F403
from .meeting import __all__ as meeting_all
from .user import * # noqa: F403
from .user import __all__ as user_all

__all__ = [
*conversation_all,
*user_all,
*bot_all,
*meeting_all,
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""

from .client import MeetingClient

__all__ = ["MeetingClient"]
57 changes: 57 additions & 0 deletions packages/api/src/microsoft/teams/api/clients/meeting/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""

from typing import Optional, Union

from microsoft.teams.common.http import Client, ClientOptions

from ...models import MeetingInfo, MeetingParticipant
from ..base_client import BaseClient


class MeetingClient(BaseClient):
"""Client for managing Teams meetings."""

def __init__(
self,
service_url: str,
options: Optional[Union[Client, ClientOptions]] = None,
) -> None:
"""
Initialize the MeetingClient.

Args:
service_url: The service URL for API calls.
options: Optional Client or ClientOptions instance. If not provided, a default Client will be created.
"""
super().__init__(options)
self.service_url = service_url

async def get_by_id(self, id: str) -> MeetingInfo:
"""
Get meeting information by ID.

Args:
id: The meeting ID.

Returns:
The meeting information.
"""
response = await self.http.get(f"{self.service_url}/v1/meetings/{id}")
return MeetingInfo.model_validate(response.json())

async def get_participant(self, meeting_id: str, id: str) -> MeetingParticipant:
"""
Get meeting participant information.

Args:
meeting_id: The meeting ID.
id: The participant ID.

Returns:
The meeting participant information.
"""
response = await self.http.get(f"{self.service_url}/v1/meetings/{meeting_id}/participants/{id}")
return MeetingParticipant.model_validate(response.json())
3 changes: 2 additions & 1 deletion packages/api/src/microsoft/teams/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Licensed under the MIT License.
"""

from .account import Account, AccountRole
from .account import Account, AccountRole, ConversationAccount
from .action import Action
from .activity import Activity
from .adaptive_card import * # noqa: F403
Expand Down Expand Up @@ -57,6 +57,7 @@
"Account",
"Activity",
"AccountRole",
"ConversationAccount",
"ChannelID",
*conversation_all,
*sign_in_all,
Expand Down
27 changes: 27 additions & 0 deletions packages/api/src/microsoft/teams/api/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,30 @@ class Account(CustomBaseModel):
"""
Additional properties for the account.
"""


class ConversationAccount(CustomBaseModel):
"""
Represents a Teams conversation account.
"""

id: str
"""
The unique identifier for the conversation.
"""
tenant_id: Optional[str] = None
"""
The tenant ID for the conversation.
"""
conversation_type: str
"""
The type of conversation (personal, groupChat, etc.).
"""
name: Optional[str] = None
"""
The name of the conversation.
"""
is_group: Optional[bool] = None
"""
Whether this is a group conversation.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@

from typing import Optional

from ..account import Account, ConversationAccount
from ..custom_base_model import CustomBaseModel
from .meeting_details import MeetingDetails


# Placeholder for external types
class Account(CustomBaseModel):
"""Placeholder for Account model from ../account"""

pass


class ConversationAccount(CustomBaseModel):
"""Placeholder for ConversationAccount model from ../account"""

pass


class MeetingInfo(CustomBaseModel):
"""
General information about a Teams meeting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@

from typing import Optional

from ..account import Account, ConversationAccount
from ..custom_base_model import CustomBaseModel
from .meeting import Meeting


# Placeholder for external types
class Account(CustomBaseModel):
"""Placeholder for Account model from ../account"""

pass


class ConversationAccount(CustomBaseModel):
"""Placeholder for ConversationAccount model from ../account"""

pass


class MeetingParticipant(CustomBaseModel):
"""
Teams meeting participant detailing user Azure Active Directory details.
Expand Down