// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.0 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class Book { /// Returns a new [Book] instance. Book({ this.id, this.bookName, this.price, this.category, this.author, }); String id; String bookName; num price; String category; String author; @override bool operator ==(Object other) => identical(this, other) || other is Book && other.id == id && other.bookName == bookName && other.price == price && other.category == category && other.author == author; @override int get hashCode => (id == null ? 0 : id.hashCode) + (bookName == null ? 0 : bookName.hashCode) + (price == null ? 0 : price.hashCode) + (category == null ? 0 : category.hashCode) + (author == null ? 0 : author.hashCode); @override String toString() => 'Book[id=$id, bookName=$bookName, price=$price, category=$category, author=$author]'; Map toJson() { final json = {}; if (id != null) { json[r'id'] = id; } if (bookName != null) { json[r'bookName'] = bookName; } if (price != null) { json[r'price'] = price; } if (category != null) { json[r'category'] = category; } if (author != null) { json[r'author'] = author; } return json; } /// Returns a new [Book] instance and imports its values from /// [json] if it's non-null, null if [json] is null. static Book fromJson(Map json) => json == null ? null : Book( id: json[r'id'], bookName: json[r'bookName'], price: json[r'price'] == null ? null : json[r'price'].toDouble(), category: json[r'category'], author: json[r'author'], ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => json == null || json.isEmpty ? true == emptyIsNull ? null : [] : json.map((v) => Book.fromJson(v)).toList(growable: true == growable); static Map mapFromJson(Map json) { final map = {}; if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic v) => map[key] = Book.fromJson(v)); } return map; } // maps a json object with a list of Book-objects as value to a dart map static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { final map = >{}; if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic v) { map[key] = Book.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); }); } return map; } }