Skip to content

Commit 8183bbe

Browse files
committed
implement Milestone.closed_count, .open_count
1 parent 067085a commit 8183bbe

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

github/repository/milestone.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ class MilestoneData(
4040
):
4141
__typename: Literal["Milestone"]
4242

43+
closedIssueCount: int
4344
createdAt: str
4445
creator: BotData | UserData
4546
description: str | None
4647
descriptionHTML: str | None
4748
dueOn: str | None
4849
issues: ConnectionData[IssueData]
4950
number: int
51+
openIssueCount: int
5052
progressPercentage: float
5153
pullRequests: ConnectionData[PullData]
5254
state: MilestoneStateData
@@ -97,11 +99,13 @@ def _from_data(
9799
]
98100

99101
_graphql_fields = {
102+
"closed_count": "closedIssueCount",
100103
"created_at": "createdAt",
101104
"description": "description",
102105
"description_html": "descriptionHTML",
103106
"due_at": "dueOn",
104107
"number": "number",
108+
"open_count": "openIssueCount",
105109
"progress": "progressPercentage",
106110
"state": "state",
107111
"title": "title",
@@ -110,6 +114,20 @@ def _from_data(
110114

111115
_node_prefix = "MI"
112116

117+
@property
118+
def closed_count(
119+
self,
120+
/,
121+
) -> int:
122+
"""
123+
The number of closed issues and pull requests with the
124+
milestone.
125+
126+
:type: :class:`int`
127+
"""
128+
129+
return self._data["closedIssueCount"]
130+
113131
@property
114132
def created_at(
115133
self,
@@ -180,6 +198,19 @@ def number(
180198

181199
return self._data["number"]
182200

201+
@property
202+
def open_count(
203+
self,
204+
/,
205+
) -> int:
206+
"""
207+
The number of open issues and pull requests with the milestone.
208+
209+
:type: :class:`int`
210+
"""
211+
212+
return self._data["openIssueCount"]
213+
183214
@property
184215
def progress(
185216
self,

0 commit comments

Comments
 (0)