tablet-app/manager_api_old/lib/model/question_dto.dart

108 lines
3.1 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 QuestionDTO {
/// Returns a new [QuestionDTO] instance.
QuestionDTO({
this.label,
this.responses,
this.resourceId,
this.source_,
this.order,
});
List<TranslationDTO> label;
List<ResponseDTO> responses;
String resourceId;
String source_;
int order;
@override
bool operator ==(Object other) => identical(this, other) || other is QuestionDTO &&
other.label == label &&
other.responses == responses &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.order == order;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(responses == null ? 0 : responses.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (responses != null) {
json[r'responses'] = responses;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
if (order != null) {
json[r'order'] = order;
}
return json;
}
/// Returns a new [QuestionDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static QuestionDTO fromJson(Map<String, dynamic> json) => json == null
? null
: QuestionDTO(
label: TranslationDTO.listFromJson(json[r'label']),
responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
order: json[r'order'],
);
static List<QuestionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <QuestionDTO>[]
: json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, QuestionDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, QuestionDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of QuestionDTO-objects as value to a dart map
static Map<String, List<QuestionDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<QuestionDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}