copyWith method

DeviceDTO copyWith({
  1. int? id,
  2. String? serialNumber,
  3. String? displayName,
  4. DeviceHostDTO? deviceHost,
  5. bool? hasAcceptedPrivacyPolicy,
  6. AddressDTO? address,
  7. ProductDTO? product,
  8. String? productDisplayName,
  9. String? controllerType,
  10. String? firmwareVersion,
  11. String? currentFirmware,
  12. bool? isConnected,
  13. DateTime? lastConnectedTimestamp,
  14. ConnectionTypeDTO? connectionType,
  15. String? deviceIpAddress,
  16. String? macAddress,
  17. AlertDTO? shutdownReason,
  18. DeviceStatusDTO? status,
  19. DateTime? statusUpdateTimestamp,
  20. DateTime? latestParameterUpdateTimestamp,
  21. List<DealerOrgDTO>? dealerOrgs,
  22. int? alertCount,
  23. GensetModelDTO? model,
  24. String? modelDisplayName,
  25. DateTime? lastMaintenanceTimestamp,
  26. DateTime? nextMaintenanceTimestamp,
  27. int? maintenancePeriodDays,
  28. bool? hasServiceAgreement,
  29. double? totalRuntimeHours,
  30. ServiceAgreementStatusDTO? serviceAgreementStatus,
  31. DateTime? cellularExpiryDate,
  32. double? cellularDataPercentage,
  33. CellularDataStatusDTO? cellularDataStatus,
  34. CellKitPaymentStatusDTO? cellKitPaymentStatus,
  35. 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);
}