format sessions api

This commit is contained in:
bwees 2025-05-29 11:57:36 -05:00
parent 338f7a2576
commit 1379619daf
No known key found for this signature in database

View File

@ -10,9 +10,9 @@
part of openapi.api; part of openapi.api;
class SessionsApi { class SessionsApi {
SessionsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; SessionsApi([ApiClient? apiClient])
: apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -20,7 +20,9 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [SessionCreateDto] sessionCreateDto (required): /// * [SessionCreateDto] sessionCreateDto (required):
Future<Response> createSessionWithHttpInfo(SessionCreateDto sessionCreateDto,) async { Future<Response> createSessionWithHttpInfo(
SessionCreateDto sessionCreateDto,
) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final apiPath = r'/sessions'; final apiPath = r'/sessions';
@ -33,7 +35,6 @@ class SessionsApi {
const contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
return apiClient.invokeAPI( return apiClient.invokeAPI(
apiPath, apiPath,
'POST', 'POST',
@ -48,17 +49,24 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [SessionCreateDto] sessionCreateDto (required): /// * [SessionCreateDto] sessionCreateDto (required):
Future<SessionCreateResponseDto?> createSession(SessionCreateDto sessionCreateDto,) async { Future<SessionCreateResponseDto?> createSession(
final response = await createSessionWithHttpInfo(sessionCreateDto,); SessionCreateDto 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 && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty &&
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SessionCreateResponseDto',) as SessionCreateResponseDto; response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'SessionCreateResponseDto',
) as SessionCreateResponseDto;
} }
return null; return null;
} }
@ -77,7 +85,6 @@ class SessionsApi {
const contentTypes = <String>[]; const contentTypes = <String>[];
return apiClient.invokeAPI( return apiClient.invokeAPI(
apiPath, apiPath,
'DELETE', 'DELETE',
@ -100,10 +107,11 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> deleteSessionWithHttpInfo(String id,) async { Future<Response> deleteSessionWithHttpInfo(
String id,
) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}' final apiPath = r'/sessions/{id}'.replaceAll('{id}', id);
.replaceAll('{id}', id);
// ignore: prefer_final_locals // ignore: prefer_final_locals
Object? postBody; Object? postBody;
@ -114,7 +122,6 @@ class SessionsApi {
const contentTypes = <String>[]; const contentTypes = <String>[];
return apiClient.invokeAPI( return apiClient.invokeAPI(
apiPath, apiPath,
'DELETE', 'DELETE',
@ -129,8 +136,12 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<void> deleteSession(String id,) async { Future<void> deleteSession(
final response = await deleteSessionWithHttpInfo(id,); String 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));
} }
@ -150,7 +161,6 @@ class SessionsApi {
const contentTypes = <String>[]; const contentTypes = <String>[];
return apiClient.invokeAPI( return apiClient.invokeAPI(
apiPath, apiPath,
'GET', 'GET',
@ -170,12 +180,13 @@ 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 && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty &&
response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response); final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SessionResponseDto>') as List) return (await apiClient.deserializeAsync(
responseBody, 'List<SessionResponseDto>') as List)
.cast<SessionResponseDto>() .cast<SessionResponseDto>()
.toList(growable: false); .toList(growable: false);
} }
return null; return null;
} }
@ -184,10 +195,11 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> lockSessionWithHttpInfo(String id,) async { Future<Response> lockSessionWithHttpInfo(
String id,
) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}/lock' final apiPath = r'/sessions/{id}/lock'.replaceAll('{id}', id);
.replaceAll('{id}', id);
// ignore: prefer_final_locals // ignore: prefer_final_locals
Object? postBody; Object? postBody;
@ -198,7 +210,6 @@ class SessionsApi {
const contentTypes = <String>[]; const contentTypes = <String>[];
return apiClient.invokeAPI( return apiClient.invokeAPI(
apiPath, apiPath,
'POST', 'POST',
@ -213,8 +224,12 @@ class SessionsApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<void> lockSession(String id,) async { Future<void> lockSession(
final response = await lockSessionWithHttpInfo(id,); String 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));
} }