2023-10-22 22:15:34 +02:00
|
|
|
import 'package:openapi/api.dart';
|
|
|
|
|
|
|
|
class ServerFeatures {
|
|
|
|
final bool trash;
|
|
|
|
final bool map;
|
2024-01-04 22:44:40 +02:00
|
|
|
final bool oauthEnabled;
|
|
|
|
final bool passwordLogin;
|
2023-10-22 22:15:34 +02:00
|
|
|
|
|
|
|
const ServerFeatures({
|
|
|
|
required this.trash,
|
|
|
|
required this.map,
|
2024-01-04 22:44:40 +02:00
|
|
|
required this.oauthEnabled,
|
|
|
|
required this.passwordLogin,
|
2023-10-22 22:15:34 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
ServerFeatures copyWith({
|
|
|
|
bool? trash,
|
|
|
|
bool? map,
|
2024-01-04 22:44:40 +02:00
|
|
|
bool? oauthEnabled,
|
|
|
|
bool? passwordLogin,
|
2023-10-22 22:15:34 +02:00
|
|
|
}) {
|
|
|
|
return ServerFeatures(
|
|
|
|
trash: trash ?? this.trash,
|
|
|
|
map: map ?? this.map,
|
2024-01-04 22:44:40 +02:00
|
|
|
oauthEnabled: oauthEnabled ?? this.oauthEnabled,
|
|
|
|
passwordLogin: passwordLogin ?? this.passwordLogin,
|
2023-10-22 22:15:34 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
2024-01-04 22:44:40 +02:00
|
|
|
return 'ServerFeatures(trash: $trash, map: $map, oauthEnabled: $oauthEnabled, passwordLogin: $passwordLogin)';
|
2023-10-22 22:15:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ServerFeatures.fromDto(ServerFeaturesDto dto)
|
|
|
|
: trash = dto.trash,
|
2024-01-04 22:44:40 +02:00
|
|
|
map = dto.map,
|
|
|
|
oauthEnabled = dto.oauth,
|
|
|
|
passwordLogin = dto.passwordLogin;
|
2023-10-22 22:15:34 +02:00
|
|
|
|
|
|
|
@override
|
2024-01-04 22:44:40 +02:00
|
|
|
bool operator ==(covariant ServerFeatures other) {
|
2023-10-22 22:15:34 +02:00
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
2024-01-04 22:44:40 +02:00
|
|
|
return other.trash == trash &&
|
|
|
|
other.map == map &&
|
|
|
|
other.oauthEnabled == oauthEnabled &&
|
|
|
|
other.passwordLogin == passwordLogin;
|
2023-10-22 22:15:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode {
|
2024-01-04 22:44:40 +02:00
|
|
|
return trash.hashCode ^
|
|
|
|
map.hashCode ^
|
|
|
|
oauthEnabled.hashCode ^
|
|
|
|
passwordLogin.hashCode;
|
2023-10-22 22:15:34 +02:00
|
|
|
}
|
|
|
|
}
|