From 0a1db651bc28f6c1f735b210619be75bceb617dd Mon Sep 17 00:00:00 2001 From: Scott Horn Date: Mon, 3 Jan 2022 08:48:43 +0100 Subject: [PATCH] Added assignees to Issue model --- lib/src/common/model/issues.dart | 6 ++++++ lib/src/common/model/issues.g.dart | 8 ++++++++ pubspec.yaml | 2 +- test/src/mocks.mocks.dart | 5 ++--- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/src/common/model/issues.dart b/lib/src/common/model/issues.dart index 4138e9d4..4a86f62b 100644 --- a/lib/src/common/model/issues.dart +++ b/lib/src/common/model/issues.dart @@ -17,6 +17,7 @@ class Issue { this.user, List? labels, this.assignee, + this.assignees, this.milestone, this.commentsCount = 0, this.pullRequest, @@ -58,6 +59,9 @@ class Issue { /// The User that the issue is assigned to User? assignee; + /// The User that the issue is assigned to + List? assignees; + /// The Milestone Milestone? milestone; @@ -97,12 +101,14 @@ class IssueRequest { this.body, this.labels, this.assignee, + this.assignees, this.state, this.milestone}); String? title; String? body; List? labels; String? assignee; + List? assignees; String? state; int? milestone; diff --git a/lib/src/common/model/issues.g.dart b/lib/src/common/model/issues.g.dart index 30f1048a..0b6b8a3f 100644 --- a/lib/src/common/model/issues.g.dart +++ b/lib/src/common/model/issues.g.dart @@ -23,6 +23,9 @@ Issue _$IssueFromJson(Map json) => Issue( assignee: json['assignee'] == null ? null : User.fromJson(json['assignee'] as Map), + assignees: (json['assignees'] as List?) + ?.map((e) => User.fromJson(e as Map)) + .toList(), milestone: json['milestone'] == null ? null : Milestone.fromJson(json['milestone'] as Map), @@ -56,6 +59,7 @@ Map _$IssueToJson(Issue instance) => { 'user': instance.user, 'labels': instance.labels, 'assignee': instance.assignee, + 'assignees': instance.assignees, 'milestone': instance.milestone, 'comments': instance.commentsCount, 'pull_request': instance.pullRequest, @@ -72,6 +76,9 @@ IssueRequest _$IssueRequestFromJson(Map json) => IssueRequest( labels: (json['labels'] as List?)?.map((e) => e as String).toList(), assignee: json['assignee'] as String?, + assignees: (json['assignees'] as List?) + ?.map((e) => e as String) + .toList(), state: json['state'] as String?, milestone: json['milestone'] as int?, ); @@ -82,6 +89,7 @@ Map _$IssueRequestToJson(IssueRequest instance) => 'body': instance.body, 'labels': instance.labels, 'assignee': instance.assignee, + 'assignees': instance.assignees, 'state': instance.state, 'milestone': instance.milestone, }; diff --git a/pubspec.yaml b/pubspec.yaml index 8dba5227..19575c71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: collection: ^1.15.0 http: ^0.13.0 http_parser: ^4.0.0 - json_annotation: ^4.3.0 + json_annotation: ^4.4.0 meta: ^1.3.0 dev_dependencies: diff --git a/test/src/mocks.mocks.dart b/test/src/mocks.mocks.dart index 6a673895..0b3d8735 100644 --- a/test/src/mocks.mocks.dart +++ b/test/src/mocks.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.0.15 from annotations +// Mocks generated by Mockito 5.0.17 from annotations // in github/test/src/mocks.dart. // Do not manually edit this file. @@ -15,6 +15,7 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeClient_0 extends _i1.Fake implements _i2.Client {} @@ -257,6 +258,4 @@ class MockGitHub extends _i1.Mock implements _i3.GitHub { @override void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); - @override - String toString() => super.toString(); }