// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.18 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class RepositoryApi { RepositoryApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; /// Performs an HTTP 'GET /yucca/repository/{id}/import' operation and returns the [Response]. /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): Future checkImportRepositoryWithHttpInfo(String backend, String id,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/import' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; queryParams.addAll(_queryParams('', 'backend', backend)); const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): Future checkImportRepository(String backend, String id,) async { final response = await checkImportRepositoryWithHttpInfo(backend, id,); 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), 'RepositoryCheckImportResponseDto',) as RepositoryCheckImportResponseDto; } return null; } /// Performs an HTTP 'POST /yucca/repository/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): Future createBackupWithHttpInfo(String id,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): Future createBackup(String id,) async { final response = await createBackupWithHttpInfo(id,); 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), 'LogResponseDto',) as LogResponseDto; } return null; } /// Performs an HTTP 'POST /yucca/repository' operation and returns the [Response]. /// Parameters: /// /// * [RepositoryCreateRequestDto] repositoryCreateRequestDto (required): /// /// * [String] backend: Future createRepositoryWithHttpInfo(RepositoryCreateRequestDto repositoryCreateRequestDto, { String? backend, }) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository'; // ignore: prefer_final_locals Object? postBody = repositoryCreateRequestDto; final queryParams = []; final headerParams = {}; final formParams = {}; if (backend != null) { queryParams.addAll(_queryParams('', 'backend', backend)); } const contentTypes = ['application/json']; return apiClient.invokeAPI( apiPath, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [RepositoryCreateRequestDto] repositoryCreateRequestDto (required): /// /// * [String] backend: Future createRepository(RepositoryCreateRequestDto repositoryCreateRequestDto, { String? backend, }) async { final response = await createRepositoryWithHttpInfo(repositoryCreateRequestDto, backend: backend, ); 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), 'RepositoryCreateResponseDto',) as RepositoryCreateResponseDto; } return null; } /// Performs an HTTP 'DELETE /yucca/repository/{id}/snapshots/{snapshot}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): Future forgetSnapshotWithHttpInfo(String id, String snapshot,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}' .replaceAll('{id}', id) .replaceAll('{snapshot}', snapshot); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'DELETE', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): Future forgetSnapshot(String id, String snapshot,) async { final response = await forgetSnapshotWithHttpInfo(id, snapshot,); 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), 'ListSnapshotsResponseDto',) as ListSnapshotsResponseDto; } return null; } /// Performs an HTTP 'GET /yucca/repository' operation and returns the [Response]. Future getRepositoriesWithHttpInfo() async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository'; // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } Future getRepositories() async { final response = await getRepositoriesWithHttpInfo(); 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), 'RepositoryListResponseDto',) as RepositoryListResponseDto; } return null; } /// Performs an HTTP 'GET /yucca/repository/{id}/runs' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): Future getRunHistoryWithHttpInfo(String id,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/runs' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): Future getRunHistory(String id,) async { final response = await getRunHistoryWithHttpInfo(id,); 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), 'RunHistoryResponseDto',) as RunHistoryResponseDto; } return null; } /// Performs an HTTP 'GET /yucca/repository/{id}/snapshots/{snapshot}/listing' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [String] path: Future getSnapshotListingWithHttpInfo(String id, String snapshot, { String? path, }) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}/listing' .replaceAll('{id}', id) .replaceAll('{snapshot}', snapshot); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (path != null) { queryParams.addAll(_queryParams('', 'path', path)); } const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [String] path: Future getSnapshotListing(String id, String snapshot, { String? path, }) async { final response = await getSnapshotListingWithHttpInfo(id, snapshot, path: path, ); 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), 'FilesystemListingResponseDto',) as FilesystemListingResponseDto; } return null; } /// Performs an HTTP 'GET /yucca/repository/{id}/snapshots' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): Future getSnapshotsWithHttpInfo(String id,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/snapshots' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): Future getSnapshots(String id,) async { final response = await getSnapshotsWithHttpInfo(id,); 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), 'ListSnapshotsResponseDto',) as ListSnapshotsResponseDto; } return null; } /// Performs an HTTP 'POST /yucca/repository/{id}/import' operation and returns the [Response]. /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): Future importRepositoryWithHttpInfo(String backend, String id,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/import' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; queryParams.addAll(_queryParams('', 'backend', backend)); const contentTypes = []; return apiClient.invokeAPI( apiPath, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): Future importRepository(String backend, String id,) async { final response = await importRepositoryWithHttpInfo(backend, id,); 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), 'RepositoryCreateResponseDto',) as RepositoryCreateResponseDto; } return null; } /// Performs an HTTP 'GET /yucca/repository/inspect' operation and returns the [Response]. Future inspectRepositoriesWithHttpInfo() async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/inspect'; // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( apiPath, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } Future inspectRepositories() async { final response = await inspectRepositoriesWithHttpInfo(); 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), 'RepositoryInspectResponseDto',) as RepositoryInspectResponseDto; } return null; } /// Performs an HTTP 'POST /yucca/repository/{id}/snapshots/{snapshot}/restore-from-point' operation and returns the [Response]. /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [RepositorySnapshotRestoreFromPointRequestDto] repositorySnapshotRestoreFromPointRequestDto (required): Future restoreFromPointWithHttpInfo(String backend, String id, String snapshot, RepositorySnapshotRestoreFromPointRequestDto repositorySnapshotRestoreFromPointRequestDto,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}/restore-from-point' .replaceAll('{id}', id) .replaceAll('{snapshot}', snapshot); // ignore: prefer_final_locals Object? postBody = repositorySnapshotRestoreFromPointRequestDto; final queryParams = []; final headerParams = {}; final formParams = {}; queryParams.addAll(_queryParams('', 'backend', backend)); const contentTypes = ['application/json']; return apiClient.invokeAPI( apiPath, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] backend (required): /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [RepositorySnapshotRestoreFromPointRequestDto] repositorySnapshotRestoreFromPointRequestDto (required): Future restoreFromPoint(String backend, String id, String snapshot, RepositorySnapshotRestoreFromPointRequestDto repositorySnapshotRestoreFromPointRequestDto,) async { final response = await restoreFromPointWithHttpInfo(backend, id, snapshot, repositorySnapshotRestoreFromPointRequestDto,); 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), 'LogResponseDto',) as LogResponseDto; } return null; } /// Performs an HTTP 'POST /yucca/repository/{id}/snapshots/{snapshot}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [RepositorySnapshotRestoreRequestDto] repositorySnapshotRestoreRequestDto (required): Future restoreSnapshotWithHttpInfo(String id, String snapshot, RepositorySnapshotRestoreRequestDto repositorySnapshotRestoreRequestDto,) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}' .replaceAll('{id}', id) .replaceAll('{snapshot}', snapshot); // ignore: prefer_final_locals Object? postBody = repositorySnapshotRestoreRequestDto; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = ['application/json']; return apiClient.invokeAPI( apiPath, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): /// /// * [String] snapshot (required): /// /// * [RepositorySnapshotRestoreRequestDto] repositorySnapshotRestoreRequestDto (required): Future restoreSnapshot(String id, String snapshot, RepositorySnapshotRestoreRequestDto repositorySnapshotRestoreRequestDto,) async { final response = await restoreSnapshotWithHttpInfo(id, snapshot, repositorySnapshotRestoreRequestDto,); 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), 'LogResponseDto',) as LogResponseDto; } return null; } /// Performs an HTTP 'PATCH /yucca/repository/{id}' operation and returns the [Response]. /// Parameters: /// /// * [String] id (required): /// /// * [RepositoryUpdateRequestDto] repositoryUpdateRequestDto (required): /// /// * [String] backend: Future updateRepositoryWithHttpInfo(String id, RepositoryUpdateRequestDto repositoryUpdateRequestDto, { String? backend, }) async { // ignore: prefer_const_declarations final apiPath = r'/yucca/repository/{id}' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody = repositoryUpdateRequestDto; final queryParams = []; final headerParams = {}; final formParams = {}; if (backend != null) { queryParams.addAll(_queryParams('', 'backend', backend)); } const contentTypes = ['application/json']; return apiClient.invokeAPI( apiPath, 'PATCH', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Parameters: /// /// * [String] id (required): /// /// * [RepositoryUpdateRequestDto] repositoryUpdateRequestDto (required): /// /// * [String] backend: Future updateRepository(String id, RepositoryUpdateRequestDto repositoryUpdateRequestDto, { String? backend, }) async { final response = await updateRepositoryWithHttpInfo(id, repositoryUpdateRequestDto, backend: backend, ); 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), 'RepositoryUpdateResponseDto',) as RepositoryUpdateResponseDto; } return null; } }