From 940ea5c1bfc62da1b1b81711d6561c68ea466099 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 6 Feb 2020 13:53:43 +0800 Subject: [PATCH] feat(gh): add watch state and action --- lib/graphql/gh.dart | 3102 +++++++++++++++++----------------- lib/graphql/gh.g.dart | 1650 +++++++++--------- lib/graphql/gh_watch.graphql | 1 + lib/screens/repository.dart | 154 +- 4 files changed, 2475 insertions(+), 2432 deletions(-) diff --git a/lib/graphql/gh.dart b/lib/graphql/gh.dart index 6b694be..4eee9f5 100644 --- a/lib/graphql/gh.dart +++ b/lib/graphql/gh.dart @@ -89,6 +89,7 @@ class GhRepoRepository extends GhRepoPinnableItem bool viewerHasStarred; @override + @JsonKey(unknownEnumValue: GhRepoSubscriptionState.ARTEMIS_UNKNOWN) GhRepoSubscriptionState viewerSubscription; @override @@ -699,6 +700,7 @@ enum GhRepoSubscriptionState { UNSUBSCRIBED, SUBSCRIBED, IGNORED, + ARTEMIS_UNKNOWN, } @JsonSerializable(explicitToJson: true) @@ -2928,6 +2930,778 @@ class GhCreateIssueQuery GhCreateIssue.fromJson(json); } +@JsonSerializable(explicitToJson: true) +class GhPulls with EquatableMixin { + GhPulls({this.repository}); + + factory GhPulls.fromJson(Map json) => + _$GhPullsFromJson(json); + + GhPullsRepository repository; + + @override + List get props => [repository]; + Map toJson() => _$GhPullsToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRepository extends GhPullsPinnableItem + with EquatableMixin + implements + GhPullsNode, + GhPullsProjectOwner, + GhPullsRegistryPackageOwner, + GhPullsRegistryPackageSearch, + GhPullsSubscribable, + GhPullsStarrable, + GhPullsUniformResourceLocatable, + GhPullsRepositoryInfo { + GhPullsRepository({this.pullRequests}); + + factory GhPullsRepository.fromJson(Map json) => + _$GhPullsRepositoryFromJson(json); + + @override + GhPullsRepositoryOwner owner; + + @override + String name; + + GhPullsPullRequestConnection pullRequests; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [owner, name, pullRequests, resolveType]; + Map toJson() => _$GhPullsRepositoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRepositoryOwner with EquatableMixin { + GhPullsRepositoryOwner({this.login}); + + factory GhPullsRepositoryOwner.fromJson(Map json) => + _$GhPullsRepositoryOwnerFromJson(json); + + String login; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [login, resolveType]; + Map toJson() => _$GhPullsRepositoryOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsPullRequestConnection with EquatableMixin { + GhPullsPullRequestConnection({this.pageInfo, this.nodes}); + + factory GhPullsPullRequestConnection.fromJson(Map json) => + _$GhPullsPullRequestConnectionFromJson(json); + + GhPullsPageInfo pageInfo; + + List nodes; + + @override + List get props => [pageInfo, nodes]; + Map toJson() => _$GhPullsPullRequestConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsPageInfo with EquatableMixin { + GhPullsPageInfo({this.hasNextPage, this.endCursor}); + + factory GhPullsPageInfo.fromJson(Map json) => + _$GhPullsPageInfoFromJson(json); + + bool hasNextPage; + + String endCursor; + + @override + List get props => [hasNextPage, endCursor]; + Map toJson() => _$GhPullsPageInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsPullRequest extends GhPullsProjectCardItem + with EquatableMixin + implements + GhPullsNode, + GhPullsAssignable, + GhPullsClosable, + GhPullsComment, + GhPullsUpdatable, + GhPullsUpdatableComment, + GhPullsLabelable, + GhPullsLockable, + GhPullsReactable, + GhPullsRepositoryNode, + GhPullsSubscribable, + GhPullsUniformResourceLocatable { + GhPullsPullRequest({this.number, this.title, this.comments}); + + factory GhPullsPullRequest.fromJson(Map json) => + _$GhPullsPullRequestFromJson(json); + + @override + GhPullsRepository repository; + + int number; + + String title; + + @override + DateTime updatedAt; + + @override + GhPullsActor author; + + @override + GhPullsLabelConnection labels; + + GhPullsIssueCommentConnection comments; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [ + repository, + number, + title, + updatedAt, + author, + labels, + comments, + resolveType + ]; + Map toJson() => _$GhPullsPullRequestToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsPinnableItem with EquatableMixin { + GhPullsPinnableItem(); + + factory GhPullsPinnableItem.fromJson(Map json) => + _$GhPullsPinnableItemFromJson(json); + + @override + List get props => []; + Map toJson() => _$GhPullsPinnableItemToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsNode with EquatableMixin { + GhPullsNode(); + + factory GhPullsNode.fromJson(Map json) => + _$GhPullsNodeFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsNodeToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsProjectOwner with EquatableMixin { + GhPullsProjectOwner(); + + factory GhPullsProjectOwner.fromJson(Map json) => + _$GhPullsProjectOwnerFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsProjectOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRegistryPackageOwner with EquatableMixin { + GhPullsRegistryPackageOwner(); + + factory GhPullsRegistryPackageOwner.fromJson(Map json) => + _$GhPullsRegistryPackageOwnerFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsRegistryPackageOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRegistryPackageSearch with EquatableMixin { + GhPullsRegistryPackageSearch(); + + factory GhPullsRegistryPackageSearch.fromJson(Map json) => + _$GhPullsRegistryPackageSearchFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsRegistryPackageSearchToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsSubscribable with EquatableMixin { + GhPullsSubscribable(); + + factory GhPullsSubscribable.fromJson(Map json) => + _$GhPullsSubscribableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsSubscribableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsStarrable with EquatableMixin { + GhPullsStarrable(); + + factory GhPullsStarrable.fromJson(Map json) => + _$GhPullsStarrableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsStarrableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsUniformResourceLocatable with EquatableMixin { + GhPullsUniformResourceLocatable(); + + factory GhPullsUniformResourceLocatable.fromJson(Map json) => + _$GhPullsUniformResourceLocatableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => + _$GhPullsUniformResourceLocatableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRepositoryInfo with EquatableMixin { + GhPullsRepositoryInfo({this.owner, this.name}); + + factory GhPullsRepositoryInfo.fromJson(Map json) => + _$GhPullsRepositoryInfoFromJson(json); + + GhPullsRepositoryOwner owner; + + String name; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [owner, name, resolveType]; + Map toJson() => _$GhPullsRepositoryInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsActor with EquatableMixin { + GhPullsActor({this.login, this.avatarUrl}); + + factory GhPullsActor.fromJson(Map json) => + _$GhPullsActorFromJson(json); + + String login; + + String avatarUrl; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [login, avatarUrl, resolveType]; + Map toJson() => _$GhPullsActorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsLabelConnection with EquatableMixin { + GhPullsLabelConnection({this.nodes}); + + factory GhPullsLabelConnection.fromJson(Map json) => + _$GhPullsLabelConnectionFromJson(json); + + List nodes; + + @override + List get props => [nodes]; + Map toJson() => _$GhPullsLabelConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsLabel with EquatableMixin implements GhPullsNode { + GhPullsLabel({this.name, this.color}); + + factory GhPullsLabel.fromJson(Map json) => + _$GhPullsLabelFromJson(json); + + String name; + + String color; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [name, color, resolveType]; + Map toJson() => _$GhPullsLabelToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsIssueCommentConnection with EquatableMixin { + GhPullsIssueCommentConnection({this.totalCount}); + + factory GhPullsIssueCommentConnection.fromJson(Map json) => + _$GhPullsIssueCommentConnectionFromJson(json); + + int totalCount; + + @override + List get props => [totalCount]; + Map toJson() => _$GhPullsIssueCommentConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsProjectCardItem with EquatableMixin { + GhPullsProjectCardItem(); + + factory GhPullsProjectCardItem.fromJson(Map json) => + _$GhPullsProjectCardItemFromJson(json); + + @override + List get props => []; + Map toJson() => _$GhPullsProjectCardItemToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsAssignable with EquatableMixin { + GhPullsAssignable(); + + factory GhPullsAssignable.fromJson(Map json) => + _$GhPullsAssignableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsAssignableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsClosable with EquatableMixin { + GhPullsClosable(); + + factory GhPullsClosable.fromJson(Map json) => + _$GhPullsClosableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsClosableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsComment with EquatableMixin { + GhPullsComment({this.updatedAt, this.author}); + + factory GhPullsComment.fromJson(Map json) => + _$GhPullsCommentFromJson(json); + + DateTime updatedAt; + + GhPullsActor author; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [updatedAt, author, resolveType]; + Map toJson() => _$GhPullsCommentToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsUpdatable with EquatableMixin { + GhPullsUpdatable(); + + factory GhPullsUpdatable.fromJson(Map json) => + _$GhPullsUpdatableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsUpdatableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsUpdatableComment with EquatableMixin { + GhPullsUpdatableComment(); + + factory GhPullsUpdatableComment.fromJson(Map json) => + _$GhPullsUpdatableCommentFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsUpdatableCommentToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsLabelable with EquatableMixin { + GhPullsLabelable({this.labels}); + + factory GhPullsLabelable.fromJson(Map json) => + _$GhPullsLabelableFromJson(json); + + GhPullsLabelConnection labels; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [labels, resolveType]; + Map toJson() => _$GhPullsLabelableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsLockable with EquatableMixin { + GhPullsLockable(); + + factory GhPullsLockable.fromJson(Map json) => + _$GhPullsLockableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsLockableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsReactable with EquatableMixin { + GhPullsReactable(); + + factory GhPullsReactable.fromJson(Map json) => + _$GhPullsReactableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhPullsReactableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsRepositoryNode with EquatableMixin { + GhPullsRepositoryNode({this.repository}); + + factory GhPullsRepositoryNode.fromJson(Map json) => + _$GhPullsRepositoryNodeFromJson(json); + + GhPullsRepository repository; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [repository, resolveType]; + Map toJson() => _$GhPullsRepositoryNodeToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhPullsArguments extends JsonSerializable with EquatableMixin { + GhPullsArguments({@required this.owner, @required this.name, this.cursor}); + + factory GhPullsArguments.fromJson(Map json) => + _$GhPullsArgumentsFromJson(json); + + final String owner; + + final String name; + + final String cursor; + + @override + List get props => [owner, name, cursor]; + Map toJson() => _$GhPullsArgumentsToJson(this); +} + +class GhPullsQuery extends GraphQLQuery { + GhPullsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GhPulls'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'owner')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'cursor')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'repository'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'owner'), + value: VariableNode(name: NameNode(value: 'owner'))), + ArgumentNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'owner'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'pullRequests'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'states'), + value: EnumValueNode(name: NameNode(value: 'OPEN'))), + ArgumentNode( + name: NameNode(value: 'orderBy'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'field'), + value: EnumValueNode( + name: NameNode(value: 'CREATED_AT'))), + ObjectFieldNode( + name: NameNode(value: 'direction'), + value: EnumValueNode( + name: NameNode(value: 'DESC'))) + ])), + ArgumentNode( + name: NameNode(value: 'first'), + value: IntValueNode(value: '30')), + ArgumentNode( + name: NameNode(value: 'after'), + value: VariableNode(name: NameNode(value: 'cursor'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'pageInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'hasNextPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'endCursor'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'nodes'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'repository'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'owner'), + alias: null, + arguments: [], + directives: [], + selectionSet: + SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'number'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'title'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'updatedAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'author'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'avatarUrl'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'labels'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: IntValueNode(value: '10')) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'nodes'), + alias: null, + arguments: [], + directives: [], + selectionSet: + SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'color'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])), + FieldNode( + name: NameNode(value: 'comments'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'totalCount'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'GhPulls'; + + @override + final GhPullsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + GhPulls parse(Map json) => GhPulls.fromJson(json); +} + @JsonSerializable(explicitToJson: true) class GhOpenIssue with EquatableMixin { GhOpenIssue({this.reopenIssue, this.closeIssue}); @@ -3323,6 +4097,779 @@ class GhOpenIssueQuery extends GraphQLQuery { GhOpenIssue parse(Map json) => GhOpenIssue.fromJson(json); } +@JsonSerializable(explicitToJson: true) +class GhIssues with EquatableMixin { + GhIssues({this.repository}); + + factory GhIssues.fromJson(Map json) => + _$GhIssuesFromJson(json); + + GhIssuesRepository repository; + + @override + List get props => [repository]; + Map toJson() => _$GhIssuesToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRepository extends GhIssuesPinnableItem + with EquatableMixin + implements + GhIssuesNode, + GhIssuesProjectOwner, + GhIssuesRegistryPackageOwner, + GhIssuesRegistryPackageSearch, + GhIssuesSubscribable, + GhIssuesStarrable, + GhIssuesUniformResourceLocatable, + GhIssuesRepositoryInfo { + GhIssuesRepository({this.issues}); + + factory GhIssuesRepository.fromJson(Map json) => + _$GhIssuesRepositoryFromJson(json); + + @override + GhIssuesRepositoryOwner owner; + + @override + String name; + + GhIssuesIssueConnection issues; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [owner, name, issues, resolveType]; + Map toJson() => _$GhIssuesRepositoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRepositoryOwner with EquatableMixin { + GhIssuesRepositoryOwner({this.login}); + + factory GhIssuesRepositoryOwner.fromJson(Map json) => + _$GhIssuesRepositoryOwnerFromJson(json); + + String login; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [login, resolveType]; + Map toJson() => _$GhIssuesRepositoryOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesIssueConnection with EquatableMixin { + GhIssuesIssueConnection({this.pageInfo, this.nodes}); + + factory GhIssuesIssueConnection.fromJson(Map json) => + _$GhIssuesIssueConnectionFromJson(json); + + GhIssuesPageInfo pageInfo; + + List nodes; + + @override + List get props => [pageInfo, nodes]; + Map toJson() => _$GhIssuesIssueConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesPageInfo with EquatableMixin { + GhIssuesPageInfo({this.hasNextPage, this.endCursor}); + + factory GhIssuesPageInfo.fromJson(Map json) => + _$GhIssuesPageInfoFromJson(json); + + bool hasNextPage; + + String endCursor; + + @override + List get props => [hasNextPage, endCursor]; + Map toJson() => _$GhIssuesPageInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesIssue extends GhIssuesProjectCardItem + with EquatableMixin + implements + GhIssuesNode, + GhIssuesAssignable, + GhIssuesClosable, + GhIssuesComment, + GhIssuesUpdatable, + GhIssuesUpdatableComment, + GhIssuesLabelable, + GhIssuesLockable, + GhIssuesReactable, + GhIssuesRepositoryNode, + GhIssuesSubscribable, + GhIssuesUniformResourceLocatable { + GhIssuesIssue({this.number, this.title, this.comments}); + + factory GhIssuesIssue.fromJson(Map json) => + _$GhIssuesIssueFromJson(json); + + @override + GhIssuesRepository repository; + + int number; + + String title; + + @override + DateTime updatedAt; + + @override + GhIssuesActor author; + + @override + GhIssuesLabelConnection labels; + + GhIssuesIssueCommentConnection comments; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [ + repository, + number, + title, + updatedAt, + author, + labels, + comments, + resolveType + ]; + Map toJson() => _$GhIssuesIssueToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesPinnableItem with EquatableMixin { + GhIssuesPinnableItem(); + + factory GhIssuesPinnableItem.fromJson(Map json) => + _$GhIssuesPinnableItemFromJson(json); + + @override + List get props => []; + Map toJson() => _$GhIssuesPinnableItemToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesNode with EquatableMixin { + GhIssuesNode(); + + factory GhIssuesNode.fromJson(Map json) => + _$GhIssuesNodeFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesNodeToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesProjectOwner with EquatableMixin { + GhIssuesProjectOwner(); + + factory GhIssuesProjectOwner.fromJson(Map json) => + _$GhIssuesProjectOwnerFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesProjectOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRegistryPackageOwner with EquatableMixin { + GhIssuesRegistryPackageOwner(); + + factory GhIssuesRegistryPackageOwner.fromJson(Map json) => + _$GhIssuesRegistryPackageOwnerFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesRegistryPackageOwnerToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRegistryPackageSearch with EquatableMixin { + GhIssuesRegistryPackageSearch(); + + factory GhIssuesRegistryPackageSearch.fromJson(Map json) => + _$GhIssuesRegistryPackageSearchFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesRegistryPackageSearchToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesSubscribable with EquatableMixin { + GhIssuesSubscribable(); + + factory GhIssuesSubscribable.fromJson(Map json) => + _$GhIssuesSubscribableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesSubscribableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesStarrable with EquatableMixin { + GhIssuesStarrable(); + + factory GhIssuesStarrable.fromJson(Map json) => + _$GhIssuesStarrableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesStarrableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesUniformResourceLocatable with EquatableMixin { + GhIssuesUniformResourceLocatable(); + + factory GhIssuesUniformResourceLocatable.fromJson( + Map json) => + _$GhIssuesUniformResourceLocatableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => + _$GhIssuesUniformResourceLocatableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRepositoryInfo with EquatableMixin { + GhIssuesRepositoryInfo({this.owner, this.name}); + + factory GhIssuesRepositoryInfo.fromJson(Map json) => + _$GhIssuesRepositoryInfoFromJson(json); + + GhIssuesRepositoryOwner owner; + + String name; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [owner, name, resolveType]; + Map toJson() => _$GhIssuesRepositoryInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesActor with EquatableMixin { + GhIssuesActor({this.login, this.avatarUrl}); + + factory GhIssuesActor.fromJson(Map json) => + _$GhIssuesActorFromJson(json); + + String login; + + String avatarUrl; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [login, avatarUrl, resolveType]; + Map toJson() => _$GhIssuesActorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesLabelConnection with EquatableMixin { + GhIssuesLabelConnection({this.nodes}); + + factory GhIssuesLabelConnection.fromJson(Map json) => + _$GhIssuesLabelConnectionFromJson(json); + + List nodes; + + @override + List get props => [nodes]; + Map toJson() => _$GhIssuesLabelConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesLabel with EquatableMixin implements GhIssuesNode { + GhIssuesLabel({this.name, this.color}); + + factory GhIssuesLabel.fromJson(Map json) => + _$GhIssuesLabelFromJson(json); + + String name; + + String color; + + @override + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [name, color, resolveType]; + Map toJson() => _$GhIssuesLabelToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesIssueCommentConnection with EquatableMixin { + GhIssuesIssueCommentConnection({this.totalCount}); + + factory GhIssuesIssueCommentConnection.fromJson(Map json) => + _$GhIssuesIssueCommentConnectionFromJson(json); + + int totalCount; + + @override + List get props => [totalCount]; + Map toJson() => _$GhIssuesIssueCommentConnectionToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesProjectCardItem with EquatableMixin { + GhIssuesProjectCardItem(); + + factory GhIssuesProjectCardItem.fromJson(Map json) => + _$GhIssuesProjectCardItemFromJson(json); + + @override + List get props => []; + Map toJson() => _$GhIssuesProjectCardItemToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesAssignable with EquatableMixin { + GhIssuesAssignable(); + + factory GhIssuesAssignable.fromJson(Map json) => + _$GhIssuesAssignableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesAssignableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesClosable with EquatableMixin { + GhIssuesClosable(); + + factory GhIssuesClosable.fromJson(Map json) => + _$GhIssuesClosableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesClosableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesComment with EquatableMixin { + GhIssuesComment({this.updatedAt, this.author}); + + factory GhIssuesComment.fromJson(Map json) => + _$GhIssuesCommentFromJson(json); + + DateTime updatedAt; + + GhIssuesActor author; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [updatedAt, author, resolveType]; + Map toJson() => _$GhIssuesCommentToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesUpdatable with EquatableMixin { + GhIssuesUpdatable(); + + factory GhIssuesUpdatable.fromJson(Map json) => + _$GhIssuesUpdatableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesUpdatableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesUpdatableComment with EquatableMixin { + GhIssuesUpdatableComment(); + + factory GhIssuesUpdatableComment.fromJson(Map json) => + _$GhIssuesUpdatableCommentFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesUpdatableCommentToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesLabelable with EquatableMixin { + GhIssuesLabelable({this.labels}); + + factory GhIssuesLabelable.fromJson(Map json) => + _$GhIssuesLabelableFromJson(json); + + GhIssuesLabelConnection labels; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [labels, resolveType]; + Map toJson() => _$GhIssuesLabelableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesLockable with EquatableMixin { + GhIssuesLockable(); + + factory GhIssuesLockable.fromJson(Map json) => + _$GhIssuesLockableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesLockableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesReactable with EquatableMixin { + GhIssuesReactable(); + + factory GhIssuesReactable.fromJson(Map json) => + _$GhIssuesReactableFromJson(json); + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [resolveType]; + Map toJson() => _$GhIssuesReactableToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesRepositoryNode with EquatableMixin { + GhIssuesRepositoryNode({this.repository}); + + factory GhIssuesRepositoryNode.fromJson(Map json) => + _$GhIssuesRepositoryNodeFromJson(json); + + GhIssuesRepository repository; + + @JsonKey(name: '__typename') + String resolveType; + + @override + List get props => [repository, resolveType]; + Map toJson() => _$GhIssuesRepositoryNodeToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GhIssuesArguments extends JsonSerializable with EquatableMixin { + GhIssuesArguments({@required this.owner, @required this.name, this.cursor}); + + factory GhIssuesArguments.fromJson(Map json) => + _$GhIssuesArgumentsFromJson(json); + + final String owner; + + final String name; + + final String cursor; + + @override + List get props => [owner, name, cursor]; + Map toJson() => _$GhIssuesArgumentsToJson(this); +} + +class GhIssuesQuery extends GraphQLQuery { + GhIssuesQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GhIssues'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'owner')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'cursor')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'repository'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'owner'), + value: VariableNode(name: NameNode(value: 'owner'))), + ArgumentNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'owner'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'issues'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'states'), + value: EnumValueNode(name: NameNode(value: 'OPEN'))), + ArgumentNode( + name: NameNode(value: 'orderBy'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'field'), + value: EnumValueNode( + name: NameNode(value: 'CREATED_AT'))), + ObjectFieldNode( + name: NameNode(value: 'direction'), + value: EnumValueNode( + name: NameNode(value: 'DESC'))) + ])), + ArgumentNode( + name: NameNode(value: 'first'), + value: IntValueNode(value: '30')), + ArgumentNode( + name: NameNode(value: 'after'), + value: VariableNode(name: NameNode(value: 'cursor'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'pageInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'hasNextPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'endCursor'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'nodes'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'repository'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'owner'), + alias: null, + arguments: [], + directives: [], + selectionSet: + SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'number'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'title'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'updatedAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'author'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'avatarUrl'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'labels'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: IntValueNode(value: '10')) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'nodes'), + alias: null, + arguments: [], + directives: [], + selectionSet: + SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'color'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])), + FieldNode( + name: NameNode(value: 'comments'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'totalCount'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'GhIssues'; + + @override + final GhIssuesArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + GhIssues parse(Map json) => GhIssues.fromJson(json); +} + @JsonSerializable(explicitToJson: true) class GhRepos with EquatableMixin { GhRepos({this.repositoryOwner}); @@ -4522,6 +6069,7 @@ class GhWatchRepository extends GhWatchPinnableItem factory GhWatchRepository.fromJson(Map json) => _$GhWatchRepositoryFromJson(json); + @JsonKey(unknownEnumValue: GhWatchSubscriptionState.ARTEMIS_UNKNOWN) GhWatchSubscriptionState viewerSubscription; @override @@ -4655,6 +6203,7 @@ enum GhWatchSubscriptionState { UNSUBSCRIBED, SUBSCRIBED, IGNORED, + ARTEMIS_UNKNOWN, } @JsonSerializable(explicitToJson: true) @@ -4719,6 +6268,12 @@ class GhWatchQuery extends GraphQLQuery { arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), InlineFragmentNode( typeCondition: TypeConditionNode( on: NamedTypeNode( @@ -8056,6 +9611,7 @@ class GhCommitsStatus with EquatableMixin implements GhCommitsNode { factory GhCommitsStatus.fromJson(Map json) => _$GhCommitsStatusFromJson(json); + @JsonKey(unknownEnumValue: GhCommitsStatusState.ARTEMIS_UNKNOWN) GhCommitsStatusState state; @override @@ -8178,6 +9734,7 @@ enum GhCommitsStatusState { FAILURE, PENDING, SUCCESS, + ARTEMIS_UNKNOWN, } @JsonSerializable(explicitToJson: true) @@ -8789,1548 +10346,3 @@ class GhRepoIdQuery extends GraphQLQuery { @override GhRepoId parse(Map json) => GhRepoId.fromJson(json); } - -@JsonSerializable(explicitToJson: true) -class GhIssues with EquatableMixin { - GhIssues({this.repository}); - - factory GhIssues.fromJson(Map json) => - _$GhIssuesFromJson(json); - - GhIssuesRepository repository; - - @override - List get props => [repository]; - Map toJson() => _$GhIssuesToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRepository extends GhIssuesPinnableItem - with EquatableMixin - implements - GhIssuesNode, - GhIssuesProjectOwner, - GhIssuesRegistryPackageOwner, - GhIssuesRegistryPackageSearch, - GhIssuesSubscribable, - GhIssuesStarrable, - GhIssuesUniformResourceLocatable, - GhIssuesRepositoryInfo { - GhIssuesRepository({this.issues}); - - factory GhIssuesRepository.fromJson(Map json) => - _$GhIssuesRepositoryFromJson(json); - - @override - GhIssuesRepositoryOwner owner; - - @override - String name; - - GhIssuesIssueConnection issues; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [owner, name, issues, resolveType]; - Map toJson() => _$GhIssuesRepositoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRepositoryOwner with EquatableMixin { - GhIssuesRepositoryOwner({this.login}); - - factory GhIssuesRepositoryOwner.fromJson(Map json) => - _$GhIssuesRepositoryOwnerFromJson(json); - - String login; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [login, resolveType]; - Map toJson() => _$GhIssuesRepositoryOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesIssueConnection with EquatableMixin { - GhIssuesIssueConnection({this.pageInfo, this.nodes}); - - factory GhIssuesIssueConnection.fromJson(Map json) => - _$GhIssuesIssueConnectionFromJson(json); - - GhIssuesPageInfo pageInfo; - - List nodes; - - @override - List get props => [pageInfo, nodes]; - Map toJson() => _$GhIssuesIssueConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesPageInfo with EquatableMixin { - GhIssuesPageInfo({this.hasNextPage, this.endCursor}); - - factory GhIssuesPageInfo.fromJson(Map json) => - _$GhIssuesPageInfoFromJson(json); - - bool hasNextPage; - - String endCursor; - - @override - List get props => [hasNextPage, endCursor]; - Map toJson() => _$GhIssuesPageInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesIssue extends GhIssuesProjectCardItem - with EquatableMixin - implements - GhIssuesNode, - GhIssuesAssignable, - GhIssuesClosable, - GhIssuesComment, - GhIssuesUpdatable, - GhIssuesUpdatableComment, - GhIssuesLabelable, - GhIssuesLockable, - GhIssuesReactable, - GhIssuesRepositoryNode, - GhIssuesSubscribable, - GhIssuesUniformResourceLocatable { - GhIssuesIssue({this.number, this.title, this.comments}); - - factory GhIssuesIssue.fromJson(Map json) => - _$GhIssuesIssueFromJson(json); - - @override - GhIssuesRepository repository; - - int number; - - String title; - - @override - DateTime updatedAt; - - @override - GhIssuesActor author; - - @override - GhIssuesLabelConnection labels; - - GhIssuesIssueCommentConnection comments; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [ - repository, - number, - title, - updatedAt, - author, - labels, - comments, - resolveType - ]; - Map toJson() => _$GhIssuesIssueToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesPinnableItem with EquatableMixin { - GhIssuesPinnableItem(); - - factory GhIssuesPinnableItem.fromJson(Map json) => - _$GhIssuesPinnableItemFromJson(json); - - @override - List get props => []; - Map toJson() => _$GhIssuesPinnableItemToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesNode with EquatableMixin { - GhIssuesNode(); - - factory GhIssuesNode.fromJson(Map json) => - _$GhIssuesNodeFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesNodeToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesProjectOwner with EquatableMixin { - GhIssuesProjectOwner(); - - factory GhIssuesProjectOwner.fromJson(Map json) => - _$GhIssuesProjectOwnerFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesProjectOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRegistryPackageOwner with EquatableMixin { - GhIssuesRegistryPackageOwner(); - - factory GhIssuesRegistryPackageOwner.fromJson(Map json) => - _$GhIssuesRegistryPackageOwnerFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesRegistryPackageOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRegistryPackageSearch with EquatableMixin { - GhIssuesRegistryPackageSearch(); - - factory GhIssuesRegistryPackageSearch.fromJson(Map json) => - _$GhIssuesRegistryPackageSearchFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesRegistryPackageSearchToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesSubscribable with EquatableMixin { - GhIssuesSubscribable(); - - factory GhIssuesSubscribable.fromJson(Map json) => - _$GhIssuesSubscribableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesSubscribableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesStarrable with EquatableMixin { - GhIssuesStarrable(); - - factory GhIssuesStarrable.fromJson(Map json) => - _$GhIssuesStarrableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesStarrableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesUniformResourceLocatable with EquatableMixin { - GhIssuesUniformResourceLocatable(); - - factory GhIssuesUniformResourceLocatable.fromJson( - Map json) => - _$GhIssuesUniformResourceLocatableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => - _$GhIssuesUniformResourceLocatableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRepositoryInfo with EquatableMixin { - GhIssuesRepositoryInfo({this.owner, this.name}); - - factory GhIssuesRepositoryInfo.fromJson(Map json) => - _$GhIssuesRepositoryInfoFromJson(json); - - GhIssuesRepositoryOwner owner; - - String name; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [owner, name, resolveType]; - Map toJson() => _$GhIssuesRepositoryInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesActor with EquatableMixin { - GhIssuesActor({this.login, this.avatarUrl}); - - factory GhIssuesActor.fromJson(Map json) => - _$GhIssuesActorFromJson(json); - - String login; - - String avatarUrl; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [login, avatarUrl, resolveType]; - Map toJson() => _$GhIssuesActorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesLabelConnection with EquatableMixin { - GhIssuesLabelConnection({this.nodes}); - - factory GhIssuesLabelConnection.fromJson(Map json) => - _$GhIssuesLabelConnectionFromJson(json); - - List nodes; - - @override - List get props => [nodes]; - Map toJson() => _$GhIssuesLabelConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesLabel with EquatableMixin implements GhIssuesNode { - GhIssuesLabel({this.name, this.color}); - - factory GhIssuesLabel.fromJson(Map json) => - _$GhIssuesLabelFromJson(json); - - String name; - - String color; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [name, color, resolveType]; - Map toJson() => _$GhIssuesLabelToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesIssueCommentConnection with EquatableMixin { - GhIssuesIssueCommentConnection({this.totalCount}); - - factory GhIssuesIssueCommentConnection.fromJson(Map json) => - _$GhIssuesIssueCommentConnectionFromJson(json); - - int totalCount; - - @override - List get props => [totalCount]; - Map toJson() => _$GhIssuesIssueCommentConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesProjectCardItem with EquatableMixin { - GhIssuesProjectCardItem(); - - factory GhIssuesProjectCardItem.fromJson(Map json) => - _$GhIssuesProjectCardItemFromJson(json); - - @override - List get props => []; - Map toJson() => _$GhIssuesProjectCardItemToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesAssignable with EquatableMixin { - GhIssuesAssignable(); - - factory GhIssuesAssignable.fromJson(Map json) => - _$GhIssuesAssignableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesAssignableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesClosable with EquatableMixin { - GhIssuesClosable(); - - factory GhIssuesClosable.fromJson(Map json) => - _$GhIssuesClosableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesClosableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesComment with EquatableMixin { - GhIssuesComment({this.updatedAt, this.author}); - - factory GhIssuesComment.fromJson(Map json) => - _$GhIssuesCommentFromJson(json); - - DateTime updatedAt; - - GhIssuesActor author; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [updatedAt, author, resolveType]; - Map toJson() => _$GhIssuesCommentToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesUpdatable with EquatableMixin { - GhIssuesUpdatable(); - - factory GhIssuesUpdatable.fromJson(Map json) => - _$GhIssuesUpdatableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesUpdatableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesUpdatableComment with EquatableMixin { - GhIssuesUpdatableComment(); - - factory GhIssuesUpdatableComment.fromJson(Map json) => - _$GhIssuesUpdatableCommentFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesUpdatableCommentToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesLabelable with EquatableMixin { - GhIssuesLabelable({this.labels}); - - factory GhIssuesLabelable.fromJson(Map json) => - _$GhIssuesLabelableFromJson(json); - - GhIssuesLabelConnection labels; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [labels, resolveType]; - Map toJson() => _$GhIssuesLabelableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesLockable with EquatableMixin { - GhIssuesLockable(); - - factory GhIssuesLockable.fromJson(Map json) => - _$GhIssuesLockableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesLockableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesReactable with EquatableMixin { - GhIssuesReactable(); - - factory GhIssuesReactable.fromJson(Map json) => - _$GhIssuesReactableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhIssuesReactableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesRepositoryNode with EquatableMixin { - GhIssuesRepositoryNode({this.repository}); - - factory GhIssuesRepositoryNode.fromJson(Map json) => - _$GhIssuesRepositoryNodeFromJson(json); - - GhIssuesRepository repository; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [repository, resolveType]; - Map toJson() => _$GhIssuesRepositoryNodeToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhIssuesArguments extends JsonSerializable with EquatableMixin { - GhIssuesArguments({@required this.owner, @required this.name, this.cursor}); - - factory GhIssuesArguments.fromJson(Map json) => - _$GhIssuesArgumentsFromJson(json); - - final String owner; - - final String name; - - final String cursor; - - @override - List get props => [owner, name, cursor]; - Map toJson() => _$GhIssuesArgumentsToJson(this); -} - -class GhIssuesQuery extends GraphQLQuery { - GhIssuesQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GhIssues'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'owner')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'cursor')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'repository'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'owner'), - value: VariableNode(name: NameNode(value: 'owner'))), - ArgumentNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'owner'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'issues'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'states'), - value: EnumValueNode(name: NameNode(value: 'OPEN'))), - ArgumentNode( - name: NameNode(value: 'orderBy'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'field'), - value: EnumValueNode( - name: NameNode(value: 'CREATED_AT'))), - ObjectFieldNode( - name: NameNode(value: 'direction'), - value: EnumValueNode( - name: NameNode(value: 'DESC'))) - ])), - ArgumentNode( - name: NameNode(value: 'first'), - value: IntValueNode(value: '30')), - ArgumentNode( - name: NameNode(value: 'after'), - value: VariableNode(name: NameNode(value: 'cursor'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'pageInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'hasNextPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'endCursor'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'nodes'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'repository'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'owner'), - alias: null, - arguments: [], - directives: [], - selectionSet: - SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'number'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'title'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'updatedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'author'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'avatarUrl'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'labels'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: IntValueNode(value: '10')) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'nodes'), - alias: null, - arguments: [], - directives: [], - selectionSet: - SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'color'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])), - FieldNode( - name: NameNode(value: 'comments'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'totalCount'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'GhIssues'; - - @override - final GhIssuesArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - GhIssues parse(Map json) => GhIssues.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class GhPulls with EquatableMixin { - GhPulls({this.repository}); - - factory GhPulls.fromJson(Map json) => - _$GhPullsFromJson(json); - - GhPullsRepository repository; - - @override - List get props => [repository]; - Map toJson() => _$GhPullsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRepository extends GhPullsPinnableItem - with EquatableMixin - implements - GhPullsNode, - GhPullsProjectOwner, - GhPullsRegistryPackageOwner, - GhPullsRegistryPackageSearch, - GhPullsSubscribable, - GhPullsStarrable, - GhPullsUniformResourceLocatable, - GhPullsRepositoryInfo { - GhPullsRepository({this.pullRequests}); - - factory GhPullsRepository.fromJson(Map json) => - _$GhPullsRepositoryFromJson(json); - - @override - GhPullsRepositoryOwner owner; - - @override - String name; - - GhPullsPullRequestConnection pullRequests; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [owner, name, pullRequests, resolveType]; - Map toJson() => _$GhPullsRepositoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRepositoryOwner with EquatableMixin { - GhPullsRepositoryOwner({this.login}); - - factory GhPullsRepositoryOwner.fromJson(Map json) => - _$GhPullsRepositoryOwnerFromJson(json); - - String login; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [login, resolveType]; - Map toJson() => _$GhPullsRepositoryOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsPullRequestConnection with EquatableMixin { - GhPullsPullRequestConnection({this.pageInfo, this.nodes}); - - factory GhPullsPullRequestConnection.fromJson(Map json) => - _$GhPullsPullRequestConnectionFromJson(json); - - GhPullsPageInfo pageInfo; - - List nodes; - - @override - List get props => [pageInfo, nodes]; - Map toJson() => _$GhPullsPullRequestConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsPageInfo with EquatableMixin { - GhPullsPageInfo({this.hasNextPage, this.endCursor}); - - factory GhPullsPageInfo.fromJson(Map json) => - _$GhPullsPageInfoFromJson(json); - - bool hasNextPage; - - String endCursor; - - @override - List get props => [hasNextPage, endCursor]; - Map toJson() => _$GhPullsPageInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsPullRequest extends GhPullsProjectCardItem - with EquatableMixin - implements - GhPullsNode, - GhPullsAssignable, - GhPullsClosable, - GhPullsComment, - GhPullsUpdatable, - GhPullsUpdatableComment, - GhPullsLabelable, - GhPullsLockable, - GhPullsReactable, - GhPullsRepositoryNode, - GhPullsSubscribable, - GhPullsUniformResourceLocatable { - GhPullsPullRequest({this.number, this.title, this.comments}); - - factory GhPullsPullRequest.fromJson(Map json) => - _$GhPullsPullRequestFromJson(json); - - @override - GhPullsRepository repository; - - int number; - - String title; - - @override - DateTime updatedAt; - - @override - GhPullsActor author; - - @override - GhPullsLabelConnection labels; - - GhPullsIssueCommentConnection comments; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [ - repository, - number, - title, - updatedAt, - author, - labels, - comments, - resolveType - ]; - Map toJson() => _$GhPullsPullRequestToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsPinnableItem with EquatableMixin { - GhPullsPinnableItem(); - - factory GhPullsPinnableItem.fromJson(Map json) => - _$GhPullsPinnableItemFromJson(json); - - @override - List get props => []; - Map toJson() => _$GhPullsPinnableItemToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsNode with EquatableMixin { - GhPullsNode(); - - factory GhPullsNode.fromJson(Map json) => - _$GhPullsNodeFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsNodeToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsProjectOwner with EquatableMixin { - GhPullsProjectOwner(); - - factory GhPullsProjectOwner.fromJson(Map json) => - _$GhPullsProjectOwnerFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsProjectOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRegistryPackageOwner with EquatableMixin { - GhPullsRegistryPackageOwner(); - - factory GhPullsRegistryPackageOwner.fromJson(Map json) => - _$GhPullsRegistryPackageOwnerFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsRegistryPackageOwnerToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRegistryPackageSearch with EquatableMixin { - GhPullsRegistryPackageSearch(); - - factory GhPullsRegistryPackageSearch.fromJson(Map json) => - _$GhPullsRegistryPackageSearchFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsRegistryPackageSearchToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsSubscribable with EquatableMixin { - GhPullsSubscribable(); - - factory GhPullsSubscribable.fromJson(Map json) => - _$GhPullsSubscribableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsSubscribableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsStarrable with EquatableMixin { - GhPullsStarrable(); - - factory GhPullsStarrable.fromJson(Map json) => - _$GhPullsStarrableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsStarrableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsUniformResourceLocatable with EquatableMixin { - GhPullsUniformResourceLocatable(); - - factory GhPullsUniformResourceLocatable.fromJson(Map json) => - _$GhPullsUniformResourceLocatableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => - _$GhPullsUniformResourceLocatableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRepositoryInfo with EquatableMixin { - GhPullsRepositoryInfo({this.owner, this.name}); - - factory GhPullsRepositoryInfo.fromJson(Map json) => - _$GhPullsRepositoryInfoFromJson(json); - - GhPullsRepositoryOwner owner; - - String name; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [owner, name, resolveType]; - Map toJson() => _$GhPullsRepositoryInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsActor with EquatableMixin { - GhPullsActor({this.login, this.avatarUrl}); - - factory GhPullsActor.fromJson(Map json) => - _$GhPullsActorFromJson(json); - - String login; - - String avatarUrl; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [login, avatarUrl, resolveType]; - Map toJson() => _$GhPullsActorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsLabelConnection with EquatableMixin { - GhPullsLabelConnection({this.nodes}); - - factory GhPullsLabelConnection.fromJson(Map json) => - _$GhPullsLabelConnectionFromJson(json); - - List nodes; - - @override - List get props => [nodes]; - Map toJson() => _$GhPullsLabelConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsLabel with EquatableMixin implements GhPullsNode { - GhPullsLabel({this.name, this.color}); - - factory GhPullsLabel.fromJson(Map json) => - _$GhPullsLabelFromJson(json); - - String name; - - String color; - - @override - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [name, color, resolveType]; - Map toJson() => _$GhPullsLabelToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsIssueCommentConnection with EquatableMixin { - GhPullsIssueCommentConnection({this.totalCount}); - - factory GhPullsIssueCommentConnection.fromJson(Map json) => - _$GhPullsIssueCommentConnectionFromJson(json); - - int totalCount; - - @override - List get props => [totalCount]; - Map toJson() => _$GhPullsIssueCommentConnectionToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsProjectCardItem with EquatableMixin { - GhPullsProjectCardItem(); - - factory GhPullsProjectCardItem.fromJson(Map json) => - _$GhPullsProjectCardItemFromJson(json); - - @override - List get props => []; - Map toJson() => _$GhPullsProjectCardItemToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsAssignable with EquatableMixin { - GhPullsAssignable(); - - factory GhPullsAssignable.fromJson(Map json) => - _$GhPullsAssignableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsAssignableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsClosable with EquatableMixin { - GhPullsClosable(); - - factory GhPullsClosable.fromJson(Map json) => - _$GhPullsClosableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsClosableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsComment with EquatableMixin { - GhPullsComment({this.updatedAt, this.author}); - - factory GhPullsComment.fromJson(Map json) => - _$GhPullsCommentFromJson(json); - - DateTime updatedAt; - - GhPullsActor author; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [updatedAt, author, resolveType]; - Map toJson() => _$GhPullsCommentToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsUpdatable with EquatableMixin { - GhPullsUpdatable(); - - factory GhPullsUpdatable.fromJson(Map json) => - _$GhPullsUpdatableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsUpdatableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsUpdatableComment with EquatableMixin { - GhPullsUpdatableComment(); - - factory GhPullsUpdatableComment.fromJson(Map json) => - _$GhPullsUpdatableCommentFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsUpdatableCommentToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsLabelable with EquatableMixin { - GhPullsLabelable({this.labels}); - - factory GhPullsLabelable.fromJson(Map json) => - _$GhPullsLabelableFromJson(json); - - GhPullsLabelConnection labels; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [labels, resolveType]; - Map toJson() => _$GhPullsLabelableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsLockable with EquatableMixin { - GhPullsLockable(); - - factory GhPullsLockable.fromJson(Map json) => - _$GhPullsLockableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsLockableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsReactable with EquatableMixin { - GhPullsReactable(); - - factory GhPullsReactable.fromJson(Map json) => - _$GhPullsReactableFromJson(json); - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [resolveType]; - Map toJson() => _$GhPullsReactableToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsRepositoryNode with EquatableMixin { - GhPullsRepositoryNode({this.repository}); - - factory GhPullsRepositoryNode.fromJson(Map json) => - _$GhPullsRepositoryNodeFromJson(json); - - GhPullsRepository repository; - - @JsonKey(name: '__typename') - String resolveType; - - @override - List get props => [repository, resolveType]; - Map toJson() => _$GhPullsRepositoryNodeToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GhPullsArguments extends JsonSerializable with EquatableMixin { - GhPullsArguments({@required this.owner, @required this.name, this.cursor}); - - factory GhPullsArguments.fromJson(Map json) => - _$GhPullsArgumentsFromJson(json); - - final String owner; - - final String name; - - final String cursor; - - @override - List get props => [owner, name, cursor]; - Map toJson() => _$GhPullsArgumentsToJson(this); -} - -class GhPullsQuery extends GraphQLQuery { - GhPullsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GhPulls'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'owner')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'cursor')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'repository'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'owner'), - value: VariableNode(name: NameNode(value: 'owner'))), - ArgumentNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'owner'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'pullRequests'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'states'), - value: EnumValueNode(name: NameNode(value: 'OPEN'))), - ArgumentNode( - name: NameNode(value: 'orderBy'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'field'), - value: EnumValueNode( - name: NameNode(value: 'CREATED_AT'))), - ObjectFieldNode( - name: NameNode(value: 'direction'), - value: EnumValueNode( - name: NameNode(value: 'DESC'))) - ])), - ArgumentNode( - name: NameNode(value: 'first'), - value: IntValueNode(value: '30')), - ArgumentNode( - name: NameNode(value: 'after'), - value: VariableNode(name: NameNode(value: 'cursor'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'pageInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'hasNextPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'endCursor'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'nodes'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'repository'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'owner'), - alias: null, - arguments: [], - directives: [], - selectionSet: - SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'number'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'title'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'updatedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'author'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'avatarUrl'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'labels'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: IntValueNode(value: '10')) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'nodes'), - alias: null, - arguments: [], - directives: [], - selectionSet: - SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'color'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])), - FieldNode( - name: NameNode(value: 'comments'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'totalCount'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'GhPulls'; - - @override - final GhPullsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - GhPulls parse(Map json) => GhPulls.fromJson(json); -} diff --git a/lib/graphql/gh.g.dart b/lib/graphql/gh.g.dart index c658d83..dd79fd6 100644 --- a/lib/graphql/gh.g.dart +++ b/lib/graphql/gh.g.dart @@ -80,7 +80,8 @@ GhRepoRepository _$GhRepoRepositoryFromJson(Map json) { ..url = json['url'] as String ..viewerHasStarred = json['viewerHasStarred'] as bool ..viewerSubscription = _$enumDecodeNullable( - _$GhRepoSubscriptionStateEnumMap, json['viewerSubscription']) + _$GhRepoSubscriptionStateEnumMap, json['viewerSubscription'], + unknownValue: GhRepoSubscriptionState.ARTEMIS_UNKNOWN) ..projectsUrl = json['projectsUrl'] as String ..projects = json['projects'] == null ? null @@ -161,6 +162,7 @@ const _$GhRepoSubscriptionStateEnumMap = { GhRepoSubscriptionState.UNSUBSCRIBED: 'UNSUBSCRIBED', GhRepoSubscriptionState.SUBSCRIBED: 'SUBSCRIBED', GhRepoSubscriptionState.IGNORED: 'IGNORED', + GhRepoSubscriptionState.ARTEMIS_UNKNOWN: 'ARTEMIS_UNKNOWN', }; GhRepoRepositoryOwner _$GhRepoRepositoryOwnerFromJson( @@ -1335,6 +1337,414 @@ Map _$GhCreateIssueArgumentsToJson( 'body': instance.body, }; +GhPulls _$GhPullsFromJson(Map json) { + return GhPulls( + repository: json['repository'] == null + ? null + : GhPullsRepository.fromJson( + json['repository'] as Map), + ); +} + +Map _$GhPullsToJson(GhPulls instance) => { + 'repository': instance.repository?.toJson(), + }; + +GhPullsRepository _$GhPullsRepositoryFromJson(Map json) { + return GhPullsRepository( + pullRequests: json['pullRequests'] == null + ? null + : GhPullsPullRequestConnection.fromJson( + json['pullRequests'] as Map), + ) + ..owner = json['owner'] == null + ? null + : GhPullsRepositoryOwner.fromJson(json['owner'] as Map) + ..name = json['name'] as String + ..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRepositoryToJson(GhPullsRepository instance) => + { + 'owner': instance.owner?.toJson(), + 'name': instance.name, + 'pullRequests': instance.pullRequests?.toJson(), + '__typename': instance.resolveType, + }; + +GhPullsRepositoryOwner _$GhPullsRepositoryOwnerFromJson( + Map json) { + return GhPullsRepositoryOwner( + login: json['login'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRepositoryOwnerToJson( + GhPullsRepositoryOwner instance) => + { + 'login': instance.login, + '__typename': instance.resolveType, + }; + +GhPullsPullRequestConnection _$GhPullsPullRequestConnectionFromJson( + Map json) { + return GhPullsPullRequestConnection( + pageInfo: json['pageInfo'] == null + ? null + : GhPullsPageInfo.fromJson(json['pageInfo'] as Map), + nodes: (json['nodes'] as List) + ?.map((e) => e == null + ? null + : GhPullsPullRequest.fromJson(e as Map)) + ?.toList(), + ); +} + +Map _$GhPullsPullRequestConnectionToJson( + GhPullsPullRequestConnection instance) => + { + 'pageInfo': instance.pageInfo?.toJson(), + 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), + }; + +GhPullsPageInfo _$GhPullsPageInfoFromJson(Map json) { + return GhPullsPageInfo( + hasNextPage: json['hasNextPage'] as bool, + endCursor: json['endCursor'] as String, + ); +} + +Map _$GhPullsPageInfoToJson(GhPullsPageInfo instance) => + { + 'hasNextPage': instance.hasNextPage, + 'endCursor': instance.endCursor, + }; + +GhPullsPullRequest _$GhPullsPullRequestFromJson(Map json) { + return GhPullsPullRequest( + number: json['number'] as int, + title: json['title'] as String, + comments: json['comments'] == null + ? null + : GhPullsIssueCommentConnection.fromJson( + json['comments'] as Map), + ) + ..repository = json['repository'] == null + ? null + : GhPullsRepository.fromJson(json['repository'] as Map) + ..updatedAt = json['updatedAt'] == null + ? null + : DateTime.parse(json['updatedAt'] as String) + ..author = json['author'] == null + ? null + : GhPullsActor.fromJson(json['author'] as Map) + ..labels = json['labels'] == null + ? null + : GhPullsLabelConnection.fromJson( + json['labels'] as Map) + ..resolveType = json['__typename'] as String; +} + +Map _$GhPullsPullRequestToJson(GhPullsPullRequest instance) => + { + 'repository': instance.repository?.toJson(), + 'number': instance.number, + 'title': instance.title, + 'updatedAt': instance.updatedAt?.toIso8601String(), + 'author': instance.author?.toJson(), + 'labels': instance.labels?.toJson(), + 'comments': instance.comments?.toJson(), + '__typename': instance.resolveType, + }; + +GhPullsPinnableItem _$GhPullsPinnableItemFromJson(Map json) { + return GhPullsPinnableItem(); +} + +Map _$GhPullsPinnableItemToJson( + GhPullsPinnableItem instance) => + {}; + +GhPullsNode _$GhPullsNodeFromJson(Map json) { + return GhPullsNode()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsNodeToJson(GhPullsNode instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsProjectOwner _$GhPullsProjectOwnerFromJson(Map json) { + return GhPullsProjectOwner()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsProjectOwnerToJson( + GhPullsProjectOwner instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsRegistryPackageOwner _$GhPullsRegistryPackageOwnerFromJson( + Map json) { + return GhPullsRegistryPackageOwner() + ..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRegistryPackageOwnerToJson( + GhPullsRegistryPackageOwner instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsRegistryPackageSearch _$GhPullsRegistryPackageSearchFromJson( + Map json) { + return GhPullsRegistryPackageSearch() + ..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRegistryPackageSearchToJson( + GhPullsRegistryPackageSearch instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsSubscribable _$GhPullsSubscribableFromJson(Map json) { + return GhPullsSubscribable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsSubscribableToJson( + GhPullsSubscribable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsStarrable _$GhPullsStarrableFromJson(Map json) { + return GhPullsStarrable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsStarrableToJson(GhPullsStarrable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsUniformResourceLocatable _$GhPullsUniformResourceLocatableFromJson( + Map json) { + return GhPullsUniformResourceLocatable() + ..resolveType = json['__typename'] as String; +} + +Map _$GhPullsUniformResourceLocatableToJson( + GhPullsUniformResourceLocatable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsRepositoryInfo _$GhPullsRepositoryInfoFromJson( + Map json) { + return GhPullsRepositoryInfo( + owner: json['owner'] == null + ? null + : GhPullsRepositoryOwner.fromJson( + json['owner'] as Map), + name: json['name'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRepositoryInfoToJson( + GhPullsRepositoryInfo instance) => + { + 'owner': instance.owner?.toJson(), + 'name': instance.name, + '__typename': instance.resolveType, + }; + +GhPullsActor _$GhPullsActorFromJson(Map json) { + return GhPullsActor( + login: json['login'] as String, + avatarUrl: json['avatarUrl'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsActorToJson(GhPullsActor instance) => + { + 'login': instance.login, + 'avatarUrl': instance.avatarUrl, + '__typename': instance.resolveType, + }; + +GhPullsLabelConnection _$GhPullsLabelConnectionFromJson( + Map json) { + return GhPullsLabelConnection( + nodes: (json['nodes'] as List) + ?.map((e) => + e == null ? null : GhPullsLabel.fromJson(e as Map)) + ?.toList(), + ); +} + +Map _$GhPullsLabelConnectionToJson( + GhPullsLabelConnection instance) => + { + 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), + }; + +GhPullsLabel _$GhPullsLabelFromJson(Map json) { + return GhPullsLabel( + name: json['name'] as String, + color: json['color'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsLabelToJson(GhPullsLabel instance) => + { + 'name': instance.name, + 'color': instance.color, + '__typename': instance.resolveType, + }; + +GhPullsIssueCommentConnection _$GhPullsIssueCommentConnectionFromJson( + Map json) { + return GhPullsIssueCommentConnection( + totalCount: json['totalCount'] as int, + ); +} + +Map _$GhPullsIssueCommentConnectionToJson( + GhPullsIssueCommentConnection instance) => + { + 'totalCount': instance.totalCount, + }; + +GhPullsProjectCardItem _$GhPullsProjectCardItemFromJson( + Map json) { + return GhPullsProjectCardItem(); +} + +Map _$GhPullsProjectCardItemToJson( + GhPullsProjectCardItem instance) => + {}; + +GhPullsAssignable _$GhPullsAssignableFromJson(Map json) { + return GhPullsAssignable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsAssignableToJson(GhPullsAssignable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsClosable _$GhPullsClosableFromJson(Map json) { + return GhPullsClosable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsClosableToJson(GhPullsClosable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsComment _$GhPullsCommentFromJson(Map json) { + return GhPullsComment( + updatedAt: json['updatedAt'] == null + ? null + : DateTime.parse(json['updatedAt'] as String), + author: json['author'] == null + ? null + : GhPullsActor.fromJson(json['author'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsCommentToJson(GhPullsComment instance) => + { + 'updatedAt': instance.updatedAt?.toIso8601String(), + 'author': instance.author?.toJson(), + '__typename': instance.resolveType, + }; + +GhPullsUpdatable _$GhPullsUpdatableFromJson(Map json) { + return GhPullsUpdatable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsUpdatableToJson(GhPullsUpdatable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsUpdatableComment _$GhPullsUpdatableCommentFromJson( + Map json) { + return GhPullsUpdatableComment()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsUpdatableCommentToJson( + GhPullsUpdatableComment instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsLabelable _$GhPullsLabelableFromJson(Map json) { + return GhPullsLabelable( + labels: json['labels'] == null + ? null + : GhPullsLabelConnection.fromJson( + json['labels'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsLabelableToJson(GhPullsLabelable instance) => + { + 'labels': instance.labels?.toJson(), + '__typename': instance.resolveType, + }; + +GhPullsLockable _$GhPullsLockableFromJson(Map json) { + return GhPullsLockable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsLockableToJson(GhPullsLockable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsReactable _$GhPullsReactableFromJson(Map json) { + return GhPullsReactable()..resolveType = json['__typename'] as String; +} + +Map _$GhPullsReactableToJson(GhPullsReactable instance) => + { + '__typename': instance.resolveType, + }; + +GhPullsRepositoryNode _$GhPullsRepositoryNodeFromJson( + Map json) { + return GhPullsRepositoryNode( + repository: json['repository'] == null + ? null + : GhPullsRepository.fromJson( + json['repository'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhPullsRepositoryNodeToJson( + GhPullsRepositoryNode instance) => + { + 'repository': instance.repository?.toJson(), + '__typename': instance.resolveType, + }; + +GhPullsArguments _$GhPullsArgumentsFromJson(Map json) { + return GhPullsArguments( + owner: json['owner'] as String, + name: json['name'] as String, + cursor: json['cursor'] as String, + ); +} + +Map _$GhPullsArgumentsToJson(GhPullsArguments instance) => + { + 'owner': instance.owner, + 'name': instance.name, + 'cursor': instance.cursor, + }; + GhOpenIssue _$GhOpenIssueFromJson(Map json) { return GhOpenIssue( reopenIssue: json['reopenIssue'] == null @@ -1548,6 +1958,417 @@ Map _$GhOpenIssueArgumentsToJson( 'open': instance.open, }; +GhIssues _$GhIssuesFromJson(Map json) { + return GhIssues( + repository: json['repository'] == null + ? null + : GhIssuesRepository.fromJson( + json['repository'] as Map), + ); +} + +Map _$GhIssuesToJson(GhIssues instance) => { + 'repository': instance.repository?.toJson(), + }; + +GhIssuesRepository _$GhIssuesRepositoryFromJson(Map json) { + return GhIssuesRepository( + issues: json['issues'] == null + ? null + : GhIssuesIssueConnection.fromJson( + json['issues'] as Map), + ) + ..owner = json['owner'] == null + ? null + : GhIssuesRepositoryOwner.fromJson( + json['owner'] as Map) + ..name = json['name'] as String + ..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRepositoryToJson(GhIssuesRepository instance) => + { + 'owner': instance.owner?.toJson(), + 'name': instance.name, + 'issues': instance.issues?.toJson(), + '__typename': instance.resolveType, + }; + +GhIssuesRepositoryOwner _$GhIssuesRepositoryOwnerFromJson( + Map json) { + return GhIssuesRepositoryOwner( + login: json['login'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRepositoryOwnerToJson( + GhIssuesRepositoryOwner instance) => + { + 'login': instance.login, + '__typename': instance.resolveType, + }; + +GhIssuesIssueConnection _$GhIssuesIssueConnectionFromJson( + Map json) { + return GhIssuesIssueConnection( + pageInfo: json['pageInfo'] == null + ? null + : GhIssuesPageInfo.fromJson(json['pageInfo'] as Map), + nodes: (json['nodes'] as List) + ?.map((e) => e == null + ? null + : GhIssuesIssue.fromJson(e as Map)) + ?.toList(), + ); +} + +Map _$GhIssuesIssueConnectionToJson( + GhIssuesIssueConnection instance) => + { + 'pageInfo': instance.pageInfo?.toJson(), + 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), + }; + +GhIssuesPageInfo _$GhIssuesPageInfoFromJson(Map json) { + return GhIssuesPageInfo( + hasNextPage: json['hasNextPage'] as bool, + endCursor: json['endCursor'] as String, + ); +} + +Map _$GhIssuesPageInfoToJson(GhIssuesPageInfo instance) => + { + 'hasNextPage': instance.hasNextPage, + 'endCursor': instance.endCursor, + }; + +GhIssuesIssue _$GhIssuesIssueFromJson(Map json) { + return GhIssuesIssue( + number: json['number'] as int, + title: json['title'] as String, + comments: json['comments'] == null + ? null + : GhIssuesIssueCommentConnection.fromJson( + json['comments'] as Map), + ) + ..repository = json['repository'] == null + ? null + : GhIssuesRepository.fromJson( + json['repository'] as Map) + ..updatedAt = json['updatedAt'] == null + ? null + : DateTime.parse(json['updatedAt'] as String) + ..author = json['author'] == null + ? null + : GhIssuesActor.fromJson(json['author'] as Map) + ..labels = json['labels'] == null + ? null + : GhIssuesLabelConnection.fromJson( + json['labels'] as Map) + ..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesIssueToJson(GhIssuesIssue instance) => + { + 'repository': instance.repository?.toJson(), + 'number': instance.number, + 'title': instance.title, + 'updatedAt': instance.updatedAt?.toIso8601String(), + 'author': instance.author?.toJson(), + 'labels': instance.labels?.toJson(), + 'comments': instance.comments?.toJson(), + '__typename': instance.resolveType, + }; + +GhIssuesPinnableItem _$GhIssuesPinnableItemFromJson(Map json) { + return GhIssuesPinnableItem(); +} + +Map _$GhIssuesPinnableItemToJson( + GhIssuesPinnableItem instance) => + {}; + +GhIssuesNode _$GhIssuesNodeFromJson(Map json) { + return GhIssuesNode()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesNodeToJson(GhIssuesNode instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesProjectOwner _$GhIssuesProjectOwnerFromJson(Map json) { + return GhIssuesProjectOwner()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesProjectOwnerToJson( + GhIssuesProjectOwner instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesRegistryPackageOwner _$GhIssuesRegistryPackageOwnerFromJson( + Map json) { + return GhIssuesRegistryPackageOwner() + ..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRegistryPackageOwnerToJson( + GhIssuesRegistryPackageOwner instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesRegistryPackageSearch _$GhIssuesRegistryPackageSearchFromJson( + Map json) { + return GhIssuesRegistryPackageSearch() + ..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRegistryPackageSearchToJson( + GhIssuesRegistryPackageSearch instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesSubscribable _$GhIssuesSubscribableFromJson(Map json) { + return GhIssuesSubscribable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesSubscribableToJson( + GhIssuesSubscribable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesStarrable _$GhIssuesStarrableFromJson(Map json) { + return GhIssuesStarrable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesStarrableToJson(GhIssuesStarrable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesUniformResourceLocatable _$GhIssuesUniformResourceLocatableFromJson( + Map json) { + return GhIssuesUniformResourceLocatable() + ..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesUniformResourceLocatableToJson( + GhIssuesUniformResourceLocatable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesRepositoryInfo _$GhIssuesRepositoryInfoFromJson( + Map json) { + return GhIssuesRepositoryInfo( + owner: json['owner'] == null + ? null + : GhIssuesRepositoryOwner.fromJson( + json['owner'] as Map), + name: json['name'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRepositoryInfoToJson( + GhIssuesRepositoryInfo instance) => + { + 'owner': instance.owner?.toJson(), + 'name': instance.name, + '__typename': instance.resolveType, + }; + +GhIssuesActor _$GhIssuesActorFromJson(Map json) { + return GhIssuesActor( + login: json['login'] as String, + avatarUrl: json['avatarUrl'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesActorToJson(GhIssuesActor instance) => + { + 'login': instance.login, + 'avatarUrl': instance.avatarUrl, + '__typename': instance.resolveType, + }; + +GhIssuesLabelConnection _$GhIssuesLabelConnectionFromJson( + Map json) { + return GhIssuesLabelConnection( + nodes: (json['nodes'] as List) + ?.map((e) => e == null + ? null + : GhIssuesLabel.fromJson(e as Map)) + ?.toList(), + ); +} + +Map _$GhIssuesLabelConnectionToJson( + GhIssuesLabelConnection instance) => + { + 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), + }; + +GhIssuesLabel _$GhIssuesLabelFromJson(Map json) { + return GhIssuesLabel( + name: json['name'] as String, + color: json['color'] as String, + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesLabelToJson(GhIssuesLabel instance) => + { + 'name': instance.name, + 'color': instance.color, + '__typename': instance.resolveType, + }; + +GhIssuesIssueCommentConnection _$GhIssuesIssueCommentConnectionFromJson( + Map json) { + return GhIssuesIssueCommentConnection( + totalCount: json['totalCount'] as int, + ); +} + +Map _$GhIssuesIssueCommentConnectionToJson( + GhIssuesIssueCommentConnection instance) => + { + 'totalCount': instance.totalCount, + }; + +GhIssuesProjectCardItem _$GhIssuesProjectCardItemFromJson( + Map json) { + return GhIssuesProjectCardItem(); +} + +Map _$GhIssuesProjectCardItemToJson( + GhIssuesProjectCardItem instance) => + {}; + +GhIssuesAssignable _$GhIssuesAssignableFromJson(Map json) { + return GhIssuesAssignable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesAssignableToJson(GhIssuesAssignable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesClosable _$GhIssuesClosableFromJson(Map json) { + return GhIssuesClosable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesClosableToJson(GhIssuesClosable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesComment _$GhIssuesCommentFromJson(Map json) { + return GhIssuesComment( + updatedAt: json['updatedAt'] == null + ? null + : DateTime.parse(json['updatedAt'] as String), + author: json['author'] == null + ? null + : GhIssuesActor.fromJson(json['author'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesCommentToJson(GhIssuesComment instance) => + { + 'updatedAt': instance.updatedAt?.toIso8601String(), + 'author': instance.author?.toJson(), + '__typename': instance.resolveType, + }; + +GhIssuesUpdatable _$GhIssuesUpdatableFromJson(Map json) { + return GhIssuesUpdatable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesUpdatableToJson(GhIssuesUpdatable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesUpdatableComment _$GhIssuesUpdatableCommentFromJson( + Map json) { + return GhIssuesUpdatableComment()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesUpdatableCommentToJson( + GhIssuesUpdatableComment instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesLabelable _$GhIssuesLabelableFromJson(Map json) { + return GhIssuesLabelable( + labels: json['labels'] == null + ? null + : GhIssuesLabelConnection.fromJson( + json['labels'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesLabelableToJson(GhIssuesLabelable instance) => + { + 'labels': instance.labels?.toJson(), + '__typename': instance.resolveType, + }; + +GhIssuesLockable _$GhIssuesLockableFromJson(Map json) { + return GhIssuesLockable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesLockableToJson(GhIssuesLockable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesReactable _$GhIssuesReactableFromJson(Map json) { + return GhIssuesReactable()..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesReactableToJson(GhIssuesReactable instance) => + { + '__typename': instance.resolveType, + }; + +GhIssuesRepositoryNode _$GhIssuesRepositoryNodeFromJson( + Map json) { + return GhIssuesRepositoryNode( + repository: json['repository'] == null + ? null + : GhIssuesRepository.fromJson( + json['repository'] as Map), + )..resolveType = json['__typename'] as String; +} + +Map _$GhIssuesRepositoryNodeToJson( + GhIssuesRepositoryNode instance) => + { + 'repository': instance.repository?.toJson(), + '__typename': instance.resolveType, + }; + +GhIssuesArguments _$GhIssuesArgumentsFromJson(Map json) { + return GhIssuesArguments( + owner: json['owner'] as String, + name: json['name'] as String, + cursor: json['cursor'] as String, + ); +} + +Map _$GhIssuesArgumentsToJson(GhIssuesArguments instance) => + { + 'owner': instance.owner, + 'name': instance.name, + 'cursor': instance.cursor, + }; + GhRepos _$GhReposFromJson(Map json) { return GhRepos( repositoryOwner: json['repositoryOwner'] == null @@ -1992,7 +2813,8 @@ Map _$GhWatchSubscribableToJson( GhWatchRepository _$GhWatchRepositoryFromJson(Map json) { return GhWatchRepository( viewerSubscription: _$enumDecodeNullable( - _$GhWatchSubscriptionStateEnumMap, json['viewerSubscription']), + _$GhWatchSubscriptionStateEnumMap, json['viewerSubscription'], + unknownValue: GhWatchSubscriptionState.ARTEMIS_UNKNOWN), )..resolveType = json['__typename'] as String; } @@ -2007,6 +2829,7 @@ const _$GhWatchSubscriptionStateEnumMap = { GhWatchSubscriptionState.UNSUBSCRIBED: 'UNSUBSCRIBED', GhWatchSubscriptionState.SUBSCRIBED: 'SUBSCRIBED', GhWatchSubscriptionState.IGNORED: 'IGNORED', + GhWatchSubscriptionState.ARTEMIS_UNKNOWN: 'ARTEMIS_UNKNOWN', }; GhWatchPinnableItem _$GhWatchPinnableItemFromJson(Map json) { @@ -3337,7 +4160,8 @@ Map _$GhCommitsSponsorableToJson( GhCommitsStatus _$GhCommitsStatusFromJson(Map json) { return GhCommitsStatus( - state: _$enumDecodeNullable(_$GhCommitsStatusStateEnumMap, json['state']), + state: _$enumDecodeNullable(_$GhCommitsStatusStateEnumMap, json['state'], + unknownValue: GhCommitsStatusState.ARTEMIS_UNKNOWN), )..resolveType = json['__typename'] as String; } @@ -3353,6 +4177,7 @@ const _$GhCommitsStatusStateEnumMap = { GhCommitsStatusState.FAILURE: 'FAILURE', GhCommitsStatusState.PENDING: 'PENDING', GhCommitsStatusState.SUCCESS: 'SUCCESS', + GhCommitsStatusState.ARTEMIS_UNKNOWN: 'ARTEMIS_UNKNOWN', }; GhCommitsCommitHistoryConnection _$GhCommitsCommitHistoryConnectionFromJson( @@ -3603,822 +4428,3 @@ Map _$GhRepoIdArgumentsToJson(GhRepoIdArguments instance) => 'owner': instance.owner, 'name': instance.name, }; - -GhIssues _$GhIssuesFromJson(Map json) { - return GhIssues( - repository: json['repository'] == null - ? null - : GhIssuesRepository.fromJson( - json['repository'] as Map), - ); -} - -Map _$GhIssuesToJson(GhIssues instance) => { - 'repository': instance.repository?.toJson(), - }; - -GhIssuesRepository _$GhIssuesRepositoryFromJson(Map json) { - return GhIssuesRepository( - issues: json['issues'] == null - ? null - : GhIssuesIssueConnection.fromJson( - json['issues'] as Map), - ) - ..owner = json['owner'] == null - ? null - : GhIssuesRepositoryOwner.fromJson( - json['owner'] as Map) - ..name = json['name'] as String - ..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRepositoryToJson(GhIssuesRepository instance) => - { - 'owner': instance.owner?.toJson(), - 'name': instance.name, - 'issues': instance.issues?.toJson(), - '__typename': instance.resolveType, - }; - -GhIssuesRepositoryOwner _$GhIssuesRepositoryOwnerFromJson( - Map json) { - return GhIssuesRepositoryOwner( - login: json['login'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRepositoryOwnerToJson( - GhIssuesRepositoryOwner instance) => - { - 'login': instance.login, - '__typename': instance.resolveType, - }; - -GhIssuesIssueConnection _$GhIssuesIssueConnectionFromJson( - Map json) { - return GhIssuesIssueConnection( - pageInfo: json['pageInfo'] == null - ? null - : GhIssuesPageInfo.fromJson(json['pageInfo'] as Map), - nodes: (json['nodes'] as List) - ?.map((e) => e == null - ? null - : GhIssuesIssue.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$GhIssuesIssueConnectionToJson( - GhIssuesIssueConnection instance) => - { - 'pageInfo': instance.pageInfo?.toJson(), - 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), - }; - -GhIssuesPageInfo _$GhIssuesPageInfoFromJson(Map json) { - return GhIssuesPageInfo( - hasNextPage: json['hasNextPage'] as bool, - endCursor: json['endCursor'] as String, - ); -} - -Map _$GhIssuesPageInfoToJson(GhIssuesPageInfo instance) => - { - 'hasNextPage': instance.hasNextPage, - 'endCursor': instance.endCursor, - }; - -GhIssuesIssue _$GhIssuesIssueFromJson(Map json) { - return GhIssuesIssue( - number: json['number'] as int, - title: json['title'] as String, - comments: json['comments'] == null - ? null - : GhIssuesIssueCommentConnection.fromJson( - json['comments'] as Map), - ) - ..repository = json['repository'] == null - ? null - : GhIssuesRepository.fromJson( - json['repository'] as Map) - ..updatedAt = json['updatedAt'] == null - ? null - : DateTime.parse(json['updatedAt'] as String) - ..author = json['author'] == null - ? null - : GhIssuesActor.fromJson(json['author'] as Map) - ..labels = json['labels'] == null - ? null - : GhIssuesLabelConnection.fromJson( - json['labels'] as Map) - ..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesIssueToJson(GhIssuesIssue instance) => - { - 'repository': instance.repository?.toJson(), - 'number': instance.number, - 'title': instance.title, - 'updatedAt': instance.updatedAt?.toIso8601String(), - 'author': instance.author?.toJson(), - 'labels': instance.labels?.toJson(), - 'comments': instance.comments?.toJson(), - '__typename': instance.resolveType, - }; - -GhIssuesPinnableItem _$GhIssuesPinnableItemFromJson(Map json) { - return GhIssuesPinnableItem(); -} - -Map _$GhIssuesPinnableItemToJson( - GhIssuesPinnableItem instance) => - {}; - -GhIssuesNode _$GhIssuesNodeFromJson(Map json) { - return GhIssuesNode()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesNodeToJson(GhIssuesNode instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesProjectOwner _$GhIssuesProjectOwnerFromJson(Map json) { - return GhIssuesProjectOwner()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesProjectOwnerToJson( - GhIssuesProjectOwner instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesRegistryPackageOwner _$GhIssuesRegistryPackageOwnerFromJson( - Map json) { - return GhIssuesRegistryPackageOwner() - ..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRegistryPackageOwnerToJson( - GhIssuesRegistryPackageOwner instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesRegistryPackageSearch _$GhIssuesRegistryPackageSearchFromJson( - Map json) { - return GhIssuesRegistryPackageSearch() - ..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRegistryPackageSearchToJson( - GhIssuesRegistryPackageSearch instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesSubscribable _$GhIssuesSubscribableFromJson(Map json) { - return GhIssuesSubscribable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesSubscribableToJson( - GhIssuesSubscribable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesStarrable _$GhIssuesStarrableFromJson(Map json) { - return GhIssuesStarrable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesStarrableToJson(GhIssuesStarrable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesUniformResourceLocatable _$GhIssuesUniformResourceLocatableFromJson( - Map json) { - return GhIssuesUniformResourceLocatable() - ..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesUniformResourceLocatableToJson( - GhIssuesUniformResourceLocatable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesRepositoryInfo _$GhIssuesRepositoryInfoFromJson( - Map json) { - return GhIssuesRepositoryInfo( - owner: json['owner'] == null - ? null - : GhIssuesRepositoryOwner.fromJson( - json['owner'] as Map), - name: json['name'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRepositoryInfoToJson( - GhIssuesRepositoryInfo instance) => - { - 'owner': instance.owner?.toJson(), - 'name': instance.name, - '__typename': instance.resolveType, - }; - -GhIssuesActor _$GhIssuesActorFromJson(Map json) { - return GhIssuesActor( - login: json['login'] as String, - avatarUrl: json['avatarUrl'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesActorToJson(GhIssuesActor instance) => - { - 'login': instance.login, - 'avatarUrl': instance.avatarUrl, - '__typename': instance.resolveType, - }; - -GhIssuesLabelConnection _$GhIssuesLabelConnectionFromJson( - Map json) { - return GhIssuesLabelConnection( - nodes: (json['nodes'] as List) - ?.map((e) => e == null - ? null - : GhIssuesLabel.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$GhIssuesLabelConnectionToJson( - GhIssuesLabelConnection instance) => - { - 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), - }; - -GhIssuesLabel _$GhIssuesLabelFromJson(Map json) { - return GhIssuesLabel( - name: json['name'] as String, - color: json['color'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesLabelToJson(GhIssuesLabel instance) => - { - 'name': instance.name, - 'color': instance.color, - '__typename': instance.resolveType, - }; - -GhIssuesIssueCommentConnection _$GhIssuesIssueCommentConnectionFromJson( - Map json) { - return GhIssuesIssueCommentConnection( - totalCount: json['totalCount'] as int, - ); -} - -Map _$GhIssuesIssueCommentConnectionToJson( - GhIssuesIssueCommentConnection instance) => - { - 'totalCount': instance.totalCount, - }; - -GhIssuesProjectCardItem _$GhIssuesProjectCardItemFromJson( - Map json) { - return GhIssuesProjectCardItem(); -} - -Map _$GhIssuesProjectCardItemToJson( - GhIssuesProjectCardItem instance) => - {}; - -GhIssuesAssignable _$GhIssuesAssignableFromJson(Map json) { - return GhIssuesAssignable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesAssignableToJson(GhIssuesAssignable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesClosable _$GhIssuesClosableFromJson(Map json) { - return GhIssuesClosable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesClosableToJson(GhIssuesClosable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesComment _$GhIssuesCommentFromJson(Map json) { - return GhIssuesComment( - updatedAt: json['updatedAt'] == null - ? null - : DateTime.parse(json['updatedAt'] as String), - author: json['author'] == null - ? null - : GhIssuesActor.fromJson(json['author'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesCommentToJson(GhIssuesComment instance) => - { - 'updatedAt': instance.updatedAt?.toIso8601String(), - 'author': instance.author?.toJson(), - '__typename': instance.resolveType, - }; - -GhIssuesUpdatable _$GhIssuesUpdatableFromJson(Map json) { - return GhIssuesUpdatable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesUpdatableToJson(GhIssuesUpdatable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesUpdatableComment _$GhIssuesUpdatableCommentFromJson( - Map json) { - return GhIssuesUpdatableComment()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesUpdatableCommentToJson( - GhIssuesUpdatableComment instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesLabelable _$GhIssuesLabelableFromJson(Map json) { - return GhIssuesLabelable( - labels: json['labels'] == null - ? null - : GhIssuesLabelConnection.fromJson( - json['labels'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesLabelableToJson(GhIssuesLabelable instance) => - { - 'labels': instance.labels?.toJson(), - '__typename': instance.resolveType, - }; - -GhIssuesLockable _$GhIssuesLockableFromJson(Map json) { - return GhIssuesLockable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesLockableToJson(GhIssuesLockable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesReactable _$GhIssuesReactableFromJson(Map json) { - return GhIssuesReactable()..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesReactableToJson(GhIssuesReactable instance) => - { - '__typename': instance.resolveType, - }; - -GhIssuesRepositoryNode _$GhIssuesRepositoryNodeFromJson( - Map json) { - return GhIssuesRepositoryNode( - repository: json['repository'] == null - ? null - : GhIssuesRepository.fromJson( - json['repository'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhIssuesRepositoryNodeToJson( - GhIssuesRepositoryNode instance) => - { - 'repository': instance.repository?.toJson(), - '__typename': instance.resolveType, - }; - -GhIssuesArguments _$GhIssuesArgumentsFromJson(Map json) { - return GhIssuesArguments( - owner: json['owner'] as String, - name: json['name'] as String, - cursor: json['cursor'] as String, - ); -} - -Map _$GhIssuesArgumentsToJson(GhIssuesArguments instance) => - { - 'owner': instance.owner, - 'name': instance.name, - 'cursor': instance.cursor, - }; - -GhPulls _$GhPullsFromJson(Map json) { - return GhPulls( - repository: json['repository'] == null - ? null - : GhPullsRepository.fromJson( - json['repository'] as Map), - ); -} - -Map _$GhPullsToJson(GhPulls instance) => { - 'repository': instance.repository?.toJson(), - }; - -GhPullsRepository _$GhPullsRepositoryFromJson(Map json) { - return GhPullsRepository( - pullRequests: json['pullRequests'] == null - ? null - : GhPullsPullRequestConnection.fromJson( - json['pullRequests'] as Map), - ) - ..owner = json['owner'] == null - ? null - : GhPullsRepositoryOwner.fromJson(json['owner'] as Map) - ..name = json['name'] as String - ..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRepositoryToJson(GhPullsRepository instance) => - { - 'owner': instance.owner?.toJson(), - 'name': instance.name, - 'pullRequests': instance.pullRequests?.toJson(), - '__typename': instance.resolveType, - }; - -GhPullsRepositoryOwner _$GhPullsRepositoryOwnerFromJson( - Map json) { - return GhPullsRepositoryOwner( - login: json['login'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRepositoryOwnerToJson( - GhPullsRepositoryOwner instance) => - { - 'login': instance.login, - '__typename': instance.resolveType, - }; - -GhPullsPullRequestConnection _$GhPullsPullRequestConnectionFromJson( - Map json) { - return GhPullsPullRequestConnection( - pageInfo: json['pageInfo'] == null - ? null - : GhPullsPageInfo.fromJson(json['pageInfo'] as Map), - nodes: (json['nodes'] as List) - ?.map((e) => e == null - ? null - : GhPullsPullRequest.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$GhPullsPullRequestConnectionToJson( - GhPullsPullRequestConnection instance) => - { - 'pageInfo': instance.pageInfo?.toJson(), - 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), - }; - -GhPullsPageInfo _$GhPullsPageInfoFromJson(Map json) { - return GhPullsPageInfo( - hasNextPage: json['hasNextPage'] as bool, - endCursor: json['endCursor'] as String, - ); -} - -Map _$GhPullsPageInfoToJson(GhPullsPageInfo instance) => - { - 'hasNextPage': instance.hasNextPage, - 'endCursor': instance.endCursor, - }; - -GhPullsPullRequest _$GhPullsPullRequestFromJson(Map json) { - return GhPullsPullRequest( - number: json['number'] as int, - title: json['title'] as String, - comments: json['comments'] == null - ? null - : GhPullsIssueCommentConnection.fromJson( - json['comments'] as Map), - ) - ..repository = json['repository'] == null - ? null - : GhPullsRepository.fromJson(json['repository'] as Map) - ..updatedAt = json['updatedAt'] == null - ? null - : DateTime.parse(json['updatedAt'] as String) - ..author = json['author'] == null - ? null - : GhPullsActor.fromJson(json['author'] as Map) - ..labels = json['labels'] == null - ? null - : GhPullsLabelConnection.fromJson( - json['labels'] as Map) - ..resolveType = json['__typename'] as String; -} - -Map _$GhPullsPullRequestToJson(GhPullsPullRequest instance) => - { - 'repository': instance.repository?.toJson(), - 'number': instance.number, - 'title': instance.title, - 'updatedAt': instance.updatedAt?.toIso8601String(), - 'author': instance.author?.toJson(), - 'labels': instance.labels?.toJson(), - 'comments': instance.comments?.toJson(), - '__typename': instance.resolveType, - }; - -GhPullsPinnableItem _$GhPullsPinnableItemFromJson(Map json) { - return GhPullsPinnableItem(); -} - -Map _$GhPullsPinnableItemToJson( - GhPullsPinnableItem instance) => - {}; - -GhPullsNode _$GhPullsNodeFromJson(Map json) { - return GhPullsNode()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsNodeToJson(GhPullsNode instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsProjectOwner _$GhPullsProjectOwnerFromJson(Map json) { - return GhPullsProjectOwner()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsProjectOwnerToJson( - GhPullsProjectOwner instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsRegistryPackageOwner _$GhPullsRegistryPackageOwnerFromJson( - Map json) { - return GhPullsRegistryPackageOwner() - ..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRegistryPackageOwnerToJson( - GhPullsRegistryPackageOwner instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsRegistryPackageSearch _$GhPullsRegistryPackageSearchFromJson( - Map json) { - return GhPullsRegistryPackageSearch() - ..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRegistryPackageSearchToJson( - GhPullsRegistryPackageSearch instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsSubscribable _$GhPullsSubscribableFromJson(Map json) { - return GhPullsSubscribable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsSubscribableToJson( - GhPullsSubscribable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsStarrable _$GhPullsStarrableFromJson(Map json) { - return GhPullsStarrable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsStarrableToJson(GhPullsStarrable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsUniformResourceLocatable _$GhPullsUniformResourceLocatableFromJson( - Map json) { - return GhPullsUniformResourceLocatable() - ..resolveType = json['__typename'] as String; -} - -Map _$GhPullsUniformResourceLocatableToJson( - GhPullsUniformResourceLocatable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsRepositoryInfo _$GhPullsRepositoryInfoFromJson( - Map json) { - return GhPullsRepositoryInfo( - owner: json['owner'] == null - ? null - : GhPullsRepositoryOwner.fromJson( - json['owner'] as Map), - name: json['name'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRepositoryInfoToJson( - GhPullsRepositoryInfo instance) => - { - 'owner': instance.owner?.toJson(), - 'name': instance.name, - '__typename': instance.resolveType, - }; - -GhPullsActor _$GhPullsActorFromJson(Map json) { - return GhPullsActor( - login: json['login'] as String, - avatarUrl: json['avatarUrl'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsActorToJson(GhPullsActor instance) => - { - 'login': instance.login, - 'avatarUrl': instance.avatarUrl, - '__typename': instance.resolveType, - }; - -GhPullsLabelConnection _$GhPullsLabelConnectionFromJson( - Map json) { - return GhPullsLabelConnection( - nodes: (json['nodes'] as List) - ?.map((e) => - e == null ? null : GhPullsLabel.fromJson(e as Map)) - ?.toList(), - ); -} - -Map _$GhPullsLabelConnectionToJson( - GhPullsLabelConnection instance) => - { - 'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(), - }; - -GhPullsLabel _$GhPullsLabelFromJson(Map json) { - return GhPullsLabel( - name: json['name'] as String, - color: json['color'] as String, - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsLabelToJson(GhPullsLabel instance) => - { - 'name': instance.name, - 'color': instance.color, - '__typename': instance.resolveType, - }; - -GhPullsIssueCommentConnection _$GhPullsIssueCommentConnectionFromJson( - Map json) { - return GhPullsIssueCommentConnection( - totalCount: json['totalCount'] as int, - ); -} - -Map _$GhPullsIssueCommentConnectionToJson( - GhPullsIssueCommentConnection instance) => - { - 'totalCount': instance.totalCount, - }; - -GhPullsProjectCardItem _$GhPullsProjectCardItemFromJson( - Map json) { - return GhPullsProjectCardItem(); -} - -Map _$GhPullsProjectCardItemToJson( - GhPullsProjectCardItem instance) => - {}; - -GhPullsAssignable _$GhPullsAssignableFromJson(Map json) { - return GhPullsAssignable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsAssignableToJson(GhPullsAssignable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsClosable _$GhPullsClosableFromJson(Map json) { - return GhPullsClosable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsClosableToJson(GhPullsClosable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsComment _$GhPullsCommentFromJson(Map json) { - return GhPullsComment( - updatedAt: json['updatedAt'] == null - ? null - : DateTime.parse(json['updatedAt'] as String), - author: json['author'] == null - ? null - : GhPullsActor.fromJson(json['author'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsCommentToJson(GhPullsComment instance) => - { - 'updatedAt': instance.updatedAt?.toIso8601String(), - 'author': instance.author?.toJson(), - '__typename': instance.resolveType, - }; - -GhPullsUpdatable _$GhPullsUpdatableFromJson(Map json) { - return GhPullsUpdatable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsUpdatableToJson(GhPullsUpdatable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsUpdatableComment _$GhPullsUpdatableCommentFromJson( - Map json) { - return GhPullsUpdatableComment()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsUpdatableCommentToJson( - GhPullsUpdatableComment instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsLabelable _$GhPullsLabelableFromJson(Map json) { - return GhPullsLabelable( - labels: json['labels'] == null - ? null - : GhPullsLabelConnection.fromJson( - json['labels'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsLabelableToJson(GhPullsLabelable instance) => - { - 'labels': instance.labels?.toJson(), - '__typename': instance.resolveType, - }; - -GhPullsLockable _$GhPullsLockableFromJson(Map json) { - return GhPullsLockable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsLockableToJson(GhPullsLockable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsReactable _$GhPullsReactableFromJson(Map json) { - return GhPullsReactable()..resolveType = json['__typename'] as String; -} - -Map _$GhPullsReactableToJson(GhPullsReactable instance) => - { - '__typename': instance.resolveType, - }; - -GhPullsRepositoryNode _$GhPullsRepositoryNodeFromJson( - Map json) { - return GhPullsRepositoryNode( - repository: json['repository'] == null - ? null - : GhPullsRepository.fromJson( - json['repository'] as Map), - )..resolveType = json['__typename'] as String; -} - -Map _$GhPullsRepositoryNodeToJson( - GhPullsRepositoryNode instance) => - { - 'repository': instance.repository?.toJson(), - '__typename': instance.resolveType, - }; - -GhPullsArguments _$GhPullsArgumentsFromJson(Map json) { - return GhPullsArguments( - owner: json['owner'] as String, - name: json['name'] as String, - cursor: json['cursor'] as String, - ); -} - -Map _$GhPullsArgumentsToJson(GhPullsArguments instance) => - { - 'owner': instance.owner, - 'name': instance.name, - 'cursor': instance.cursor, - }; diff --git a/lib/graphql/gh_watch.graphql b/lib/graphql/gh_watch.graphql index 7b2e89d..0e7387f 100644 --- a/lib/graphql/gh_watch.graphql +++ b/lib/graphql/gh_watch.graphql @@ -1,6 +1,7 @@ mutation GhWatch($id: ID!, $state: SubscriptionState!) { updateSubscription(input: { subscribableId: $id, state: $state }) { subscribable { + __typename ... on Repository { viewerSubscription } diff --git a/lib/screens/repository.dart b/lib/screens/repository.dart index 92b6b3a..3b4da1d 100644 --- a/lib/screens/repository.dart +++ b/lib/screens/repository.dart @@ -81,6 +81,32 @@ class RepositoryScreen extends StatelessWidget { ); } + String _buildWatchState(GhRepoSubscriptionState state) { + switch (state) { + case GhRepoSubscriptionState.IGNORED: + return 'Ignoring'; + case GhRepoSubscriptionState.SUBSCRIBED: + return 'Watching'; + case GhRepoSubscriptionState.UNSUBSCRIBED: + return 'Not watching'; + default: + return 'Unknown'; + } + } + + String _buildWatchSelectState(GhWatchSubscriptionState state) { + switch (state) { + case GhWatchSubscriptionState.IGNORED: + return 'Ignoring'; + case GhWatchSubscriptionState.SUBSCRIBED: + return 'Watching'; + case GhWatchSubscriptionState.UNSUBSCRIBED: + return 'Not watching'; + default: + return ''; + } + } + @override Widget build(BuildContext context) { return RefreshStatefulScaffold>( @@ -135,73 +161,71 @@ class RepositoryScreen extends StatelessWidget { description: repo.description, homepageUrl: repo.homepageUrl, actions: [ - MutationButton( - text: repo.viewerHasStarred ? 'Unstar' : 'Star', - onPressed: () async { - final res = await auth.gqlClient.execute( - GhStarQuery( - variables: GhStarArguments( - id: repo.id, - flag: !repo.viewerHasStarred, - ), - ), - ); - setState(() { - repo.viewerHasStarred = - res.data.removeStar?.starrable?.viewerHasStarred ?? + Row( + children: [ + MutationButton( + text: _buildWatchState(repo.viewerSubscription), + onPressed: () async { + final vs = GhWatchSubscriptionState.values.where((v) => + v != GhWatchSubscriptionState.ARTEMIS_UNKNOWN); + theme.showActions(context, [ + for (var v in vs) + ActionItem( + text: _buildWatchSelectState(v), + onTap: (_) async { + final res = await auth.gqlClient.execute( + GhWatchQuery( + variables: GhWatchArguments( + id: repo.id, + state: v, + ), + ), + ); + setState(() { + final r = res.data.updateSubscription + .subscribable as GhWatchRepository; + switch (r.viewerSubscription) { + case GhWatchSubscriptionState.IGNORED: + repo.viewerSubscription = + GhRepoSubscriptionState.IGNORED; + break; + case GhWatchSubscriptionState.SUBSCRIBED: + repo.viewerSubscription = + GhRepoSubscriptionState.SUBSCRIBED; + break; + case GhWatchSubscriptionState.UNSUBSCRIBED: + repo.viewerSubscription = + GhRepoSubscriptionState.UNSUBSCRIBED; + break; + default: + } + }); + }, + ) + ]); + }, + ), + SizedBox(width: 8), + MutationButton( + text: repo.viewerHasStarred ? 'Unstar' : 'Star', + onPressed: () async { + final res = await auth.gqlClient.execute( + GhStarQuery( + variables: GhStarArguments( + id: repo.id, + flag: !repo.viewerHasStarred, + ), + ), + ); + setState(() { + repo.viewerHasStarred = res.data.removeStar?.starrable + ?.viewerHasStarred ?? res.data.addStar.starrable.viewerHasStarred; - }); - }, + }); + }, + ), + ], ), - // TODO: - // SizedBox(width: 4), - // MutationButton( - // text: repo.viewerSubscription == - // GhRepoSubscriptionState.SUBSCRIBED - // ? 'Unwatch' - // : 'Watch', - // onPressed: () async { - // theme.showActions( - // context, - // GhWatchSubscriptionState.values.map((v) { - // return ActionItem( - // text: v.toString(), - // onTap: (_) async { - // final res = await auth.gqlClient.execute( - // GhWatchQuery( - // variables: GhWatchArguments( - // id: repo.id, - // state: - // GhWatchSubscriptionState.SUBSCRIBED, - // ), - // ), - // ); - // setState(() { - // final r = res.data.updateSubscription - // .subscribable as GhWatchRepository; - // switch (r.viewerSubscription) { - // case GhWatchSubscriptionState.IGNORED: - // repo.viewerSubscription = - // GhRepoSubscriptionState.IGNORED; - // break; - // case GhWatchSubscriptionState.SUBSCRIBED: - // repo.viewerSubscription = - // GhRepoSubscriptionState.SUBSCRIBED; - // break; - // case GhWatchSubscriptionState - // .UNSUBSCRIBED: - // repo.viewerSubscription = - // GhRepoSubscriptionState - // .UNSUBSCRIBED; - // break; - // } - // }); - // }, - // ); - // }).toList(), - // ); - // }, - // ), ], trailings: [ if (repo.repositoryTopics.nodes.isNotEmpty)