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

feat: pending sync reset flag (#19861)

This commit is contained in:
Jason Rasmussen
2025-07-11 09:38:02 -04:00
committed by GitHub
parent 34f0f6c813
commit 4b3a4725c6
28 changed files with 499 additions and 27 deletions

View File

@ -219,4 +219,56 @@ class SessionsApi {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'PUT /sessions/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<Response> updateSessionWithHttpInfo(String id, SessionUpdateDto sessionUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = sessionUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<SessionResponseDto?> updateSession(String id, SessionUpdateDto sessionUpdateDto,) async {
final response = await updateSessionWithHttpInfo(id, sessionUpdateDto,);
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), 'SessionResponseDto',) as SessionResponseDto;
}
return null;
}
}