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

194 lines
4.7 KiB
Dart
Raw Normal View History

2019-12-04 15:00:39 +01:00
import 'package:json_annotation/json_annotation.dart';
part 'gitlab.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
2019-12-11 16:09:39 +01:00
class GitlabUser {
2019-12-04 15:00:39 +01:00
int id;
2019-12-11 16:09:39 +01:00
String username;
2019-12-04 15:00:39 +01:00
String name;
2019-12-11 16:09:39 +01:00
String avatarUrl;
2020-01-29 06:45:22 +01:00
String bio;
DateTime createdAt;
2020-02-01 05:14:03 +01:00
int accessLevel;
2019-12-11 16:09:39 +01:00
GitlabUser();
factory GitlabUser.fromJson(Map<String, dynamic> json) =>
_$GitlabUserFromJson(json);
2020-01-31 15:45:40 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabGroup {
int id;
String path;
String name;
String avatarUrl;
String description;
List<GitlabProject> projects;
GitlabGroup();
factory GitlabGroup.fromJson(Map<String, dynamic> json) =>
_$GitlabGroupFromJson(json);
2019-12-04 15:00:39 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabTodoProject {
String pathWithNamespace;
GitlabTodoProject();
factory GitlabTodoProject.fromJson(Map<String, dynamic> json) =>
_$GitlabTodoProjectFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabTodo {
GitlabUser author;
GitlabTodoProject project;
String actionName;
String targetType;
2020-01-28 16:39:26 +01:00
GitlabTodoTarget target;
2019-12-04 15:00:39 +01:00
GitlabTodo();
factory GitlabTodo.fromJson(Map<String, dynamic> json) =>
_$GitlabTodoFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
2020-01-28 16:39:26 +01:00
class GitlabTodoTarget {
2019-12-04 15:00:39 +01:00
int iid;
int projectId;
String title;
GitlabUser author;
String description;
2020-01-30 11:57:39 +01:00
DateTime createdAt;
2020-01-28 16:39:26 +01:00
GitlabTodoTarget();
factory GitlabTodoTarget.fromJson(Map<String, dynamic> json) =>
_$GitlabTodoTargetFromJson(json);
2019-12-04 15:00:39 +01:00
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabIssueNote {
GitlabUser author;
String body;
2020-01-30 11:57:39 +01:00
bool system;
DateTime createdAt;
2019-12-04 15:00:39 +01:00
GitlabIssueNote();
factory GitlabIssueNote.fromJson(Map<String, dynamic> json) =>
_$GitlabIssueNoteFromJson(json);
}
2019-12-11 16:09:39 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabProject {
int id;
String name;
String avatarUrl;
String description;
int starCount;
int forksCount;
String visibility;
String readmeUrl;
String webUrl;
GitlabProjectNamespace namespace;
2020-01-31 15:36:58 +01:00
GitlabUser owner;
2019-12-11 16:09:39 +01:00
bool issuesEnabled;
int openIssuesCount;
bool mergeRequestsEnabled;
2020-01-28 14:01:06 +01:00
GitlabProjectStatistics statistics;
2020-01-29 07:38:27 +01:00
DateTime lastActivityAt;
2020-01-31 15:36:58 +01:00
DateTime createdAt;
String defaultBranch;
2019-12-11 16:09:39 +01:00
GitlabProject();
factory GitlabProject.fromJson(Map<String, dynamic> json) =>
_$GitlabProjectFromJson(json);
}
2020-01-28 15:10:44 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabProjectBadge {
String renderedImageUrl;
GitlabProjectBadge();
factory GitlabProjectBadge.fromJson(Map<String, dynamic> json) =>
_$GitlabProjectBadgeFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabProjectStatistics {
int commitCount;
int repositorySize;
GitlabProjectStatistics();
factory GitlabProjectStatistics.fromJson(Map<String, dynamic> json) =>
_$GitlabProjectStatisticsFromJson(json);
}
2019-12-11 16:09:39 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabProjectNamespace {
int id;
String name;
2020-01-29 07:38:27 +01:00
String path;
2020-01-31 15:36:58 +01:00
String kind;
2019-12-11 16:09:39 +01:00
GitlabProjectNamespace();
factory GitlabProjectNamespace.fromJson(Map<String, dynamic> json) =>
_$GitlabProjectNamespaceFromJson(json);
}
2019-12-11 16:37:29 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabTreeItem {
String type;
String path;
2019-12-11 17:07:12 +01:00
String name;
2019-12-11 16:37:29 +01:00
GitlabTreeItem();
factory GitlabTreeItem.fromJson(Map<String, dynamic> json) =>
_$GitlabTreeItemFromJson(json);
}
2019-12-11 16:58:25 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabBlob {
String content;
GitlabBlob();
factory GitlabBlob.fromJson(Map<String, dynamic> json) =>
_$GitlabBlobFromJson(json);
}
2019-12-14 17:08:45 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabEvent {
GitlabUser author;
String actionName;
String targetType;
GitlabEventNote note;
GitlabEvent();
factory GitlabEvent.fromJson(Map<String, dynamic> json) =>
_$GitlabEventFromJson(json);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabEventNote {
String body;
String noteableType;
int noteableIid;
GitlabEventNote();
factory GitlabEventNote.fromJson(Map<String, dynamic> json) =>
_$GitlabEventNoteFromJson(json);
}
2020-01-28 15:10:44 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabCommit {
String id;
String shortId;
String title;
DateTime createdAt;
String authorName;
String message;
GitlabCommit();
factory GitlabCommit.fromJson(Map<String, dynamic> json) =>
_$GitlabCommitFromJson(json);
}
2020-01-28 16:39:26 +01:00
@JsonSerializable(fieldRename: FieldRename.snake)
class GitlabIssue {
String title;
int iid;
int projectId;
GitlabUser author;
int userNotesCount;
DateTime updatedAt;
List<String> labels;
GitlabIssue();
factory GitlabIssue.fromJson(Map<String, dynamic> json) =>
_$GitlabIssueFromJson(json);
}