2020-08-10 16:47:05 +02:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
import './comment.dart';
|
|
|
|
import './community.dart';
|
2020-08-11 19:32:13 +02:00
|
|
|
import './post.dart';
|
2020-08-10 16:47:05 +02:00
|
|
|
import './user.dart';
|
|
|
|
|
|
|
|
part 'search.g.dart';
|
|
|
|
|
|
|
|
/// based on https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#search
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class Search {
|
2020-08-11 19:54:12 +02:00
|
|
|
@JsonKey(name: "type_")
|
|
|
|
final String type;
|
2020-08-10 16:47:05 +02:00
|
|
|
final List<CommentView> comments;
|
|
|
|
final List<PostView> posts;
|
|
|
|
final List<CommunityView> communities;
|
|
|
|
final List<UserView> users;
|
|
|
|
|
|
|
|
const Search({
|
2020-08-11 19:54:12 +02:00
|
|
|
this.type,
|
2020-08-10 16:47:05 +02:00
|
|
|
this.comments,
|
|
|
|
this.posts,
|
|
|
|
this.communities,
|
|
|
|
this.users,
|
|
|
|
});
|
|
|
|
|
2020-08-10 19:25:13 +02:00
|
|
|
factory Search.fromJson(Map<String, dynamic> json) => _$SearchFromJson(json);
|
2020-08-10 16:47:05 +02:00
|
|
|
}
|