mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
108 lines
3.2 KiB
Dart
108 lines
3.2 KiB
Dart
//
|
|
// 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 QuizzDTO {
|
|
/// Returns a new [QuizzDTO] instance.
|
|
QuizzDTO({
|
|
this.questions,
|
|
this.badLevel,
|
|
this.mediumLevel,
|
|
this.goodLevel,
|
|
this.greatLevel,
|
|
});
|
|
|
|
List<QuestionDTO> questions;
|
|
|
|
LevelDTO badLevel;
|
|
|
|
LevelDTO mediumLevel;
|
|
|
|
LevelDTO goodLevel;
|
|
|
|
LevelDTO greatLevel;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is QuizzDTO &&
|
|
other.questions == questions &&
|
|
other.badLevel == badLevel &&
|
|
other.mediumLevel == mediumLevel &&
|
|
other.goodLevel == goodLevel &&
|
|
other.greatLevel == greatLevel;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(questions == null ? 0 : questions.hashCode) +
|
|
(badLevel == null ? 0 : badLevel.hashCode) +
|
|
(mediumLevel == null ? 0 : mediumLevel.hashCode) +
|
|
(goodLevel == null ? 0 : goodLevel.hashCode) +
|
|
(greatLevel == null ? 0 : greatLevel.hashCode);
|
|
|
|
@override
|
|
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (questions != null) {
|
|
json[r'questions'] = questions;
|
|
}
|
|
if (badLevel != null) {
|
|
json[r'bad_level'] = badLevel;
|
|
}
|
|
if (mediumLevel != null) {
|
|
json[r'medium_level'] = mediumLevel;
|
|
}
|
|
if (goodLevel != null) {
|
|
json[r'good_level'] = goodLevel;
|
|
}
|
|
if (greatLevel != null) {
|
|
json[r'great_level'] = greatLevel;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [QuizzDTO] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static QuizzDTO fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: QuizzDTO(
|
|
questions: QuestionDTO.listFromJson(json[r'questions']),
|
|
badLevel: LevelDTO.fromJson(json[r'bad_level']),
|
|
mediumLevel: LevelDTO.fromJson(json[r'medium_level']),
|
|
goodLevel: LevelDTO.fromJson(json[r'good_level']),
|
|
greatLevel: LevelDTO.fromJson(json[r'great_level']),
|
|
);
|
|
|
|
static List<QuizzDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <QuizzDTO>[]
|
|
: json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, QuizzDTO> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, QuizzDTO>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of QuizzDTO-objects as value to a dart map
|
|
static Map<String, List<QuizzDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<QuizzDTO>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|