mirror of
https://github.com/immich-app/immich
synced 2025-06-07 10:10:56 +00:00
more formatting issues fixed
This commit is contained in:
parent
1379619daf
commit
75fcf2ad3f
@ -19,8 +19,10 @@ class SessionsAPIRepository extends ApiRepository
|
||||
|
||||
@override
|
||||
Future<SessionCreateResponse> createSession(
|
||||
String deviceType, String deviceOS,
|
||||
{int? duration,}) async {
|
||||
String deviceType,
|
||||
String deviceOS, {
|
||||
int? duration,
|
||||
}) async {
|
||||
final dto = await checkNull(
|
||||
_api.createSession(
|
||||
SessionCreateDto(
|
||||
|
71
mobile/openapi/lib/api/sessions_api.dart
generated
71
mobile/openapi/lib/api/sessions_api.dart
generated
@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
class SessionsApi {
|
||||
SessionsApi([ApiClient? apiClient])
|
||||
: apiClient = apiClient ?? defaultApiClient;
|
||||
SessionsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
@ -20,9 +20,7 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SessionCreateDto] sessionCreateDto (required):
|
||||
Future<Response> createSessionWithHttpInfo(
|
||||
SessionCreateDto sessionCreateDto,
|
||||
) async {
|
||||
Future<Response> createSessionWithHttpInfo(SessionCreateDto sessionCreateDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/sessions';
|
||||
|
||||
@ -35,6 +33,7 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
@ -49,24 +48,17 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SessionCreateDto] sessionCreateDto (required):
|
||||
Future<SessionCreateResponseDto?> createSession(
|
||||
SessionCreateDto sessionCreateDto,
|
||||
) async {
|
||||
final response = await createSessionWithHttpInfo(
|
||||
sessionCreateDto,
|
||||
);
|
||||
Future<SessionCreateResponseDto?> createSession(SessionCreateDto sessionCreateDto,) async {
|
||||
final response = await createSessionWithHttpInfo(sessionCreateDto,);
|
||||
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),
|
||||
'SessionCreateResponseDto',
|
||||
) as SessionCreateResponseDto;
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SessionCreateResponseDto',) as SessionCreateResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -85,6 +77,7 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'DELETE',
|
||||
@ -107,11 +100,10 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<Response> deleteSessionWithHttpInfo(
|
||||
String id,
|
||||
) async {
|
||||
Future<Response> deleteSessionWithHttpInfo(String id,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/sessions/{id}'.replaceAll('{id}', id);
|
||||
final apiPath = r'/sessions/{id}'
|
||||
.replaceAll('{id}', id);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
@ -122,6 +114,7 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'DELETE',
|
||||
@ -136,12 +129,8 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<void> deleteSession(
|
||||
String id,
|
||||
) async {
|
||||
final response = await deleteSessionWithHttpInfo(
|
||||
id,
|
||||
);
|
||||
Future<void> deleteSession(String id,) async {
|
||||
final response = await deleteSessionWithHttpInfo(id,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
@ -161,6 +150,7 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'GET',
|
||||
@ -180,13 +170,12 @@ class SessionsApi {
|
||||
// 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) {
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(
|
||||
responseBody, 'List<SessionResponseDto>') as List)
|
||||
.cast<SessionResponseDto>()
|
||||
.toList(growable: false);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<SessionResponseDto>') as List)
|
||||
.cast<SessionResponseDto>()
|
||||
.toList(growable: false);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -195,11 +184,10 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<Response> lockSessionWithHttpInfo(
|
||||
String id,
|
||||
) async {
|
||||
Future<Response> lockSessionWithHttpInfo(String id,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/sessions/{id}/lock'.replaceAll('{id}', id);
|
||||
final apiPath = r'/sessions/{id}/lock'
|
||||
.replaceAll('{id}', id);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
@ -210,6 +198,7 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
@ -224,12 +213,8 @@ class SessionsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<void> lockSession(
|
||||
String id,
|
||||
) async {
|
||||
final response = await lockSessionWithHttpInfo(
|
||||
id,
|
||||
);
|
||||
Future<void> lockSession(String id,) async {
|
||||
final response = await lockSessionWithHttpInfo(id,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user