factory FailoverConfig.fromJson(Map<String, dynamic> json) { return FailoverConfig( recoveryWindow: json['recoveryWindow'] as int?, state: (json['state'] as String?)?.toState(), ); }