Files
iiEsaywebUIapp/lib/core/models/server_config.dart

24 lines
675 B
Dart
Raw Normal View History

2025-08-10 01:20:45 +05:30
import 'package:freezed_annotation/freezed_annotation.dart';
part 'server_config.freezed.dart';
part 'server_config.g.dart';
@freezed
sealed class ServerConfig with _$ServerConfig {
const factory ServerConfig({
required String id,
required String name,
required String url,
String? apiKey,
2025-08-16 15:51:27 +05:30
@Default({}) Map<String, String> customHeaders,
2025-08-10 01:20:45 +05:30
DateTime? lastConnected,
@Default(false) bool isActive,
/// Whether to trust self-signed TLS certificates for this server.
@Default(false) bool allowSelfSignedCertificates,
2025-08-10 01:20:45 +05:30
}) = _ServerConfig;
factory ServerConfig.fromJson(Map<String, dynamic> json) =>
_$ServerConfigFromJson(json);
}