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

@freezed
class VpnConfig with _$VpnConfig {
  const factory VpnConfig({
    List<String>? cdnRouters,
    int? autoDisconnectMinutes,
    ConnectArgs? connectArgs,
    String? defaultDnsServers,
    String? forceSkipDomain,
    List<String>? routers,
    SkipIps? skipIps,
  }) = _VpnConfig;

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

@freezed
class ConnectArgs with _$ConnectArgs {
  const factory ConnectArgs({
    String? p,
    String? v,
  }) = _ConnectArgs;

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

@freezed
class SkipIps with _$SkipIps {
  const factory SkipIps({
    String? md5,
    String? url,
  }) = _SkipIps;

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