// // 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 toJson() { final json = {}; 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 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 listFromJson(List json, {bool emptyIsNull, bool growable,}) => json == null || json.isEmpty ? true == emptyIsNull ? null : [] : json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); static Map mapFromJson(Map json) { final map = {}; 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> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { final map = >{}; if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic v) { map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); }); } return map; } }