Skip to content

feat(people): add get_profile_by_xuid method#108

Open
misiektoja wants to merge 1 commit intotr4nt0r:mainfrom
misiektoja:get_profile_by_xuid
Open

feat(people): add get_profile_by_xuid method#108
misiektoja wants to merge 1 commit intotr4nt0r:mainfrom
misiektoja:get_profile_by_xuid

Conversation

@misiektoja
Copy link
Contributor

Adds get_profile_by_xuid to PeopleProvider for single-user profile lookups using the /users/me/people/xuids({xuid}) endpoint.

Returns relationship metadata (isFriend, canBeFriended etc.) from the caller's perspective, useful for profile lookups and relationship checks.

@github-actions github-actions bot added the 🧪 testing Pull request that adds tests label Mar 2, 2026
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.35%. Comparing base (d03cead) to head (247b873).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
+ Coverage   88.31%   88.35%   +0.03%     
==========================================
  Files          54       54              
  Lines        2868     2876       +8     
==========================================
+ Hits         2533     2541       +8     
  Misses        335      335              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@tr4nt0r tr4nt0r left a comment

Choose a reason for hiding this comment

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

Looks really good, just a little comment

resp.raise_for_status()
return PeopleResponse.model_validate_json(resp.text)

async def get_profile_by_xuid(self, xuid: str, decoration_fields: list[PeopleDecoration] | None = None, **kwargs) -> PeopleResponse:
Copy link
Owner

Choose a reason for hiding this comment

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

I just realized that in the profile provider we already have a get_profile_by_xuid, so in terms of Xbox API profile seems to be a different thing. What do you think of get_friend_by_xuid (singular)? That should make clear that it returns only a single friend with the same data as the other get_friends_* methods

Suggested change
async def get_profile_by_xuid(self, xuid: str, decoration_fields: list[PeopleDecoration] | None = None, **kwargs) -> PeopleResponse:
async def get_friend_by_xuid(self, xuid: str, decoration_fields: list[PeopleDecoration] | None = None, **kwargs) -> PeopleResponse:

@tr4nt0r tr4nt0r added 🚀 feature New feature or request and removed 🧪 testing Pull request that adds tests labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants