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