Skip to content

Commit 28a3884

Browse files
committed
Prep 8.2.0
1 parent b89a03f commit 28a3884

File tree

4 files changed

+68
-17
lines changed

4 files changed

+68
-17
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 8.2.0
2+
- add more fields to the PullRequest class and fixed JSON naming bugs
3+
- Added:
4+
- requestedReviewers
5+
- reviewCommentCount
6+
- milestone
7+
- rebaseable
8+
- mergeableState
9+
- maintainerCanModify
10+
- authorAssociation
11+
- Fixed (these were previously always null)
12+
- commentsCount
13+
- commitsCount
14+
- additionsCount
15+
- deletionsCount
16+
- changedFilesCount
17+
118
## 8.1.3
219
- Add per page parameter to stars related activities https://github.com/SpinlockLabs/github.dart/pull/265
320

lib/src/common/model/pulls.dart

+28-6
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@ class PullRequest {
2929
this.merged,
3030
this.mergeable,
3131
this.mergedBy,
32-
this.commentsCount,
33-
this.commitsCount,
34-
this.additionsCount,
35-
this.deletionsCount,
36-
this.changedFilesCount,
32+
this.commentsCount = 0,
33+
this.commitsCount = 0,
34+
this.additionsCount = 0,
35+
this.deletionsCount = 0,
36+
this.changedFilesCount = 0,
3737
this.labels,
3838
this.requestedReviewers,
39-
this.reviewCommentCount,
39+
this.reviewCommentCount = 0,
40+
this.milestone,
41+
this.rebaseable = false,
42+
this.mergeableState = '',
43+
this.maintainerCanModify = false,
44+
this.authorAssociation = '',
4045
});
4146

4247
/// Pull Request ID
@@ -98,18 +103,23 @@ class PullRequest {
98103
User? mergedBy;
99104

100105
/// Number of comments
106+
@JsonKey(name: 'comments')
101107
int? commentsCount;
102108

103109
/// Number of commits
110+
@JsonKey(name: 'commits')
104111
int? commitsCount;
105112

106113
/// Number of additions
114+
@JsonKey(name: 'additions')
107115
int? additionsCount;
108116

109117
/// Number of deletions
118+
@JsonKey(name: 'deletions')
110119
int? deletionsCount;
111120

112121
/// Number of changed files
122+
@JsonKey(name: 'changed_files')
113123
int? changedFilesCount;
114124

115125
/// Pull Request Labels
@@ -119,8 +129,20 @@ class PullRequest {
119129
List<User>? requestedReviewers;
120130

121131
/// The number of review comments on the Pull Request.
132+
@JsonKey(name: 'review_comments')
122133
int? reviewCommentCount;
123134

135+
Milestone? milestone;
136+
137+
bool? rebaseable;
138+
139+
String? mergeableState;
140+
141+
bool? maintainerCanModify;
142+
143+
/// Ex: CONTRIBUTOR, NONE, OWNER
144+
String? authorAssociation;
145+
124146
factory PullRequest.fromJson(Map<String, dynamic> input) =>
125147
_$PullRequestFromJson(input);
126148
Map<String, dynamic> toJson() => _$PullRequestToJson(this);

lib/src/common/model/pulls.g.dart

+22-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: github
2-
version: 8.1.3
2+
version: 8.2.0
33
description: A high-level GitHub API Client Library that uses Github's v3 API
44
homepage: https://github.com/SpinlockLabs/github.dart
55

0 commit comments

Comments
 (0)