Skip to content

Commit

Permalink
implement Organization.mannequin_count
Browse files Browse the repository at this point in the history
  • Loading branch information
ShineyDev committed Jan 25, 2025
1 parent e0b845e commit f4c0ca0
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 @@ -161,6 +161,7 @@ def _from_data(
"is_verified": "isVerified",
"is_viewer_following": "viewerIsFollowing",
"is_viewer_member": "viewerIsAMember",
"mannequin_count": "mannequins{totalCount}",
"twitter_username": "twitterUsername",
"updated_at": "updatedAt",
}
Expand Down Expand Up @@ -310,6 +311,19 @@ def is_viewer_member(

return self._data["viewerIsAMember"]

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

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

@property
def twitter_username(
self: Self,
Expand Down Expand Up @@ -576,6 +590,28 @@ async def fetch_is_viewer_member(

return await self._fetch_field("viewerIsAMember") # type: ignore

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

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

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

0 comments on commit f4c0ca0

Please sign in to comment.