1
0
mirror of https://github.com/krawieck/lemmur/ synced 2024-12-18 11:28:45 +01:00
lemmur-app-android/lib/client/models/site.dart

63 lines
1.4 KiB
Dart
Raw Normal View History

2020-08-10 19:23:03 +02:00
import 'package:json_annotation/json_annotation.dart';
2020-08-10 14:39:22 +02:00
part 'site.g.dart';
/// based on https://github.com/LemmyNet/lemmy/blob/464ea862b10fa7b226b2550268e40d8e685a939c/server/lemmy_db/src/site_view.rs#L31
@JsonSerializable(fieldRename: FieldRename.snake, createToJson: false)
class SiteView {
final int id;
final String name;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final String description;
final int creatorId;
final DateTime published;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final DateTime updated;
final bool enableDownvotes;
final bool openRegistration;
final bool enableNsfw;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final String icon;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final String banner;
final String creatorName;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final String creatorPreferredUsername;
2020-08-10 19:23:03 +02:00
2020-08-10 14:39:22 +02:00
/// can be null
final String creatorAvatar;
final int numberOfUsers;
final int numberOfPosts;
final int numberOfComments;
final int numberOfCommunities;
const SiteView({
this.id,
this.name,
this.description,
this.creatorId,
this.published,
this.updated,
this.enableDownvotes,
this.openRegistration,
this.enableNsfw,
this.icon,
this.banner,
this.creatorName,
this.creatorPreferredUsername,
this.creatorAvatar,
this.numberOfUsers,
this.numberOfPosts,
this.numberOfComments,
this.numberOfCommunities,
});
factory SiteView.fromJson(Map<String, dynamic> json) =>
_$SiteViewFromJson(json);
}