// // 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 DeviceDetailDTO { /// Returns a new [DeviceDetailDTO] instance. DeviceDetailDTO({ this.id, this.name, this.ipAddress, this.configurationId, this.connected, this.dateCreation, this.connectionLevel, this.lastConnectionLevel, this.batteryLevel, this.lastBatteryLevel, }); String id; String name; String ipAddress; String configurationId; bool connected; DateTime dateCreation; String connectionLevel; DateTime lastConnectionLevel; String batteryLevel; DateTime lastBatteryLevel; @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && other.id == id && other.name == name && other.ipAddress == ipAddress && other.configurationId == configurationId && other.connected == connected && other.dateCreation == dateCreation && other.connectionLevel == connectionLevel && other.lastConnectionLevel == lastConnectionLevel && other.batteryLevel == batteryLevel && other.lastBatteryLevel == lastBatteryLevel; @override int get hashCode => (id == null ? 0 : id.hashCode) + (name == null ? 0 : name.hashCode) + (ipAddress == null ? 0 : ipAddress.hashCode) + (configurationId == null ? 0 : configurationId.hashCode) + (connected == null ? 0 : connected.hashCode) + (dateCreation == null ? 0 : dateCreation.hashCode) + (connectionLevel == null ? 0 : connectionLevel.hashCode) + (lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + (batteryLevel == null ? 0 : batteryLevel.hashCode) + (lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); @override String toString() => 'DeviceDetailDTO[id=$id, name=$name, ipAddress=$ipAddress, configurationId=$configurationId, connected=$connected, dateCreation=$dateCreation, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; Map toJson() { final json = {}; if (id != null) { json[r'id'] = id; } if (name != null) { json[r'name'] = name; } if (ipAddress != null) { json[r'ipAddress'] = ipAddress; } if (configurationId != null) { json[r'configurationId'] = configurationId; } if (connected != null) { json[r'connected'] = connected; } if (dateCreation != null) { json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); } 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 [DeviceDetailDTO] instance and imports its values from /// [json] if it's non-null, null if [json] is null. static DeviceDetailDTO fromJson(Map json) => json == null ? null : DeviceDetailDTO( id: json[r'id'], name: json[r'name'], ipAddress: json[r'ipAddress'], configurationId: json[r'configurationId'], connected: json[r'connected'], dateCreation: json[r'dateCreation'] == null ? null : DateTime.parse(json[r'dateCreation']), 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) => DeviceDetailDTO.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] = DeviceDetailDTO.fromJson(v)); } return map; } // maps a json object with a list of DeviceDetailDTO-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] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); }); } return map; } }