import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter/foundation.dart';
part 'ad_config.freezed.dart';
part 'ad_config.g.dart';

@freezed
abstract class AdConfig with _$AdConfig {
  const factory AdConfig({
    String? appId,
    String? appKey,
    List<Data>? data,
  }) = _AdConfig;

  factory AdConfig.fromJson(Map<String, Object?> json) =>
      _$AdConfigFromJson(json);
}

@freezed
abstract class Data with _$Data {
  const factory Data({
    String? type,
    String? pagePos,
    String? adId,
    int? interval,
    int? timeout,
    bool? unbounded,
    bool? preLoad,
  }) = _Data;

  factory Data.fromJson(Map<String, Object?> json) => _$DataFromJson(json);
}
