copyWith method
DeviceDTO
copyWith({ - int? id,
- String? serialNumber,
- String? displayName,
- DeviceHostDTO? deviceHost,
- bool? hasAcceptedPrivacyPolicy,
- AddressDTO? address,
- ProductDTO? product,
- String? productDisplayName,
- String? controllerType,
- String? firmwareVersion,
- String? currentFirmware,
- bool? isConnected,
- DateTime? lastConnectedTimestamp,
- ConnectionTypeDTO? connectionType,
- String? deviceIpAddress,
- String? macAddress,
- AlertDTO? shutdownReason,
- DeviceStatusDTO? status,
- DateTime? statusUpdateTimestamp,
- DateTime? latestParameterUpdateTimestamp,
- List<DealerOrgDTO>? dealerOrgs,
- int? alertCount,
- GensetModelDTO? model,
- String? modelDisplayName,
- DateTime? lastMaintenanceTimestamp,
- DateTime? nextMaintenanceTimestamp,
- int? maintenancePeriodDays,
- bool? hasServiceAgreement,
- double? totalRuntimeHours,
- ServiceAgreementStatusDTO? serviceAgreementStatus,
- DateTime? cellularExpiryDate,
- double? cellularDataPercentage,
- CellularDataStatusDTO? cellularDataStatus,
- CellKitPaymentStatusDTO? cellKitPaymentStatus,
- double? uptimePercent,
})
Implementation
DeviceDTO copyWith(
{int? id,
String? serialNumber,
String? displayName,
enums.DeviceHostDTO? deviceHost,
bool? hasAcceptedPrivacyPolicy,
AddressDTO? address,
enums.ProductDTO? product,
String? productDisplayName,
String? controllerType,
String? firmwareVersion,
String? currentFirmware,
bool? isConnected,
DateTime? lastConnectedTimestamp,
enums.ConnectionTypeDTO? connectionType,
String? deviceIpAddress,
String? macAddress,
AlertDTO? shutdownReason,
enums.DeviceStatusDTO? status,
DateTime? statusUpdateTimestamp,
DateTime? latestParameterUpdateTimestamp,
List<DealerOrgDTO>? dealerOrgs,
int? alertCount,
enums.GensetModelDTO? model,
String? modelDisplayName,
DateTime? lastMaintenanceTimestamp,
DateTime? nextMaintenanceTimestamp,
int? maintenancePeriodDays,
bool? hasServiceAgreement,
double? totalRuntimeHours,
enums.ServiceAgreementStatusDTO? serviceAgreementStatus,
DateTime? cellularExpiryDate,
double? cellularDataPercentage,
enums.CellularDataStatusDTO? cellularDataStatus,
enums.CellKitPaymentStatusDTO? cellKitPaymentStatus,
double? uptimePercent}) {
return DeviceDTO(
id: id ?? this.id,
serialNumber: serialNumber ?? this.serialNumber,
displayName: displayName ?? this.displayName,
deviceHost: deviceHost ?? this.deviceHost,
hasAcceptedPrivacyPolicy:
hasAcceptedPrivacyPolicy ?? this.hasAcceptedPrivacyPolicy,
address: address ?? this.address,
product: product ?? this.product,
productDisplayName: productDisplayName ?? this.productDisplayName,
controllerType: controllerType ?? this.controllerType,
firmwareVersion: firmwareVersion ?? this.firmwareVersion,
currentFirmware: currentFirmware ?? this.currentFirmware,
isConnected: isConnected ?? this.isConnected,
lastConnectedTimestamp:
lastConnectedTimestamp ?? this.lastConnectedTimestamp,
connectionType: connectionType ?? this.connectionType,
deviceIpAddress: deviceIpAddress ?? this.deviceIpAddress,
macAddress: macAddress ?? this.macAddress,
shutdownReason: shutdownReason ?? this.shutdownReason,
status: status ?? this.status,
statusUpdateTimestamp:
statusUpdateTimestamp ?? this.statusUpdateTimestamp,
latestParameterUpdateTimestamp: latestParameterUpdateTimestamp ??
this.latestParameterUpdateTimestamp,
dealerOrgs: dealerOrgs ?? this.dealerOrgs,
alertCount: alertCount ?? this.alertCount,
model: model ?? this.model,
modelDisplayName: modelDisplayName ?? this.modelDisplayName,
lastMaintenanceTimestamp:
lastMaintenanceTimestamp ?? this.lastMaintenanceTimestamp,
nextMaintenanceTimestamp:
nextMaintenanceTimestamp ?? this.nextMaintenanceTimestamp,
maintenancePeriodDays:
maintenancePeriodDays ?? this.maintenancePeriodDays,
hasServiceAgreement: hasServiceAgreement ?? this.hasServiceAgreement,
totalRuntimeHours: totalRuntimeHours ?? this.totalRuntimeHours,
serviceAgreementStatus:
serviceAgreementStatus ?? this.serviceAgreementStatus,
cellularExpiryDate: cellularExpiryDate ?? this.cellularExpiryDate,
cellularDataPercentage:
cellularDataPercentage ?? this.cellularDataPercentage,
cellularDataStatus: cellularDataStatus ?? this.cellularDataStatus,
cellKitPaymentStatus: cellKitPaymentStatus ?? this.cellKitPaymentStatus,
uptimePercent: uptimePercent ?? this.uptimePercent);
}