2023-12-29 17:13:51 +00:00
|
|
|
class Build {
|
|
|
|
final int id;
|
|
|
|
final String pkg_name;
|
2024-02-17 18:50:15 +00:00
|
|
|
final int pkg_id;
|
2023-12-29 17:13:51 +00:00
|
|
|
final String version;
|
|
|
|
final int status;
|
2024-02-24 20:05:50 +00:00
|
|
|
final DateTime? end_time;
|
|
|
|
final DateTime start_time;
|
2023-12-29 17:13:51 +00:00
|
|
|
|
|
|
|
Build(
|
2023-12-29 23:45:33 +00:00
|
|
|
{required this.id,
|
2024-02-17 18:50:15 +00:00
|
|
|
required this.pkg_id,
|
2023-12-29 23:45:33 +00:00
|
|
|
required this.pkg_name,
|
|
|
|
required this.version,
|
2024-01-01 22:07:52 +00:00
|
|
|
required this.start_time,
|
|
|
|
required this.end_time,
|
2023-12-29 23:45:33 +00:00
|
|
|
required this.status});
|
2023-12-29 17:13:51 +00:00
|
|
|
|
|
|
|
factory Build.fromJson(Map<String, dynamic> json) {
|
2024-02-24 20:05:50 +00:00
|
|
|
final startTime =
|
|
|
|
DateTime.fromMillisecondsSinceEpoch(json["start_time"] * 1000);
|
|
|
|
final endTime = json["end_time"] != null
|
|
|
|
? DateTime.fromMillisecondsSinceEpoch((json["end_time"] as int) * 1000)
|
|
|
|
: null;
|
|
|
|
|
2023-12-29 17:13:51 +00:00
|
|
|
return Build(
|
|
|
|
id: json["id"] as int,
|
2024-02-17 18:50:15 +00:00
|
|
|
pkg_id: json["pkg_id"] as int,
|
2023-12-29 17:13:51 +00:00
|
|
|
status: json["status"] as int,
|
2024-02-24 20:05:50 +00:00
|
|
|
start_time: startTime,
|
|
|
|
end_time: endTime,
|
2023-12-29 17:13:51 +00:00
|
|
|
pkg_name: json["pkg_name"] as String,
|
|
|
|
version: json["version"] as String,
|
|
|
|
);
|
|
|
|
}
|
2023-12-29 23:45:33 +00:00
|
|
|
}
|