class RatingModel {
  static const String modeInApp = 'in_app';
  static const String modeUrl = 'url';

  final int gapDays;

  final int lastPopGapDays;

  /// Android评分模式
  /// in_app
  /// url
  final String mode;

  final String validation;

  /// 保留字段，设置中入口是否可用
  final bool entryEnable;

  const RatingModel(
    this.gapDays,
    this.lastPopGapDays,
    this.mode,
    this.validation, {
    this.entryEnable = false,
  });

  factory RatingModel.fromJson(Map<String, dynamic> json) => RatingModel(
        json['gap_days'] as int? ?? 1,
        json['last_pop_gap_days'] as int? ?? 7,
        json['mode'] as String? ?? modeInApp,
        json['validation'] as String? ?? '',
        entryEnable: json['entry_enable'] as bool? ?? false,
      );
}
