Skip to content

Add TeamsChannelAccount type for Teams-specific APIs#230

Merged
heyitsaamir merged 4 commits into
mainfrom
copilot/port-similar-changes
Dec 3, 2025
Merged

Add TeamsChannelAccount type for Teams-specific APIs#230
heyitsaamir merged 4 commits into
mainfrom
copilot/port-similar-changes

Conversation

Copilot AI commented Dec 2, 2025

Copy link
Copy Markdown
Contributor
  • Add TeamsChannelAccount class to models/account.py with Teams-specific properties (objectId, givenName, surname, email, userPrincipalName, tenantId)
  • Export TeamsChannelAccount in models/init.py
  • Update MeetingInfo.organizer type from Account to TeamsChannelAccount
  • Update MeetingParticipant.user type from Account to TeamsChannelAccount
  • Update meeting participant event activity user type from Account to TeamsChannelAccount
  • Update ConversationMemberClient methods to return TeamsChannelAccount instead of Account
  • Update example card function to accept both Account and TeamsChannelAccount
  • Add tests for the TeamsChannelAccount return type in existing test_conversation_client.py
  • Add field deserialization assertions in tests to validate objectId mapping
  • Fix alphabetical ordering of TeamsChannelAccount in all exports
  • Run linting, type checking, and tests
Original prompt

Can you port similar changes from microsoft/teams.ts#409 to our repo?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Port changes from teams.ts PR 409 to our repo Add TeamsChannelAccount type for Teams-specific APIs Dec 2, 2025
Copilot AI requested a review from heyitsaamir December 2, 2025 20:39
Comment thread packages/api/tests/unit/test_teams_channel_account.py Outdated

Copilot AI commented Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

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:

  • login.microsoftonline.com
    • Triggering command: /home/REDACTED/work/teams.py/teams.py/.venv/bin/pytest pytest packages -x (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from heyitsaamir December 2, 2025 21:09
@heyitsaamir
heyitsaamir marked this pull request as ready for review December 2, 2025 23:28
Copilot AI review requested due to automatic review settings December 2, 2025 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 TeamsChannelAccount model class with Teams-specific fields for Azure AD user information
  • Updated conversation member client methods to return TeamsChannelAccount instead of Account
  • Updated meeting-related models (MeetingInfo, MeetingParticipant) to use TeamsChannelAccount for user properties
  • Maintained backward compatibility in example code by accepting both Account and TeamsChannelAccount types

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

Comment thread packages/api/src/microsoft/teams/api/models/account.py
Comment thread packages/api/src/microsoft/teams/api/models/account.py
Comment thread packages/api/tests/unit/test_conversation_client.py
Comment thread packages/api/src/microsoft/teams/api/models/__init__.py Outdated

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

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:

  • login.microsoftonline.com
    • Triggering command: /home/REDACTED/work/teams.py/teams.py/.venv/bin/pytest pytest packages -x (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@heyitsaamir
heyitsaamir merged commit b61f257 into main Dec 3, 2025
11 checks passed
@heyitsaamir
heyitsaamir deleted the copilot/port-similar-changes branch December 3, 2025 22:23
@heyitsaamir heyitsaamir mentioned this pull request Dec 9, 2025
heyitsaamir added a commit that referenced this pull request Dec 9, 2025
## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants