BrickhouseAlert constructor

const BrickhouseAlert({
  1. required String id,
  2. required String name,
  3. required BrickhouseAlertType type,
  4. List<Asset>? assets,
  5. List<String>? assetsIds,
  6. List<String>? email,
  7. List<NullablePhoneNumber?>? phone,
  8. bool? hasMobilePopup,
  9. bool? hasWebPopup,
  10. bool? hasEmail,
  11. bool? hasPhone,
  12. int? batteryMinLevel,
  13. @BrickhouseTimeOfDayMinuteOrNullConverter() TimeOfDay? curfewStartHour,
  14. @BrickhouseTimeOfDayMinuteOrNullConverter() TimeOfDay? curfewEndHour,
  15. String? timezone,
  16. @JsonKey.new(unknownEnumValue: Weekday.monday) List<Weekday>? curfewWeekdays,
  17. @ColorOrNullConverter() Color? geofenceColor,
  18. @JsonKey.new(unknownEnumValue: GeofenceMode.radial) GeofenceMode? geofenceMode,
  19. double? geofenceRadius,
  20. List<GeofencePoint>? geofenceShape,
  21. @JsonKey.new(unknownEnumValue: BrickhouseGeofenceTrigger.unknown) BrickhouseGeofenceTrigger? geofenceTrigger,
  22. double? maxSpeedMaxValue,
  23. @Default.new(false) bool? isMuted,
  24. double? speedingThreshold,
  25. @Default.new(false) bool? isDisabled,
  26. String? triggerId,
})

Implementation

const factory BrickhouseAlert({
  /// ID of the alert entity. This ID is unique.
  required String id,

  /// Name of the alert.
  required String name,

  /// Type of the alert.
  required BrickhouseAlertType type,

  /// List of assets
  List<Asset>? assets,

  /// List of assets IDs.
  List<String>? assetsIds,

  /// Email to send the alert to.
  List<String>? email,

  /// Phone number to send the alert to.
  List<NullablePhoneNumber?>? phone,

  /// If the alert should be shown in the mobile app.
  bool? hasMobilePopup,

  /// If the alert should be shown in the web app.
  bool? hasWebPopup,

  /// Email to send the alert to.
  bool? hasEmail,

  /// Phone number to send the alert to.
  bool? hasPhone,

  /// Minimum battery level to trigger the alert, in percentage (%). Only for BrickhouseAlertType.BATTERY
  int? batteryMinLevel,

  /// Start hour of the curfew, in minutes from midnight in the local timezone. Only for BrickhouseAlertType.CURFEW
  @BrickhouseTimeOfDayMinuteOrNullConverter() TimeOfDay? curfewStartHour,

  /// End hour of the curfew, in minutes from midnight in the local timezone. Only for BrickhouseAlertType.CURFEW
  @BrickhouseTimeOfDayMinuteOrNullConverter() TimeOfDay? curfewEndHour,

  /// Timezone of the curfew. Only for BrickhouseAlertType.CURFEW
  String? timezone,

  /// Weekdays to apply the curfew. Only for BrickhouseAlertType.CURFEW
  @JsonKey(unknownEnumValue: Weekday.monday) List<Weekday>? curfewWeekdays,

  /// Geofence color, in hex mode. Only for BrickhouseAlertType.PRESENCE_GEOFENCE
  @ColorOrNullConverter() Color? geofenceColor,

  /// Geofence mode. Only for BrickhouseAlertType.PRESENCE_GEOFENCE
  @JsonKey(unknownEnumValue: GeofenceMode.radial) GeofenceMode? geofenceMode,

  /// Geofence radius in meters. Only for BrickhouseAlertType.PRESENCE_GEOFENCE
  double? geofenceRadius,

  /// geofenceShape [GeofencePoint]
  List<GeofencePoint>? geofenceShape,

  /// Geofence trigger. Only for BrickhouseAlertType.PRESENCE_GEOFENCE
  ///
  @JsonKey(unknownEnumValue: BrickhouseGeofenceTrigger.unknown) BrickhouseGeofenceTrigger? geofenceTrigger,

  /// Maximum speed to trigger the alert, in kilometers per hour (km/h). Only for BrickhouseAlertType
  double? maxSpeedMaxValue,

  /// [isMuted] represents if the alert is muted or not.
  @Default(false) bool? isMuted,

  /// [speedingThreshold] represents the threshold of the speeding alert.
  /// This is the maximum speed that the asset can reach before the alert is triggered.
  double? speedingThreshold,

  /// isDisabled
  @Default(false) bool? isDisabled,

  /// triggerId
  /// triggerId of the alert
  String? triggerId,
}) = _BrickhouseAlert;