2023-02-13 14:13:32 +00:00
|
|
|
import 'package:selfprivacy/logic/api_maps/generic_result.dart';
|
2023-02-22 17:58:59 +00:00
|
|
|
import 'package:selfprivacy/logic/models/callback_dialogue_branching.dart';
|
|
|
|
import 'package:selfprivacy/logic/models/launch_installation_data.dart';
|
2023-02-07 16:51:15 +00:00
|
|
|
import 'package:selfprivacy/logic/models/server_provider_location.dart';
|
|
|
|
import 'package:selfprivacy/logic/models/server_type.dart';
|
2023-01-30 15:44:52 +00:00
|
|
|
|
2023-02-13 14:13:32 +00:00
|
|
|
export 'package:selfprivacy/logic/api_maps/generic_result.dart';
|
|
|
|
|
2023-01-30 15:44:52 +00:00
|
|
|
abstract class ServerProvider {
|
2023-02-21 09:11:04 +00:00
|
|
|
Future<GenericResult<bool>> trySetServerLocation(final String location);
|
2023-02-13 14:13:32 +00:00
|
|
|
Future<GenericResult<bool>> tryInitApiByToken(final String token);
|
|
|
|
Future<GenericResult<List<ServerProviderLocation>>> getAvailableLocations();
|
|
|
|
Future<GenericResult<List<ServerType>>> getServerTypes({
|
2023-02-07 16:51:15 +00:00
|
|
|
required final ServerProviderLocation location,
|
|
|
|
});
|
2023-02-22 17:58:59 +00:00
|
|
|
Future<GenericResult<CallbackDialogueBranching?>> launchInstallation(
|
|
|
|
final LaunchInstallationData installationData,
|
|
|
|
);
|
|
|
|
Future<GenericResult<DateTime?>> powerOn(final int serverId);
|
|
|
|
Future<GenericResult<DateTime?>> restart(final int serverId);
|
2023-02-13 14:13:32 +00:00
|
|
|
|
|
|
|
GenericResult<bool> get success => GenericResult(success: true, data: true);
|
2023-01-30 15:44:52 +00:00
|
|
|
}
|