2021-02-02 14:33:23 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'uploaded_paste.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable()
|
|
|
|
class UploadedPaste {
|
2021-11-29 23:44:22 +00:00
|
|
|
final DateTime? date;
|
|
|
|
final String? filename;
|
|
|
|
final num? filesize;
|
|
|
|
final String? hash;
|
2021-02-02 14:33:23 +00:00
|
|
|
final String id;
|
2021-11-29 23:44:22 +00:00
|
|
|
final String? mimetype;
|
|
|
|
final String? thumbnail;
|
|
|
|
final bool? isMulti;
|
|
|
|
final List<String?>? items;
|
2021-02-02 14:33:23 +00:00
|
|
|
|
|
|
|
UploadedPaste(
|
|
|
|
{this.date,
|
|
|
|
this.filename,
|
|
|
|
this.filesize,
|
|
|
|
this.hash,
|
2021-11-29 23:44:22 +00:00
|
|
|
required this.id,
|
2021-02-02 14:33:23 +00:00
|
|
|
this.mimetype,
|
|
|
|
this.thumbnail,
|
|
|
|
this.isMulti,
|
|
|
|
this.items});
|
|
|
|
|
|
|
|
// JSON Init
|
2023-01-16 00:44:34 +00:00
|
|
|
factory UploadedPaste.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$UploadedPasteFromJson(json);
|
2021-02-02 14:33:23 +00:00
|
|
|
|
|
|
|
// JSON Export
|
|
|
|
Map<String, dynamic> toJson() => _$UploadedPasteToJson(this);
|
|
|
|
}
|