2021-03-30 19:13:44 +02:00

307 lines
9.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 Device {
/// Returns a new [Device] instance.
Device({
this.id,
this.userId,
this.name,
this.description,
this.model,
this.port,
this.firmwareVersion,
this.hardwareVersion,
this.status,
this.type,
this.connectionStatus,
this.locationId,
this.meansOfCommunications,
this.createdDate,
this.updatedDate,
this.lastState,
this.lastStateDate,
this.ipAddress,
this.serviceIdentification,
this.battery,
this.batteryStatus,
this.providerId,
this.manufacturerName,
this.groupIds,
this.properties,
this.supportedOperations,
});
String id;
String userId;
String name;
String description;
String model;
int port;
String firmwareVersion;
String hardwareVersion;
bool status;
DeviceType type;
ConnectionStatus connectionStatus;
String locationId;
List<MeansOfCommunication> meansOfCommunications;
DateTime createdDate;
DateTime updatedDate;
String lastState;
DateTime lastStateDate;
String ipAddress;
String serviceIdentification;
bool battery;
int batteryStatus;
String providerId;
String manufacturerName;
List<String> groupIds;
String properties;
List<String> supportedOperations;
@override
bool operator ==(Object other) => identical(this, other) || other is Device &&
other.id == id &&
other.userId == userId &&
other.name == name &&
other.description == description &&
other.model == model &&
other.port == port &&
other.firmwareVersion == firmwareVersion &&
other.hardwareVersion == hardwareVersion &&
other.status == status &&
other.type == type &&
other.connectionStatus == connectionStatus &&
other.locationId == locationId &&
other.meansOfCommunications == meansOfCommunications &&
other.createdDate == createdDate &&
other.updatedDate == updatedDate &&
other.lastState == lastState &&
other.lastStateDate == lastStateDate &&
other.ipAddress == ipAddress &&
other.serviceIdentification == serviceIdentification &&
other.battery == battery &&
other.batteryStatus == batteryStatus &&
other.providerId == providerId &&
other.manufacturerName == manufacturerName &&
other.groupIds == groupIds &&
other.properties == properties &&
other.supportedOperations == supportedOperations;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(userId == null ? 0 : userId.hashCode) +
(name == null ? 0 : name.hashCode) +
(description == null ? 0 : description.hashCode) +
(model == null ? 0 : model.hashCode) +
(port == null ? 0 : port.hashCode) +
(firmwareVersion == null ? 0 : firmwareVersion.hashCode) +
(hardwareVersion == null ? 0 : hardwareVersion.hashCode) +
(status == null ? 0 : status.hashCode) +
(type == null ? 0 : type.hashCode) +
(connectionStatus == null ? 0 : connectionStatus.hashCode) +
(locationId == null ? 0 : locationId.hashCode) +
(meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) +
(createdDate == null ? 0 : createdDate.hashCode) +
(updatedDate == null ? 0 : updatedDate.hashCode) +
(lastState == null ? 0 : lastState.hashCode) +
(lastStateDate == null ? 0 : lastStateDate.hashCode) +
(ipAddress == null ? 0 : ipAddress.hashCode) +
(serviceIdentification == null ? 0 : serviceIdentification.hashCode) +
(battery == null ? 0 : battery.hashCode) +
(batteryStatus == null ? 0 : batteryStatus.hashCode) +
(providerId == null ? 0 : providerId.hashCode) +
(manufacturerName == null ? 0 : manufacturerName.hashCode) +
(groupIds == null ? 0 : groupIds.hashCode) +
(properties == null ? 0 : properties.hashCode) +
(supportedOperations == null ? 0 : supportedOperations.hashCode);
@override
String toString() => 'Device[id=$id, userId=$userId, name=$name, description=$description, model=$model, port=$port, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, status=$status, type=$type, connectionStatus=$connectionStatus, locationId=$locationId, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, lastStateDate=$lastStateDate, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, battery=$battery, batteryStatus=$batteryStatus, providerId=$providerId, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (userId != null) {
json[r'userId'] = userId;
}
if (name != null) {
json[r'name'] = name;
}
if (description != null) {
json[r'description'] = description;
}
if (model != null) {
json[r'model'] = model;
}
if (port != null) {
json[r'port'] = port;
}
if (firmwareVersion != null) {
json[r'firmwareVersion'] = firmwareVersion;
}
if (hardwareVersion != null) {
json[r'hardwareVersion'] = hardwareVersion;
}
if (status != null) {
json[r'status'] = status;
}
if (type != null) {
json[r'type'] = type;
}
if (connectionStatus != null) {
json[r'connectionStatus'] = connectionStatus;
}
if (locationId != null) {
json[r'locationId'] = locationId;
}
if (meansOfCommunications != null) {
json[r'meansOfCommunications'] = meansOfCommunications;
}
if (createdDate != null) {
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
}
if (updatedDate != null) {
json[r'updatedDate'] = updatedDate.toUtc().toIso8601String();
}
if (lastState != null) {
json[r'lastState'] = lastState;
}
if (lastStateDate != null) {
json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String();
}
if (ipAddress != null) {
json[r'ipAddress'] = ipAddress;
}
if (serviceIdentification != null) {
json[r'serviceIdentification'] = serviceIdentification;
}
if (battery != null) {
json[r'battery'] = battery;
}
if (batteryStatus != null) {
json[r'batteryStatus'] = batteryStatus;
}
if (providerId != null) {
json[r'providerId'] = providerId;
}
if (manufacturerName != null) {
json[r'manufacturerName'] = manufacturerName;
}
if (groupIds != null) {
json[r'groupIds'] = groupIds;
}
if (properties != null) {
json[r'properties'] = properties;
}
if (supportedOperations != null) {
json[r'supportedOperations'] = supportedOperations;
}
return json;
}
/// Returns a new [Device] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static Device fromJson(Map<String, dynamic> json) => json == null
? null
: Device(
id: json[r'id'],
userId: json[r'userId'],
name: json[r'name'],
description: json[r'description'],
model: json[r'model'],
port: json[r'port'],
firmwareVersion: json[r'firmwareVersion'],
hardwareVersion: json[r'hardwareVersion'],
status: json[r'status'],
type: DeviceType.fromJson(json[r'type']),
connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']),
locationId: json[r'locationId'],
meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']),
createdDate: json[r'createdDate'] == null
? null
: DateTime.parse(json[r'createdDate']),
updatedDate: json[r'updatedDate'] == null
? null
: DateTime.parse(json[r'updatedDate']),
lastState: json[r'lastState'],
lastStateDate: json[r'lastStateDate'] == null
? null
: DateTime.parse(json[r'lastStateDate']),
ipAddress: json[r'ipAddress'],
serviceIdentification: json[r'serviceIdentification'],
battery: json[r'battery'],
batteryStatus: json[r'batteryStatus'],
providerId: json[r'providerId'],
manufacturerName: json[r'manufacturerName'],
groupIds: json[r'groupIds'] == null
? null
: (json[r'groupIds'] as List).cast<String>(),
properties: json[r'properties'],
supportedOperations: json[r'supportedOperations'] == null
? null
: (json[r'supportedOperations'] as List).cast<String>(),
);
static List<Device> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Device>[]
: json.map((v) => Device.fromJson(v)).toList(growable: true == growable);
static Map<String, Device> mapFromJson(Map<String, dynamic> json) {
final map = <String, Device>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Device.fromJson(v));
}
return map;
}
// maps a json object with a list of Device-objects as value to a dart map
static Map<String, List<Device>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Device>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Device.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}