Skip to content

TeamsChannelAccount required for certain APIs#409

Merged
heyitsaamir merged 2 commits into
mainfrom
mehak/account
Dec 2, 2025
Merged

TeamsChannelAccount required for certain APIs#409
heyitsaamir merged 2 commits into
mainfrom
mehak/account

Conversation

@MehakBindra

@MehakBindra MehakBindra commented Nov 27, 2025

Copy link
Copy Markdown
Member

fixes #408
Teams uses two different account schemes depending on the API, this PR updates the type definitions so that conversation.members and meetingInfo/meetingParticipant APIs return TeamsChannelAccount instead of the generic Account

Comment thread packages/api/src/models/account.ts

Copilot AI commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@heyitsaamir I've opened a new pull request, #412, to work on those changes. Once the pull request is ready, I'll request review from you.

- [x] Add JSDoc documentation for TeamsChannelAccount type
- Added type-level documentation with @see link to Microsoft
documentation
- Added @member documentation for each property (id, name, objectId,
userRole, givenName, surname, email, userPrincipalName, tenantId,
properties)

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/teams.ts/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: heyitsaamir <[email protected]>
@heyitsaamir
heyitsaamir merged commit a8986a4 into main Dec 2, 2025
10 checks passed
@heyitsaamir
heyitsaamir deleted the mehak/account branch December 2, 2025 20:21
Copilot AI added a commit to microsoft/teams.net that referenced this pull request Dec 3, 2025
…ific endpoints

Port from microsoft/teams.ts#409:
- Add TeamsChannelAccount class with Teams-specific properties (givenName, surname, email, userPrincipalName, tenantId, objectId)
- Update MemberClient.GetAsync() and GetByIdAsync() to return TeamsChannelAccount
- Update MeetingParticipantJoinActivity and MeetingParticipantLeaveActivity to use TeamsChannelAccount for user property
- Update Meeting.Organizer to use TeamsChannelAccount
- Update MeetingParticipant.User to use TeamsChannelAccount
- Update related tests

Co-authored-by: heyitsaamir <[email protected]>
heyitsaamir added a commit to microsoft/teams.py that referenced this pull request Dec 3, 2025
- [x] Add `TeamsChannelAccount` class to models/account.py with
Teams-specific properties (objectId, givenName, surname, email,
userPrincipalName, tenantId)
- [x] Export `TeamsChannelAccount` in models/__init__.py
- [x] Update `MeetingInfo.organizer` type from `Account` to
`TeamsChannelAccount`
- [x] Update `MeetingParticipant.user` type from `Account` to
`TeamsChannelAccount`
- [x] Update meeting participant event activity `user` type from
`Account` to `TeamsChannelAccount`
- [x] Update `ConversationMemberClient` methods to return
`TeamsChannelAccount` instead of `Account`
- [x] Update example card function to accept both `Account` and
`TeamsChannelAccount`
- [x] Add tests for the `TeamsChannelAccount` return type in existing
test_conversation_client.py
- [x] Add field deserialization assertions in tests to validate objectId
mapping
- [x] Fix alphabetical ordering of TeamsChannelAccount in __all__
exports
- [x] Run linting, type checking, and tests

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> Can you port similar changes from <a
href="microsoft/teams.ts#409" rel="noreferrer
noopener" title="microsoft/teams.ts#409"
target="_blank">https://github.com/microsoft/teams.ts/pull/409</a> to
our repo? <attachment
id="app-preview-card-psf3b9ee691abc4115832b83494d0ddda8"></attachment>


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/teams.py/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: heyitsaamir <[email protected]>
Copilot AI added a commit to microsoft/teams.net that referenced this pull request Dec 4, 2025
…ccount

Port changes from microsoft/teams.ts#409:
- Add TeamsChannelAccount class extending Account with Teams-specific properties
  (givenName, surname, email, userPrincipalName, tenantId)
- Update MemberClient.GetAsync() and GetByIdAsync() to return TeamsChannelAccount
- Update Meeting.Organizer to use TeamsChannelAccount
- Update MeetingParticipant.User to use TeamsChannelAccount
- Update MeetingParticipantJoinActivity and MeetingParticipantLeaveActivity
  Member.User to use TeamsChannelAccount
- Update corresponding unit tests to use TeamsChannelAccount

Co-authored-by: heyitsaamir <[email protected]>
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.

[Bug]: type definition for Account is either wrong or context.api.conversations.members.get has wrong return type

4 participants