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