Add TeamsChannelAccount type for Teams-specific APIs#230
Conversation
Co-authored-by: heyitsaamir <[email protected]>
Co-authored-by: heyitsaamir <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR ports changes from the TypeScript Teams SDK to add a new TeamsChannelAccount type that provides Teams-specific user properties beyond the basic Account type. The TeamsChannelAccount includes fields like aad_object_id, given_name, surname, email, user_principal_name, and tenant_id that are specific to Microsoft Teams conversations. These changes align the Python SDK with the Bot Framework Schema's TeamsChannelAccount type and update all Teams-specific APIs to return this richer type instead of the basic Account.
Key changes:
- Added
TeamsChannelAccountmodel class with Teams-specific fields for Azure AD user information - Updated conversation member client methods to return
TeamsChannelAccountinstead ofAccount - Updated meeting-related models (
MeetingInfo,MeetingParticipant) to useTeamsChannelAccountfor user properties - Maintained backward compatibility in example code by accepting both
AccountandTeamsChannelAccounttypes
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/api/src/microsoft/teams/api/models/account.py | Adds new TeamsChannelAccount class with Teams-specific properties (AAD object ID, given name, surname, email, UPN, tenant ID) |
| packages/api/src/microsoft/teams/api/models/init.py | Exports TeamsChannelAccount for public API usage |
| packages/api/src/microsoft/teams/api/clients/conversation/member.py | Updates ConversationMemberClient methods to return TeamsChannelAccount instead of Account |
| packages/api/src/microsoft/teams/api/models/meetings/meeting_info.py | Changes MeetingInfo.organizer type from Account to TeamsChannelAccount |
| packages/api/src/microsoft/teams/api/models/meetings/meeting_participant.py | Changes MeetingParticipant.user type from Account to TeamsChannelAccount |
| packages/api/src/microsoft/teams/api/activities/event/meeting_participant.py | Updates meeting participant event activity user type to TeamsChannelAccount |
| examples/message-extensions/src/cards.py | Updates function signature to accept both Account and TeamsChannelAccount for backward compatibility |
| packages/api/tests/unit/test_conversation_client.py | Adds type assertions to verify TeamsChannelAccount instances are returned from member operations |
Co-authored-by: heyitsaamir <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
## Release 2.0.0a7 ### Changes - update react and react-dom to 19.2.1 (#233) - Move to microsoft_teams namespace (#226) - Simplify setting http response after activity processing (#218) - Add TeamsChannelAccount type for Teams-specific APIs (#230) - Updating mcpplugin reference in README.md (#229) - Bring back bot builder example (#225) - Fix choices_data alias to use "choices.data" instead of "choicesData" (#224) - [docs] botbuilder package README fixes (#223) - Fix calling AI functions with no parameters (#221)
TeamsChannelAccountclass to models/account.py with Teams-specific properties (objectId, givenName, surname, email, userPrincipalName, tenantId)TeamsChannelAccountin models/init.pyMeetingInfo.organizertype fromAccounttoTeamsChannelAccountMeetingParticipant.usertype fromAccounttoTeamsChannelAccountusertype fromAccounttoTeamsChannelAccountConversationMemberClientmethods to returnTeamsChannelAccountinstead ofAccountAccountandTeamsChannelAccountTeamsChannelAccountreturn type in existing test_conversation_client.pyOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.