Skip to content

Commit

Permalink
implement Organization.team_count
Browse files Browse the repository at this point in the history
  • Loading branch information
ShineyDev committed Jan 25, 2025
1 parent f4c0ca0 commit 6be56ab
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions github/organization/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def _from_data(
"is_viewer_following": "viewerIsFollowing",
"is_viewer_member": "viewerIsAMember",
"mannequin_count": "mannequins{totalCount}",
"team_count": "teams{totalCount}",
"twitter_username": "twitterUsername",
"updated_at": "updatedAt",
}
Expand Down Expand Up @@ -324,6 +325,19 @@ def mannequin_count(

return self._data["mannequins"]["totalCount"]

@property
def team_count(
self: Self,
/,
) -> int:
"""
The number of teams in the organization.
:type: :class:`int`
"""

return self._data["teams"]["totalCount"]

@property
def twitter_username(
self: Self,
Expand Down Expand Up @@ -612,6 +626,28 @@ async def fetch_mannequin_count(

return await self._fetch_field("mannequins{totalCount}") # type: ignore

async def fetch_team_count(
self: Self,
/,
) -> int:
"""
|coro|
Fetches the number of teams in the organization.
Raises
------
~github.core.errors.ClientObjectMissingFieldError
The :attr:`id` attribute is missing.
:rtype: :class:`int`
"""

return await self._fetch_field("teams{totalCount}") # type: ignore

async def fetch_twitter_username(
self: Self,
/,
Expand Down

0 comments on commit 6be56ab

Please sign in to comment.