UrlRule constructor

  1. @JsonSerializable(includeIfNull: false)
const UrlRule({
  1. @Default('tools.ozone.safelink.defs#urlRule') String $type,
  2. required String url,
  3. @PatternTypeConverter() required PatternType pattern,
  4. @ActionTypeConverter() required ActionType action,
  5. @ReasonTypeConverter() required ReasonType reason,
  6. String? comment,
  7. required String createdBy,
  8. required DateTime createdAt,
  9. required DateTime updatedAt,
  10. Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory UrlRule({
  @Default('tools.ozone.safelink.defs#urlRule') String $type,

  /// The URL or domain to apply the rule to
  required String url,
  @PatternTypeConverter() required PatternType pattern,
  @ActionTypeConverter() required ActionType action,
  @ReasonTypeConverter() required ReasonType reason,

  /// Optional comment about the decision
  String? comment,

  /// DID of the user added the rule.
  required String createdBy,

  /// Timestamp when the rule was created
  required DateTime createdAt,

  /// Timestamp when the rule was last updated
  required DateTime updatedAt,

  Map<String, dynamic>? $unknown,
}) = _UrlRule;