2023-10-22 20:15:34 +00:00
|
|
|
import 'package:openapi/api.dart';
|
|
|
|
|
|
|
|
|
|
class ServerFeatures {
|
|
|
|
|
final bool trash;
|
|
|
|
|
final bool map;
|
2024-01-04 20:44:40 +00:00
|
|
|
final bool oauthEnabled;
|
|
|
|
|
final bool passwordLogin;
|
2025-10-28 13:54:41 -05:00
|
|
|
final bool ocr;
|
2026-02-16 03:41:56 +01:00
|
|
|
final bool smartSearch;
|
2023-10-22 20:15:34 +00:00
|
|
|
|
|
|
|
|
const ServerFeatures({
|
|
|
|
|
required this.trash,
|
|
|
|
|
required this.map,
|
2024-01-04 20:44:40 +00:00
|
|
|
required this.oauthEnabled,
|
|
|
|
|
required this.passwordLogin,
|
2025-10-28 13:54:41 -05:00
|
|
|
this.ocr = false,
|
2026-02-16 03:41:56 +01:00
|
|
|
this.smartSearch = false,
|
2023-10-22 20:15:34 +00:00
|
|
|
});
|
|
|
|
|
|
2026-02-16 03:41:56 +01:00
|
|
|
ServerFeatures copyWith({
|
|
|
|
|
bool? trash,
|
|
|
|
|
bool? map,
|
|
|
|
|
bool? oauthEnabled,
|
|
|
|
|
bool? passwordLogin,
|
|
|
|
|
bool? ocr,
|
|
|
|
|
bool? smartSearch,
|
|
|
|
|
}) {
|
2023-10-22 20:15:34 +00:00
|
|
|
return ServerFeatures(
|
|
|
|
|
trash: trash ?? this.trash,
|
|
|
|
|
map: map ?? this.map,
|
2024-01-04 20:44:40 +00:00
|
|
|
oauthEnabled: oauthEnabled ?? this.oauthEnabled,
|
|
|
|
|
passwordLogin: passwordLogin ?? this.passwordLogin,
|
2025-10-28 13:54:41 -05:00
|
|
|
ocr: ocr ?? this.ocr,
|
2026-02-16 03:41:56 +01:00
|
|
|
smartSearch: smartSearch ?? this.smartSearch,
|
2023-10-22 20:15:34 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
2026-02-16 03:41:56 +01:00
|
|
|
return 'ServerFeatures(trash: $trash, map: $map, oauthEnabled: $oauthEnabled, passwordLogin: $passwordLogin, ocr: $ocr, smartSearch: $smartSearch)';
|
2023-10-22 20:15:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServerFeatures.fromDto(ServerFeaturesDto dto)
|
2025-07-29 00:34:03 +05:30
|
|
|
: trash = dto.trash,
|
|
|
|
|
map = dto.map,
|
|
|
|
|
oauthEnabled = dto.oauth,
|
2025-10-28 13:54:41 -05:00
|
|
|
passwordLogin = dto.passwordLogin,
|
2026-02-16 03:41:56 +01:00
|
|
|
ocr = dto.ocr,
|
|
|
|
|
smartSearch = dto.smartSearch;
|
2023-10-22 20:15:34 +00:00
|
|
|
|
|
|
|
|
@override
|
2024-01-04 20:44:40 +00:00
|
|
|
bool operator ==(covariant ServerFeatures other) {
|
2026-05-12 00:47:24 +07:00
|
|
|
if (identical(this, other)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2023-10-22 20:15:34 +00:00
|
|
|
|
2024-01-04 20:44:40 +00:00
|
|
|
return other.trash == trash &&
|
|
|
|
|
other.map == map &&
|
|
|
|
|
other.oauthEnabled == oauthEnabled &&
|
2025-10-28 13:54:41 -05:00
|
|
|
other.passwordLogin == passwordLogin &&
|
2026-02-16 03:41:56 +01:00
|
|
|
other.ocr == ocr &&
|
|
|
|
|
other.smartSearch == smartSearch;
|
2023-10-22 20:15:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode {
|
2026-02-16 03:41:56 +01:00
|
|
|
return trash.hashCode ^
|
|
|
|
|
map.hashCode ^
|
|
|
|
|
oauthEnabled.hashCode ^
|
|
|
|
|
passwordLogin.hashCode ^
|
|
|
|
|
ocr.hashCode ^
|
|
|
|
|
smartSearch.hashCode;
|
2023-10-22 20:15:34 +00:00
|
|
|
}
|
|
|
|
|
}
|