Skip to content

Commit

Permalink
Prep 8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robbecker-wf committed Oct 11, 2021
1 parent b89a03f commit 28a3884
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 17 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 8.2.0
- add more fields to the PullRequest class and fixed JSON naming bugs
- Added:
- requestedReviewers
- reviewCommentCount
- milestone
- rebaseable
- mergeableState
- maintainerCanModify
- authorAssociation
- Fixed (these were previously always null)
- commentsCount
- commitsCount
- additionsCount
- deletionsCount
- changedFilesCount

## 8.1.3
- Add per page parameter to stars related activities https://github.com/SpinlockLabs/github.dart/pull/265

Expand Down
34 changes: 28 additions & 6 deletions lib/src/common/model/pulls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ class PullRequest {
this.merged,
this.mergeable,
this.mergedBy,
this.commentsCount,
this.commitsCount,
this.additionsCount,
this.deletionsCount,
this.changedFilesCount,
this.commentsCount = 0,
this.commitsCount = 0,
this.additionsCount = 0,
this.deletionsCount = 0,
this.changedFilesCount = 0,
this.labels,
this.requestedReviewers,
this.reviewCommentCount,
this.reviewCommentCount = 0,
this.milestone,
this.rebaseable = false,
this.mergeableState = '',
this.maintainerCanModify = false,
this.authorAssociation = '',
});

/// Pull Request ID
Expand Down Expand Up @@ -98,18 +103,23 @@ class PullRequest {
User? mergedBy;

/// Number of comments
@JsonKey(name: 'comments')
int? commentsCount;

/// Number of commits
@JsonKey(name: 'commits')
int? commitsCount;

/// Number of additions
@JsonKey(name: 'additions')
int? additionsCount;

/// Number of deletions
@JsonKey(name: 'deletions')
int? deletionsCount;

/// Number of changed files
@JsonKey(name: 'changed_files')
int? changedFilesCount;

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

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

Milestone? milestone;

bool? rebaseable;

String? mergeableState;

bool? maintainerCanModify;

/// Ex: CONTRIBUTOR, NONE, OWNER
String? authorAssociation;

factory PullRequest.fromJson(Map<String, dynamic> input) =>
_$PullRequestFromJson(input);
Map<String, dynamic> toJson() => _$PullRequestToJson(this);
Expand Down
32 changes: 22 additions & 10 deletions lib/src/common/model/pulls.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: github
version: 8.1.3
version: 8.2.0
description: A high-level GitHub API Client Library that uses Github's v3 API
homepage: https://github.com/SpinlockLabs/github.dart

Expand Down

0 comments on commit 28a3884

Please sign in to comment.