1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-06 06:07:29 +02:00

feat(server): apk links API endpoint for Obtainium Android mobile-server version sync (#18700)

This commit is contained in:
Nicholas
2025-05-28 17:45:49 -04:00
committed by GitHub
parent be247395db
commit 8ea40973a7
10 changed files with 263 additions and 0 deletions

View File

@ -90,6 +90,47 @@ class ServerApi {
return null;
}
/// Performs an HTTP 'GET /server/android-links' operation and returns the [Response].
Future<Response> getAndroidLinksWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/server/android-links';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<ServerApkLinksDto?> getAndroidLinks() async {
final response = await getAndroidLinksWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerApkLinksDto',) as ServerApkLinksDto;
}
return null;
}
/// Performs an HTTP 'GET /server/config' operation and returns the [Response].
Future<Response> getServerConfigWithHttpInfo() async {
// ignore: prefer_const_declarations