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