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