2020-10-13 18:43:11 +02:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'gitee.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeUser {
|
|
|
|
String login;
|
|
|
|
String avatarUrl;
|
2020-10-17 11:35:08 +02:00
|
|
|
String name;
|
|
|
|
String htmlUrl;
|
|
|
|
String bio;
|
|
|
|
String blog;
|
|
|
|
int publicRepos;
|
|
|
|
int followers;
|
|
|
|
int following;
|
|
|
|
int stared;
|
|
|
|
int watched;
|
|
|
|
DateTime createdAt;
|
2020-10-13 18:43:11 +02:00
|
|
|
GiteeUser();
|
|
|
|
factory GiteeUser.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeUserFromJson(json);
|
|
|
|
}
|
2020-10-17 11:35:08 +02:00
|
|
|
|
2020-10-17 12:18:26 +02:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeListUser {
|
|
|
|
String login;
|
|
|
|
String avatarUrl;
|
|
|
|
String name;
|
|
|
|
String htmlUrl;
|
|
|
|
GiteeListUser();
|
|
|
|
factory GiteeListUser.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeListUserFromJson(json);
|
|
|
|
}
|
|
|
|
|
2020-10-17 11:35:08 +02:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeRepo {
|
2020-10-17 13:06:11 +02:00
|
|
|
GiteeRepoNamespace namespace;
|
2020-10-17 11:35:08 +02:00
|
|
|
GiteeRepoOwner owner;
|
|
|
|
String path;
|
|
|
|
String description;
|
|
|
|
bool private;
|
|
|
|
bool public;
|
|
|
|
bool internal;
|
|
|
|
bool fork;
|
|
|
|
int forksCount;
|
|
|
|
int stargazersCount;
|
|
|
|
int watchersCount;
|
|
|
|
DateTime updatedAt;
|
2020-10-17 13:06:11 +02:00
|
|
|
String license;
|
|
|
|
String homepage;
|
|
|
|
int openIssuesCount;
|
|
|
|
bool pullRequestsEnabled;
|
2020-11-01 16:16:52 +01:00
|
|
|
String defaultBranch;
|
2020-10-17 11:35:08 +02:00
|
|
|
GiteeRepo();
|
|
|
|
factory GiteeRepo.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeRepoFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeRepoOwner {
|
|
|
|
String login;
|
|
|
|
String avatarUrl;
|
|
|
|
GiteeRepoOwner();
|
|
|
|
factory GiteeRepoOwner.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeRepoOwnerFromJson(json);
|
|
|
|
}
|
2020-10-17 13:06:11 +02:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeRepoNamespace {
|
|
|
|
String path;
|
|
|
|
GiteeRepoNamespace();
|
|
|
|
factory GiteeRepoNamespace.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeRepoNamespaceFromJson(json);
|
|
|
|
}
|
2020-10-17 14:46:47 +02:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeCommit {
|
|
|
|
GiteeUser author;
|
|
|
|
GiteeCommitDetail commit;
|
|
|
|
String sha;
|
|
|
|
String htmlUrl;
|
2021-01-08 03:25:22 +01:00
|
|
|
List<GiteeCommitFile> files;
|
2020-10-17 14:46:47 +02:00
|
|
|
GiteeCommit();
|
|
|
|
factory GiteeCommit.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeCommitFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeCommitDetail {
|
|
|
|
String message;
|
|
|
|
GiteeCommitAuthor author;
|
|
|
|
GiteeCommitAuthor committer;
|
|
|
|
GiteeCommitDetail();
|
|
|
|
factory GiteeCommitDetail.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeCommitDetailFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeCommitAuthor {
|
|
|
|
String name;
|
|
|
|
String email;
|
|
|
|
DateTime date;
|
|
|
|
GiteeCommitAuthor();
|
|
|
|
factory GiteeCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeCommitAuthorFromJson(json);
|
|
|
|
}
|
2020-11-01 16:16:52 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeTreeItem {
|
|
|
|
String path;
|
|
|
|
String type;
|
|
|
|
String sha;
|
|
|
|
int size;
|
|
|
|
GiteeTreeItem();
|
|
|
|
factory GiteeTreeItem.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeTreeItemFromJson(json);
|
|
|
|
}
|
2020-11-01 16:23:03 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeBlob {
|
|
|
|
String content;
|
|
|
|
GiteeBlob();
|
|
|
|
factory GiteeBlob.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeBlobFromJson(json);
|
|
|
|
}
|
2021-01-06 05:52:58 +01:00
|
|
|
|
2021-01-09 17:52:45 +01:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeLabel {
|
|
|
|
String color;
|
|
|
|
String name;
|
|
|
|
GiteeLabel();
|
|
|
|
factory GiteeLabel.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeLabelFromJson(json);
|
|
|
|
}
|
|
|
|
|
2021-01-06 05:52:58 +01:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeIssue {
|
|
|
|
int comments;
|
|
|
|
String commentsUrl;
|
|
|
|
String createdAt;
|
|
|
|
String htmlUrl;
|
|
|
|
String updatedAt;
|
|
|
|
String body;
|
|
|
|
String bodyHtml;
|
|
|
|
String title;
|
|
|
|
String state;
|
2021-01-06 07:57:31 +01:00
|
|
|
GiteeRepo repository;
|
2021-01-06 05:52:58 +01:00
|
|
|
GiteeRepoOwner user;
|
|
|
|
String number;
|
2021-01-09 17:52:45 +01:00
|
|
|
List<GiteeLabel> labels;
|
2021-01-06 05:52:58 +01:00
|
|
|
int id;
|
|
|
|
GiteeIssue();
|
|
|
|
factory GiteeIssue.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeIssueFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteePull {
|
|
|
|
String commentsUrl;
|
|
|
|
String createdAt;
|
|
|
|
String htmlUrl;
|
|
|
|
String updatedAt;
|
|
|
|
String body;
|
|
|
|
String bodyHtml;
|
|
|
|
String title;
|
2021-01-08 03:25:22 +01:00
|
|
|
String state;
|
2021-01-06 05:52:58 +01:00
|
|
|
GiteeRepoOwner user;
|
2021-01-09 17:52:45 +01:00
|
|
|
List<GiteeLabel> labels;
|
2021-01-06 05:52:58 +01:00
|
|
|
int number;
|
|
|
|
int id;
|
|
|
|
GiteePull();
|
|
|
|
factory GiteePull.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteePullFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeComment {
|
2021-01-09 04:23:52 +01:00
|
|
|
int id;
|
2021-01-06 05:52:58 +01:00
|
|
|
String body;
|
|
|
|
String createdAt;
|
|
|
|
GiteeRepoOwner user;
|
|
|
|
GiteeComment();
|
|
|
|
factory GiteeComment.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeCommentFromJson(json);
|
|
|
|
}
|
2021-01-08 03:25:22 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteePatch {
|
|
|
|
String diff;
|
|
|
|
GiteePatch();
|
|
|
|
factory GiteePatch.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteePatchFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Two different classes because of variable type mismatch
|
|
|
|
// for additions, deletions, patch
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteePullFile {
|
|
|
|
String additions;
|
|
|
|
String deletions;
|
|
|
|
String blobUrl;
|
|
|
|
String filename;
|
|
|
|
String sha;
|
|
|
|
String status;
|
|
|
|
GiteePatch patch;
|
|
|
|
GiteePullFile();
|
|
|
|
factory GiteePullFile.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteePullFileFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeCommitFile {
|
|
|
|
int additions;
|
|
|
|
int deletions;
|
|
|
|
int changes;
|
|
|
|
String blobUrl;
|
|
|
|
String filename;
|
|
|
|
String sha;
|
|
|
|
String status;
|
|
|
|
String patch;
|
|
|
|
GiteeCommitFile();
|
|
|
|
factory GiteeCommitFile.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeCommitFileFromJson(json);
|
|
|
|
}
|
2021-01-09 17:52:45 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeContributor {
|
|
|
|
String name;
|
|
|
|
int contributions;
|
|
|
|
GiteeContributor();
|
|
|
|
factory GiteeContributor.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeContributorFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteeBranch {
|
|
|
|
String name;
|
|
|
|
GiteeBranch();
|
|
|
|
factory GiteeBranch.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteeBranchFromJson(json);
|
|
|
|
}
|