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

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