tablet-app/manager_api/lib/model/response_dto.dart

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