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