2017-12-07 07:08:32 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of angel_serialize.test.models.author;
|
|
|
|
|
|
|
|
// **************************************************************************
|
2018-06-29 04:11:57 +00:00
|
|
|
// JsonModelGenerator
|
2017-12-07 07:08:32 +00:00
|
|
|
// **************************************************************************
|
|
|
|
|
2018-02-27 19:57:05 +00:00
|
|
|
class Author extends _Author {
|
|
|
|
Author(
|
|
|
|
{this.id,
|
2018-05-15 19:16:46 +00:00
|
|
|
@required this.name,
|
|
|
|
@required this.age,
|
2018-05-15 19:01:13 +00:00
|
|
|
List<Book> books,
|
2018-02-27 19:57:05 +00:00
|
|
|
this.newestBook,
|
2018-02-28 00:36:53 +00:00
|
|
|
this.secret,
|
2018-03-02 18:38:41 +00:00
|
|
|
this.obscured,
|
2018-02-27 19:57:05 +00:00
|
|
|
this.createdAt,
|
2018-05-15 19:01:13 +00:00
|
|
|
this.updatedAt})
|
|
|
|
: this.books = new List.unmodifiable(books ?? []);
|
2018-02-27 19:57:05 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final String id;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final String name;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final int age;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:50:46 +00:00
|
|
|
final List<Book> books;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final Book newestBook;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
|
|
|
final String secret;
|
|
|
|
|
2018-03-02 18:38:41 +00:00
|
|
|
@override
|
|
|
|
final String obscured;
|
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final DateTime createdAt;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final DateTime updatedAt;
|
2018-02-28 00:36:53 +00:00
|
|
|
|
|
|
|
Author copyWith(
|
|
|
|
{String id,
|
|
|
|
String name,
|
|
|
|
int age,
|
|
|
|
List<Book> books,
|
|
|
|
Book newestBook,
|
|
|
|
String secret,
|
2018-03-02 18:38:41 +00:00
|
|
|
String obscured,
|
2018-02-28 00:36:53 +00:00
|
|
|
DateTime createdAt,
|
|
|
|
DateTime updatedAt}) {
|
|
|
|
return new Author(
|
|
|
|
id: id ?? this.id,
|
|
|
|
name: name ?? this.name,
|
|
|
|
age: age ?? this.age,
|
|
|
|
books: books ?? this.books,
|
|
|
|
newestBook: newestBook ?? this.newestBook,
|
|
|
|
secret: secret ?? this.secret,
|
2018-03-02 18:38:41 +00:00
|
|
|
obscured: obscured ?? this.obscured,
|
2018-02-28 00:36:53 +00:00
|
|
|
createdAt: createdAt ?? this.createdAt,
|
|
|
|
updatedAt: updatedAt ?? this.updatedAt);
|
|
|
|
}
|
2018-02-28 01:49:14 +00:00
|
|
|
|
2018-05-13 18:02:47 +00:00
|
|
|
bool operator ==(other) {
|
|
|
|
return other is _Author &&
|
|
|
|
other.id == id &&
|
|
|
|
other.name == name &&
|
|
|
|
other.age == age &&
|
|
|
|
const ListEquality<Book>(const DefaultEquality<Book>())
|
|
|
|
.equals(other.books, books) &&
|
|
|
|
other.newestBook == newestBook &&
|
|
|
|
other.secret == secret &&
|
|
|
|
other.obscured == obscured &&
|
|
|
|
other.createdAt == createdAt &&
|
|
|
|
other.updatedAt == updatedAt;
|
|
|
|
}
|
|
|
|
|
2018-02-28 01:49:14 +00:00
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
return AuthorSerializer.toMap(this);
|
|
|
|
}
|
2017-12-07 07:08:32 +00:00
|
|
|
}
|
|
|
|
|
2018-02-27 19:57:05 +00:00
|
|
|
class Library extends _Library {
|
2018-05-15 19:01:13 +00:00
|
|
|
Library(
|
|
|
|
{this.id, Map<String, Book> collection, this.createdAt, this.updatedAt})
|
|
|
|
: this.collection = new Map.unmodifiable(collection ?? {});
|
2018-02-27 19:57:05 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final String id;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:50:46 +00:00
|
|
|
final Map<String, Book> collection;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final DateTime createdAt;
|
2017-12-07 07:08:32 +00:00
|
|
|
|
2018-02-28 00:36:53 +00:00
|
|
|
@override
|
2018-02-27 19:47:42 +00:00
|
|
|
final DateTime updatedAt;
|
2018-02-28 00:36:53 +00:00
|
|
|
|
|
|
|
Library copyWith(
|
|
|
|
{String id,
|
|
|
|
Map<String, Book> collection,
|
|
|
|
DateTime createdAt,
|
|
|
|
DateTime updatedAt}) {
|
|
|
|
return new Library(
|
|
|
|
id: id ?? this.id,
|
|
|
|
collection: collection ?? this.collection,
|
|
|
|
createdAt: createdAt ?? this.createdAt,
|
|
|
|
updatedAt: updatedAt ?? this.updatedAt);
|
|
|
|
}
|
2018-02-28 01:49:14 +00:00
|
|
|
|
2018-05-13 18:02:47 +00:00
|
|
|
bool operator ==(other) {
|
|
|
|
return other is _Library &&
|
|
|
|
other.id == id &&
|
|
|
|
const MapEquality<String, Book>(
|
|
|
|
keys: const DefaultEquality<String>(),
|
|
|
|
values: const DefaultEquality<Book>())
|
|
|
|
.equals(other.collection, collection) &&
|
|
|
|
other.createdAt == createdAt &&
|
|
|
|
other.updatedAt == updatedAt;
|
|
|
|
}
|
|
|
|
|
2018-02-28 01:49:14 +00:00
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
return LibrarySerializer.toMap(this);
|
|
|
|
}
|
2017-12-07 07:08:32 +00:00
|
|
|
}
|
2018-05-13 17:23:40 +00:00
|
|
|
|
|
|
|
class Bookmark extends _Bookmark {
|
|
|
|
Bookmark(Book book,
|
2018-05-13 18:02:47 +00:00
|
|
|
{this.id,
|
2018-05-15 19:01:13 +00:00
|
|
|
List<int> history,
|
2018-05-15 19:33:57 +00:00
|
|
|
@required this.page,
|
2018-05-13 18:02:47 +00:00
|
|
|
this.comment,
|
|
|
|
this.createdAt,
|
|
|
|
this.updatedAt})
|
2018-05-15 19:01:13 +00:00
|
|
|
: this.history = new List.unmodifiable(history ?? []),
|
|
|
|
super(book);
|
2018-05-13 17:23:40 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
final String id;
|
|
|
|
|
2018-05-13 18:02:47 +00:00
|
|
|
@override
|
|
|
|
final List<int> history;
|
|
|
|
|
2018-05-13 17:23:40 +00:00
|
|
|
@override
|
|
|
|
final int page;
|
|
|
|
|
|
|
|
@override
|
|
|
|
final String comment;
|
|
|
|
|
|
|
|
@override
|
|
|
|
final DateTime createdAt;
|
|
|
|
|
|
|
|
@override
|
|
|
|
final DateTime updatedAt;
|
|
|
|
|
|
|
|
Bookmark copyWith(Book book,
|
|
|
|
{String id,
|
2018-05-13 18:02:47 +00:00
|
|
|
List<int> history,
|
2018-05-13 17:23:40 +00:00
|
|
|
int page,
|
|
|
|
String comment,
|
|
|
|
DateTime createdAt,
|
|
|
|
DateTime updatedAt}) {
|
|
|
|
return new Bookmark(book,
|
|
|
|
id: id ?? this.id,
|
2018-05-13 18:02:47 +00:00
|
|
|
history: history ?? this.history,
|
2018-05-13 17:23:40 +00:00
|
|
|
page: page ?? this.page,
|
|
|
|
comment: comment ?? this.comment,
|
|
|
|
createdAt: createdAt ?? this.createdAt,
|
|
|
|
updatedAt: updatedAt ?? this.updatedAt);
|
|
|
|
}
|
|
|
|
|
2018-05-13 18:02:47 +00:00
|
|
|
bool operator ==(other) {
|
|
|
|
return other is _Bookmark &&
|
|
|
|
other.id == id &&
|
|
|
|
const ListEquality<int>(const DefaultEquality<int>())
|
|
|
|
.equals(other.history, history) &&
|
|
|
|
other.page == page &&
|
|
|
|
other.comment == comment &&
|
|
|
|
other.createdAt == createdAt &&
|
|
|
|
other.updatedAt == updatedAt;
|
|
|
|
}
|
|
|
|
|
2018-05-13 17:23:40 +00:00
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
return BookmarkSerializer.toMap(this);
|
|
|
|
}
|
|
|
|
}
|