git-touch-android-ios-app/lib/models/gogs.dart

134 lines
3.1 KiB
Dart
Raw Normal View History

2021-01-23 15:08:05 +01:00
import 'package:json_annotation/json_annotation.dart';
part 'gogs.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsUser {
2021-05-16 09:16:35 +02:00
int? id;
String? username;
String? fullName;
String? avatarUrl;
String? email;
2021-01-23 15:08:05 +01:00
GogsUser();
factory GogsUser.fromJson(Map<String, dynamic> json) =>
_$GogsUserFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsRepository {
2021-05-16 09:16:35 +02:00
int? id;
String? fullName;
bool? private;
GogsUser? owner;
String? htmlUrl;
String? description;
String? defaultBranch;
DateTime? createdAt;
DateTime? updatedAt;
int? starsCount;
int? forksCount;
String? website;
int? watchersCount;
2021-01-23 15:08:05 +01:00
GogsRepository();
factory GogsRepository.fromJson(Map<String, dynamic> json) =>
_$GogsRepositoryFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsOrg {
2021-05-16 09:16:35 +02:00
int? id;
String? username;
String? fullName;
String? avatarUrl;
String? description;
String? location;
String? website;
2021-01-23 15:08:05 +01:00
GogsOrg();
factory GogsOrg.fromJson(Map<String, dynamic> json) =>
_$GogsOrgFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsTree {
2021-05-16 09:16:35 +02:00
String? type;
String? name;
String? path;
int? size;
String? downloadUrl;
2021-01-23 15:08:05 +01:00
GogsTree();
factory GogsTree.fromJson(Map<String, dynamic> json) =>
_$GogsTreeFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsBlob extends GogsTree {
2021-05-16 09:16:35 +02:00
String? content;
2021-01-23 15:08:05 +01:00
GogsBlob();
factory GogsBlob.fromJson(Map<String, dynamic> json) =>
_$GogsBlobFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsBranch {
2021-05-16 09:16:35 +02:00
String? name;
2021-01-23 15:08:05 +01:00
GogsBranch();
factory GogsBranch.fromJson(Map<String, dynamic> json) =>
_$GogsBranchFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommit {
2021-05-16 09:16:35 +02:00
GogsUser? author;
GogsCommitDetail? commit;
String? sha;
String? htmlUrl;
2021-01-23 15:08:05 +01:00
GogsCommit();
factory GogsCommit.fromJson(Map<String, dynamic> json) =>
_$GogsCommitFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommitDetail {
2021-05-16 09:16:35 +02:00
String? message;
GogsCommitAuthor? author;
GogsCommitAuthor? committer;
2021-01-23 15:08:05 +01:00
GogsCommitDetail();
factory GogsCommitDetail.fromJson(Map<String, dynamic> json) =>
_$GogsCommitDetailFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommitAuthor {
2021-05-16 09:16:35 +02:00
String? name;
String? email;
DateTime? date;
2021-01-23 15:08:05 +01:00
GogsCommitAuthor();
factory GogsCommitAuthor.fromJson(Map<String, dynamic> json) =>
_$GogsCommitAuthorFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsIssue {
2021-05-16 09:16:35 +02:00
int? number;
String? state;
String? title;
String? body;
GogsUser? user;
List<GogsLabel>? labels;
DateTime? createdAt;
DateTime? updatedAt;
int? comments;
2021-01-23 15:08:05 +01:00
GogsIssue();
factory GogsIssue.fromJson(Map<String, dynamic> json) =>
_$GogsIssueFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsLabel {
2021-05-16 09:16:35 +02:00
String? name;
String? color;
2021-01-23 15:08:05 +01:00
GogsLabel();
factory GogsLabel.fromJson(Map<String, dynamic> json) =>
_$GogsLabelFromJson(json);
}