2018-02-28 00:59:43 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of angel_serialize.test.models.author;
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// Generator: SerializerGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2018-02-28 01:10:57 +00:00
|
|
|
abstract class AuthorSerializer {
|
2018-02-28 01:41:19 +00:00
|
|
|
static Map<String, dynamic> toMap(Author model) {
|
2018-02-28 01:10:57 +00:00
|
|
|
return {
|
2018-02-28 01:41:19 +00:00
|
|
|
'id': model.id,
|
|
|
|
'name': model.name,
|
|
|
|
'age': model.age,
|
|
|
|
'books': model.books.map(BookSerializer.toMap).toList(),
|
|
|
|
'newest_book': BookSerializer.toMap(model.newestBook),
|
|
|
|
'created_at': model.createdAt.toIso8601String(),
|
|
|
|
'updated_at': model.updatedAt.toIso8601String()
|
2018-02-28 01:10:57 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2018-02-28 00:59:43 +00:00
|
|
|
|
2018-02-28 01:10:57 +00:00
|
|
|
abstract class LibrarySerializer {
|
2018-02-28 01:41:19 +00:00
|
|
|
static Map<String, dynamic> toMap(Library model) {
|
2018-02-28 01:10:57 +00:00
|
|
|
return {
|
2018-02-28 01:41:19 +00:00
|
|
|
'id': model.id,
|
2018-02-28 01:43:43 +00:00
|
|
|
'collection': model.collection.keys.fold({}, (map, key) {
|
|
|
|
return map..[key] = BookSerializer.toMap(model.collection[key]);
|
|
|
|
}),
|
2018-02-28 01:41:19 +00:00
|
|
|
'created_at': model.createdAt.toIso8601String(),
|
|
|
|
'updated_at': model.updatedAt.toIso8601String()
|
2018-02-28 01:10:57 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|