2019-12-04 15:02:22 +01:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'gitea.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaUser {
|
|
|
|
int id;
|
|
|
|
String login;
|
|
|
|
String fullName;
|
|
|
|
String avatarUrl;
|
2020-01-29 11:00:48 +01:00
|
|
|
DateTime created;
|
2019-12-04 15:02:22 +01:00
|
|
|
GiteaUser();
|
|
|
|
factory GiteaUser.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaUserFromJson(json);
|
|
|
|
}
|
|
|
|
|
2020-02-01 11:51:33 +01:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaOrg {
|
|
|
|
int id;
|
|
|
|
String username;
|
|
|
|
String fullName;
|
|
|
|
String avatarUrl;
|
|
|
|
String description;
|
|
|
|
GiteaOrg();
|
|
|
|
factory GiteaOrg.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaOrgFromJson(json);
|
|
|
|
}
|
|
|
|
|
2020-01-29 11:00:48 +01:00
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
2019-12-04 15:02:22 +01:00
|
|
|
class GiteaRepository {
|
|
|
|
int id;
|
|
|
|
GiteaUser owner;
|
|
|
|
String name;
|
|
|
|
String description;
|
|
|
|
int starsCount;
|
|
|
|
int forksCount;
|
2020-01-29 11:00:48 +01:00
|
|
|
DateTime updatedAt;
|
2020-01-29 11:50:17 +01:00
|
|
|
String website;
|
|
|
|
int size;
|
|
|
|
int openIssuesCount;
|
|
|
|
int openPrCounter;
|
2019-12-04 15:02:22 +01:00
|
|
|
GiteaRepository();
|
|
|
|
factory GiteaRepository.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaRepositoryFromJson(json);
|
|
|
|
}
|
2020-01-30 08:04:29 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaTree {
|
|
|
|
String type;
|
|
|
|
String name;
|
|
|
|
String path;
|
2020-01-30 08:31:46 +01:00
|
|
|
int size;
|
2020-01-31 09:40:20 +01:00
|
|
|
String downloadUrl;
|
2020-01-30 08:04:29 +01:00
|
|
|
GiteaTree();
|
|
|
|
factory GiteaTree.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaTreeFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaBlob extends GiteaTree {
|
|
|
|
String content;
|
|
|
|
GiteaBlob();
|
|
|
|
factory GiteaBlob.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaBlobFromJson(json);
|
|
|
|
}
|
2020-02-01 08:21:42 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaCommit {
|
|
|
|
int number;
|
|
|
|
GiteaUser author;
|
|
|
|
String title;
|
|
|
|
String body;
|
|
|
|
GiteaCommitDetail commit;
|
|
|
|
String sha;
|
|
|
|
String htmlUrl;
|
|
|
|
GiteaCommit();
|
|
|
|
factory GiteaCommit.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaCommitFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaCommitDetail {
|
|
|
|
String message;
|
|
|
|
GiteaCommitAuthor author;
|
|
|
|
GiteaCommitAuthor committer;
|
|
|
|
GiteaCommitDetail();
|
|
|
|
factory GiteaCommitDetail.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaCommitDetailFromJson(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaCommitAuthor {
|
|
|
|
String name;
|
|
|
|
String email;
|
|
|
|
DateTime date;
|
|
|
|
GiteaCommitAuthor();
|
|
|
|
factory GiteaCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaCommitAuthorFromJson(json);
|
|
|
|
}
|
2020-02-01 08:42:10 +01:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaIssue {
|
|
|
|
String title;
|
|
|
|
String body;
|
|
|
|
int number;
|
|
|
|
GiteaUser user;
|
|
|
|
int comments;
|
|
|
|
DateTime updatedAt;
|
|
|
|
String htmlUrl;
|
|
|
|
GiteaIssue();
|
|
|
|
factory GiteaIssue.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaIssueFromJson(json);
|
|
|
|
}
|
2020-10-05 10:07:07 +02:00
|
|
|
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
|
|
class GiteaHeatmapItem {
|
|
|
|
int timestamp;
|
|
|
|
int contributions;
|
|
|
|
GiteaHeatmapItem();
|
|
|
|
factory GiteaHeatmapItem.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$GiteaHeatmapItemFromJson(json);
|
|
|
|
}
|