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 {
2022-09-21 18:28:21 +02:00
GogsUser();
factory GogsUser.fromJson(Map<String, dynamic> json) =>
_$GogsUserFromJson(json);
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
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsRepository {
2022-09-21 18:28:21 +02:00
GogsRepository();
factory GogsRepository.fromJson(Map<String, dynamic> json) =>
_$GogsRepositoryFromJson(json);
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
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsOrg {
2022-09-21 18:28:21 +02:00
GogsOrg();
factory GogsOrg.fromJson(Map<String, dynamic> json) =>
_$GogsOrgFromJson(json);
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
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsTree {
2022-09-21 18:28:21 +02:00
GogsTree({required this.type, required this.name});
factory GogsTree.fromJson(Map<String, dynamic> json) =>
_$GogsTreeFromJson(json);
String type;
String name;
2021-05-16 09:16:35 +02:00
String? path;
int? size;
String? downloadUrl;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsBlob extends GogsTree {
2022-09-25 19:59:30 +02:00
GogsBlob({required super.type, required super.name});
2021-01-23 15:08:05 +01:00
factory GogsBlob.fromJson(Map<String, dynamic> json) =>
_$GogsBlobFromJson(json);
2022-09-21 18:28:21 +02:00
String? content;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsBranch {
GogsBranch();
factory GogsBranch.fromJson(Map<String, dynamic> json) =>
_$GogsBranchFromJson(json);
2022-09-21 18:28:21 +02:00
String? name;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommit {
2022-09-21 18:28:21 +02:00
GogsCommit();
factory GogsCommit.fromJson(Map<String, dynamic> json) =>
_$GogsCommitFromJson(json);
2021-05-16 09:16:35 +02:00
GogsUser? author;
GogsCommitDetail? commit;
String? sha;
String? htmlUrl;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommitDetail {
GogsCommitDetail();
factory GogsCommitDetail.fromJson(Map<String, dynamic> json) =>
_$GogsCommitDetailFromJson(json);
2022-09-21 18:28:21 +02:00
String? message;
GogsCommitAuthor? author;
GogsCommitAuthor? committer;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsCommitAuthor {
GogsCommitAuthor();
factory GogsCommitAuthor.fromJson(Map<String, dynamic> json) =>
_$GogsCommitAuthorFromJson(json);
2022-09-21 18:28:21 +02:00
String? name;
String? email;
DateTime? date;
2021-01-23 15:08:05 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsIssue {
2022-09-21 18:28:21 +02:00
GogsIssue();
factory GogsIssue.fromJson(Map<String, dynamic> json) =>
_$GogsIssueFromJson(json);
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
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GogsLabel {
GogsLabel();
factory GogsLabel.fromJson(Map<String, dynamic> json) =>
_$GogsLabelFromJson(json);
2022-09-21 18:28:21 +02:00
String? name;
String? color;
2021-01-23 15:08:05 +01:00
}