mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
format sessions api
This commit is contained in:
parent
bed3b717c7
commit
05268eb039
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,7 +20,9 @@ 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';
|
||||
|
||||
@ -33,7 +35,6 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
@ -48,17 +49,24 @@ 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;
|
||||
}
|
||||
@ -77,7 +85,6 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'DELETE',
|
||||
@ -100,10 +107,11 @@ 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;
|
||||
@ -114,7 +122,6 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'DELETE',
|
||||
@ -129,8 +136,12 @@ 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));
|
||||
}
|
||||
@ -150,7 +161,6 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'GET',
|
||||
@ -170,12 +180,13 @@ 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;
|
||||
}
|
||||
@ -184,10 +195,11 @@ 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;
|
||||
@ -198,7 +210,6 @@ class SessionsApi {
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
@ -213,8 +224,12 @@ 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