Implement rfs-client
This commit is contained in:
		
							
								
								
									
										3
									
								
								rfs-client/openapi/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								rfs-client/openapi/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| /target/ | ||||
| **/*.rs.bk | ||||
| Cargo.lock | ||||
							
								
								
									
										23
									
								
								rfs-client/openapi/.openapi-generator-ignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								rfs-client/openapi/.openapi-generator-ignore
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| # OpenAPI Generator Ignore | ||||
| # Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||||
|  | ||||
| # Use this file to prevent files from being overwritten by the generator. | ||||
| # The patterns follow closely to .gitignore or .dockerignore. | ||||
|  | ||||
| # As an example, the C# client generator defines ApiClient.cs. | ||||
| # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||||
| #ApiClient.cs | ||||
|  | ||||
| # You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||||
| #foo/*/qux | ||||
| # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||||
|  | ||||
| # You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||||
| #foo/**/qux | ||||
| # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||||
|  | ||||
| # You can also negate patterns with an exclamation (!). | ||||
| # For example, you can ignore all files in a docs folder with the file extension .md: | ||||
| #docs/*.md | ||||
| # Then explicitly reverse the ignore rule for a single file: | ||||
| #!docs/README.md | ||||
							
								
								
									
										123
									
								
								rfs-client/openapi/.openapi-generator/FILES
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								rfs-client/openapi/.openapi-generator/FILES
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
| .gitignore | ||||
| .travis.yml | ||||
| Cargo.toml | ||||
| README.md | ||||
| docs/AuthenticationApi.md | ||||
| docs/BlockDownloadsResponse.md | ||||
| docs/BlockInfo.md | ||||
| docs/BlockManagementApi.md | ||||
| docs/BlockUploadedResponse.md | ||||
| docs/BlocksResponse.md | ||||
| docs/DirListTemplate.md | ||||
| docs/DirLister.md | ||||
| docs/ErrorTemplate.md | ||||
| docs/FileDownloadRequest.md | ||||
| docs/FileInfo.md | ||||
| docs/FileManagementApi.md | ||||
| docs/FileUploadResponse.md | ||||
| docs/FlistBody.md | ||||
| docs/FlistManagementApi.md | ||||
| docs/FlistState.md | ||||
| docs/FlistStateAccepted.md | ||||
| docs/FlistStateCreated.md | ||||
| docs/FlistStateInProgress.md | ||||
| docs/FlistStateInfo.md | ||||
| docs/FlistStateResponse.md | ||||
| docs/FlistStateStarted.md | ||||
| docs/HealthResponse.md | ||||
| docs/Job.md | ||||
| docs/ListBlocksParams.md | ||||
| docs/ListBlocksResponse.md | ||||
| docs/PreviewResponse.md | ||||
| docs/ResponseError.md | ||||
| docs/ResponseErrorBadRequest.md | ||||
| docs/ResponseErrorConflict.md | ||||
| docs/ResponseErrorForbidden.md | ||||
| docs/ResponseErrorNotFound.md | ||||
| docs/ResponseErrorTemplateError.md | ||||
| docs/ResponseErrorUnauthorized.md | ||||
| docs/ResponseResult.md | ||||
| docs/ResponseResultBlockUploaded.md | ||||
| docs/ResponseResultDirTemplate.md | ||||
| docs/ResponseResultFileUploaded.md | ||||
| docs/ResponseResultFlistCreated.md | ||||
| docs/ResponseResultFlistState.md | ||||
| docs/ResponseResultFlists.md | ||||
| docs/ResponseResultPreviewFlist.md | ||||
| docs/ResponseResultRes.md | ||||
| docs/ResponseResultSignedIn.md | ||||
| docs/SignInBody.md | ||||
| docs/SignInResponse.md | ||||
| docs/SystemApi.md | ||||
| docs/TemplateErr.md | ||||
| docs/TemplateErrBadRequest.md | ||||
| docs/TemplateErrInternalServerError.md | ||||
| docs/TemplateErrNotFound.md | ||||
| docs/UploadBlockParams.md | ||||
| docs/UserBlocksResponse.md | ||||
| docs/VerifyBlock.md | ||||
| docs/VerifyBlocksRequest.md | ||||
| docs/VerifyBlocksResponse.md | ||||
| docs/WebsiteServingApi.md | ||||
| git_push.sh | ||||
| src/apis/authentication_api.rs | ||||
| src/apis/block_management_api.rs | ||||
| src/apis/configuration.rs | ||||
| src/apis/file_management_api.rs | ||||
| src/apis/flist_management_api.rs | ||||
| src/apis/mod.rs | ||||
| src/apis/system_api.rs | ||||
| src/apis/website_serving_api.rs | ||||
| src/lib.rs | ||||
| src/models/block_downloads_response.rs | ||||
| src/models/block_info.rs | ||||
| src/models/block_uploaded_response.rs | ||||
| src/models/blocks_response.rs | ||||
| src/models/dir_list_template.rs | ||||
| src/models/dir_lister.rs | ||||
| src/models/error_template.rs | ||||
| src/models/file_download_request.rs | ||||
| src/models/file_info.rs | ||||
| src/models/file_upload_response.rs | ||||
| src/models/flist_body.rs | ||||
| src/models/flist_state.rs | ||||
| src/models/flist_state_accepted.rs | ||||
| src/models/flist_state_created.rs | ||||
| src/models/flist_state_in_progress.rs | ||||
| src/models/flist_state_info.rs | ||||
| src/models/flist_state_response.rs | ||||
| src/models/flist_state_started.rs | ||||
| src/models/health_response.rs | ||||
| src/models/job.rs | ||||
| src/models/list_blocks_params.rs | ||||
| src/models/list_blocks_response.rs | ||||
| src/models/mod.rs | ||||
| src/models/preview_response.rs | ||||
| src/models/response_error.rs | ||||
| src/models/response_error_bad_request.rs | ||||
| src/models/response_error_conflict.rs | ||||
| src/models/response_error_forbidden.rs | ||||
| src/models/response_error_not_found.rs | ||||
| src/models/response_error_template_error.rs | ||||
| src/models/response_error_unauthorized.rs | ||||
| src/models/response_result.rs | ||||
| src/models/response_result_block_uploaded.rs | ||||
| src/models/response_result_dir_template.rs | ||||
| src/models/response_result_file_uploaded.rs | ||||
| src/models/response_result_flist_created.rs | ||||
| src/models/response_result_flist_state.rs | ||||
| src/models/response_result_flists.rs | ||||
| src/models/response_result_preview_flist.rs | ||||
| src/models/response_result_res.rs | ||||
| src/models/response_result_signed_in.rs | ||||
| src/models/sign_in_body.rs | ||||
| src/models/sign_in_response.rs | ||||
| src/models/template_err.rs | ||||
| src/models/template_err_bad_request.rs | ||||
| src/models/template_err_internal_server_error.rs | ||||
| src/models/template_err_not_found.rs | ||||
| src/models/upload_block_params.rs | ||||
| src/models/user_blocks_response.rs | ||||
| src/models/verify_block.rs | ||||
| src/models/verify_blocks_request.rs | ||||
| src/models/verify_blocks_response.rs | ||||
							
								
								
									
										1
									
								
								rfs-client/openapi/.openapi-generator/VERSION
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								rfs-client/openapi/.openapi-generator/VERSION
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| 7.13.0 | ||||
							
								
								
									
										1
									
								
								rfs-client/openapi/.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								rfs-client/openapi/.travis.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| language: rust | ||||
							
								
								
									
										15
									
								
								rfs-client/openapi/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								rfs-client/openapi/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| [package] | ||||
| name = "openapi" | ||||
| version = "0.2.0" | ||||
| authors = ["OpenAPI Generator team and contributors"] | ||||
| description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" | ||||
| license = "" | ||||
| edition = "2021" | ||||
|  | ||||
| [dependencies] | ||||
| serde = { version = "^1.0", features = ["derive"] } | ||||
| serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } | ||||
| serde_json = "^1.0" | ||||
| serde_repr = "^0.1" | ||||
| url = "^2.5" | ||||
| reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } | ||||
							
								
								
									
										113
									
								
								rfs-client/openapi/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										113
									
								
								rfs-client/openapi/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,113 @@ | ||||
| # Rust API client for openapi | ||||
|  | ||||
| No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  | ||||
|  | ||||
| ## Overview | ||||
|  | ||||
| This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.  By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. | ||||
|  | ||||
| - API version: 0.2.0 | ||||
| - Package version: 0.2.0 | ||||
| - Generator version: 7.13.0 | ||||
| - Build package: `org.openapitools.codegen.languages.RustClientCodegen` | ||||
|  | ||||
| ## Installation | ||||
|  | ||||
| Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: | ||||
|  | ||||
| ``` | ||||
| openapi = { path = "./openapi" } | ||||
| ``` | ||||
|  | ||||
| ## Documentation for API Endpoints | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Class | Method | HTTP request | Description | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| *AuthenticationApi* | [**sign_in_handler**](docs/AuthenticationApi.md#sign_in_handler) | **POST** /api/v1/signin |  | ||||
| *BlockManagementApi* | [**check_block_handler**](docs/BlockManagementApi.md#check_block_handler) | **HEAD** /api/v1/block/{hash} | Checks a block by its hash. | ||||
| *BlockManagementApi* | [**get_block_downloads_handler**](docs/BlockManagementApi.md#get_block_downloads_handler) | **GET** /api/v1/block/{hash}/downloads | Retrieve the number of times a block has been downloaded. | ||||
| *BlockManagementApi* | [**get_block_handler**](docs/BlockManagementApi.md#get_block_handler) | **GET** /api/v1/block/{hash} | Retrieve a block by its hash. | ||||
| *BlockManagementApi* | [**get_blocks_by_hash_handler**](docs/BlockManagementApi.md#get_blocks_by_hash_handler) | **GET** /api/v1/blocks/{hash} | Retrieve blocks by hash (file hash or block hash). | ||||
| *BlockManagementApi* | [**get_user_blocks_handler**](docs/BlockManagementApi.md#get_user_blocks_handler) | **GET** /api/v1/user/blocks | Retrieve all blocks uploaded by a specific user. | ||||
| *BlockManagementApi* | [**list_blocks_handler**](docs/BlockManagementApi.md#list_blocks_handler) | **GET** /api/v1/blocks | List all block hashes in the server with pagination | ||||
| *BlockManagementApi* | [**upload_block_handler**](docs/BlockManagementApi.md#upload_block_handler) | **POST** /api/v1/block | Upload a block to the server. | ||||
| *BlockManagementApi* | [**verify_blocks_handler**](docs/BlockManagementApi.md#verify_blocks_handler) | **POST** /api/v1/block/verify | Verify if multiple blocks exist on the server. | ||||
| *FileManagementApi* | [**get_file_handler**](docs/FileManagementApi.md#get_file_handler) | **GET** /api/v1/file/{hash} | Retrieve a file by its hash from path, with optional custom filename in request body. | ||||
| *FileManagementApi* | [**upload_file_handler**](docs/FileManagementApi.md#upload_file_handler) | **POST** /api/v1/file | Upload a file to the server. | ||||
| *FlistManagementApi* | [**create_flist_handler**](docs/FlistManagementApi.md#create_flist_handler) | **POST** /api/v1/fl |  | ||||
| *FlistManagementApi* | [**get_flist_state_handler**](docs/FlistManagementApi.md#get_flist_state_handler) | **GET** /api/v1/fl/{job_id} |  | ||||
| *FlistManagementApi* | [**list_flists_handler**](docs/FlistManagementApi.md#list_flists_handler) | **GET** /api/v1/fl |  | ||||
| *FlistManagementApi* | [**preview_flist_handler**](docs/FlistManagementApi.md#preview_flist_handler) | **GET** /api/v1/fl/preview/{flist_path} |  | ||||
| *FlistManagementApi* | [**serve_flists**](docs/FlistManagementApi.md#serve_flists) | **GET** /{path} | Serve flist files from the server's filesystem | ||||
| *SystemApi* | [**health_check_handler**](docs/SystemApi.md#health_check_handler) | **GET** /api/v1 |  | ||||
| *WebsiteServingApi* | [**serve_website_handler**](docs/WebsiteServingApi.md#serve_website_handler) | **GET** /api/v1/website/{website_hash}/{path} |  | ||||
|  | ||||
|  | ||||
| ## Documentation For Models | ||||
|  | ||||
|  - [BlockDownloadsResponse](docs/BlockDownloadsResponse.md) | ||||
|  - [BlockInfo](docs/BlockInfo.md) | ||||
|  - [BlockUploadedResponse](docs/BlockUploadedResponse.md) | ||||
|  - [BlocksResponse](docs/BlocksResponse.md) | ||||
|  - [DirListTemplate](docs/DirListTemplate.md) | ||||
|  - [DirLister](docs/DirLister.md) | ||||
|  - [ErrorTemplate](docs/ErrorTemplate.md) | ||||
|  - [FileDownloadRequest](docs/FileDownloadRequest.md) | ||||
|  - [FileInfo](docs/FileInfo.md) | ||||
|  - [FileUploadResponse](docs/FileUploadResponse.md) | ||||
|  - [FlistBody](docs/FlistBody.md) | ||||
|  - [FlistState](docs/FlistState.md) | ||||
|  - [FlistStateAccepted](docs/FlistStateAccepted.md) | ||||
|  - [FlistStateCreated](docs/FlistStateCreated.md) | ||||
|  - [FlistStateInProgress](docs/FlistStateInProgress.md) | ||||
|  - [FlistStateInfo](docs/FlistStateInfo.md) | ||||
|  - [FlistStateResponse](docs/FlistStateResponse.md) | ||||
|  - [FlistStateStarted](docs/FlistStateStarted.md) | ||||
|  - [HealthResponse](docs/HealthResponse.md) | ||||
|  - [Job](docs/Job.md) | ||||
|  - [ListBlocksParams](docs/ListBlocksParams.md) | ||||
|  - [ListBlocksResponse](docs/ListBlocksResponse.md) | ||||
|  - [PreviewResponse](docs/PreviewResponse.md) | ||||
|  - [ResponseError](docs/ResponseError.md) | ||||
|  - [ResponseErrorBadRequest](docs/ResponseErrorBadRequest.md) | ||||
|  - [ResponseErrorConflict](docs/ResponseErrorConflict.md) | ||||
|  - [ResponseErrorForbidden](docs/ResponseErrorForbidden.md) | ||||
|  - [ResponseErrorNotFound](docs/ResponseErrorNotFound.md) | ||||
|  - [ResponseErrorTemplateError](docs/ResponseErrorTemplateError.md) | ||||
|  - [ResponseErrorUnauthorized](docs/ResponseErrorUnauthorized.md) | ||||
|  - [ResponseResult](docs/ResponseResult.md) | ||||
|  - [ResponseResultBlockUploaded](docs/ResponseResultBlockUploaded.md) | ||||
|  - [ResponseResultDirTemplate](docs/ResponseResultDirTemplate.md) | ||||
|  - [ResponseResultFileUploaded](docs/ResponseResultFileUploaded.md) | ||||
|  - [ResponseResultFlistCreated](docs/ResponseResultFlistCreated.md) | ||||
|  - [ResponseResultFlistState](docs/ResponseResultFlistState.md) | ||||
|  - [ResponseResultFlists](docs/ResponseResultFlists.md) | ||||
|  - [ResponseResultPreviewFlist](docs/ResponseResultPreviewFlist.md) | ||||
|  - [ResponseResultRes](docs/ResponseResultRes.md) | ||||
|  - [ResponseResultSignedIn](docs/ResponseResultSignedIn.md) | ||||
|  - [SignInBody](docs/SignInBody.md) | ||||
|  - [SignInResponse](docs/SignInResponse.md) | ||||
|  - [TemplateErr](docs/TemplateErr.md) | ||||
|  - [TemplateErrBadRequest](docs/TemplateErrBadRequest.md) | ||||
|  - [TemplateErrInternalServerError](docs/TemplateErrInternalServerError.md) | ||||
|  - [TemplateErrNotFound](docs/TemplateErrNotFound.md) | ||||
|  - [UploadBlockParams](docs/UploadBlockParams.md) | ||||
|  - [UserBlocksResponse](docs/UserBlocksResponse.md) | ||||
|  - [VerifyBlock](docs/VerifyBlock.md) | ||||
|  - [VerifyBlocksRequest](docs/VerifyBlocksRequest.md) | ||||
|  - [VerifyBlocksResponse](docs/VerifyBlocksResponse.md) | ||||
|  | ||||
|  | ||||
| To get access to the crate's generated documentation, use: | ||||
|  | ||||
| ``` | ||||
| cargo doc --open | ||||
| ``` | ||||
|  | ||||
| ## Author | ||||
|  | ||||
|  | ||||
|  | ||||
							
								
								
									
										37
									
								
								rfs-client/openapi/docs/AuthenticationApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								rfs-client/openapi/docs/AuthenticationApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| # \AuthenticationApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**sign_in_handler**](AuthenticationApi.md#sign_in_handler) | **POST** /api/v1/signin |  | ||||
|  | ||||
|  | ||||
|  | ||||
| ## sign_in_handler | ||||
|  | ||||
| > models::SignInResponse sign_in_handler(sign_in_body) | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **sign_in_body** | [**SignInBody**](SignInBody.md) |  | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::SignInResponse**](SignInResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/json | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										14
									
								
								rfs-client/openapi/docs/Block.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								rfs-client/openapi/docs/Block.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| # Block | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **data** | [**std::path::PathBuf**](std::path::PathBuf.md) |  |  | ||||
| **hash** | **String** |  |  | ||||
| **index** | **i64** |  |  | ||||
| **size** | **i32** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/BlockDownloadsResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/BlockDownloadsResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # BlockDownloadsResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **block_hash** | **String** | Block hash |  | ||||
| **block_size** | **i64** | Size of the block in bytes |  | ||||
| **downloads_count** | **i64** | Number of times the block has been downloaded |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/BlockInfo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/BlockInfo.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # BlockInfo | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | Block hash |  | ||||
| **index** | **i64** | Block index within the file |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										250
									
								
								rfs-client/openapi/docs/BlockManagementApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										250
									
								
								rfs-client/openapi/docs/BlockManagementApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,250 @@ | ||||
| # \BlockManagementApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**check_block_handler**](BlockManagementApi.md#check_block_handler) | **HEAD** /api/v1/block/{hash} | Checks a block by its hash. | ||||
| [**get_block_downloads_handler**](BlockManagementApi.md#get_block_downloads_handler) | **GET** /api/v1/block/{hash}/downloads | Retrieve the number of times a block has been downloaded. | ||||
| [**get_block_handler**](BlockManagementApi.md#get_block_handler) | **GET** /api/v1/block/{hash} | Retrieve a block by its hash. | ||||
| [**get_blocks_by_hash_handler**](BlockManagementApi.md#get_blocks_by_hash_handler) | **GET** /api/v1/blocks/{hash} | Retrieve blocks by hash (file hash or block hash). | ||||
| [**get_user_blocks_handler**](BlockManagementApi.md#get_user_blocks_handler) | **GET** /api/v1/user/blocks | Retrieve all blocks uploaded by a specific user. | ||||
| [**list_blocks_handler**](BlockManagementApi.md#list_blocks_handler) | **GET** /api/v1/blocks | List all block hashes in the server with pagination | ||||
| [**upload_block_handler**](BlockManagementApi.md#upload_block_handler) | **POST** /api/v1/block | Upload a block to the server. | ||||
| [**verify_blocks_handler**](BlockManagementApi.md#verify_blocks_handler) | **POST** /api/v1/block/verify | Verify if multiple blocks exist on the server. | ||||
|  | ||||
|  | ||||
|  | ||||
| ## check_block_handler | ||||
|  | ||||
| > check_block_handler(hash) | ||||
| Checks a block by its hash. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | Block hash | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
|  (empty response body) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## get_block_downloads_handler | ||||
|  | ||||
| > models::BlockDownloadsResponse get_block_downloads_handler(hash) | ||||
| Retrieve the number of times a block has been downloaded. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | Block hash | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::BlockDownloadsResponse**](BlockDownloadsResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## get_block_handler | ||||
|  | ||||
| > std::path::PathBuf get_block_handler(hash) | ||||
| Retrieve a block by its hash. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | Block hash | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**std::path::PathBuf**](std::path::PathBuf.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/octet-stream, application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## get_blocks_by_hash_handler | ||||
|  | ||||
| > models::BlocksResponse get_blocks_by_hash_handler(hash) | ||||
| Retrieve blocks by hash (file hash or block hash). | ||||
|  | ||||
| If the hash is a file hash, returns all blocks with their block index related to that file. If the hash is a block hash, returns the block itself. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | File hash or block hash | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::BlocksResponse**](BlocksResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## get_user_blocks_handler | ||||
|  | ||||
| > models::UserBlocksResponse get_user_blocks_handler(page, per_page) | ||||
| Retrieve all blocks uploaded by a specific user. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **page** | Option<**i32**> | Page number (1-indexed) |  | | ||||
| **per_page** | Option<**i32**> | Number of items per page |  | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::UserBlocksResponse**](UserBlocksResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| [bearerAuth](../README.md#bearerAuth) | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## list_blocks_handler | ||||
|  | ||||
| > models::ListBlocksResponse list_blocks_handler(page, per_page) | ||||
| List all block hashes in the server with pagination | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **page** | Option<**i32**> | Page number (1-indexed) |  | | ||||
| **per_page** | Option<**i32**> | Number of items per page |  | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::ListBlocksResponse**](ListBlocksResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## upload_block_handler | ||||
|  | ||||
| > models::BlockUploadedResponse upload_block_handler(file_hash, idx, body) | ||||
| Upload a block to the server. | ||||
|  | ||||
| If the block already exists, the server will return a 200 OK response. If the block is new, the server will return a 201 Created response. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **file_hash** | **String** | File hash associated with the block | [required] | | ||||
| **idx** | **i64** | Block index within the file | [required] | | ||||
| **body** | **std::path::PathBuf** | Block data to upload | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::BlockUploadedResponse**](BlockUploadedResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| [bearerAuth](../README.md#bearerAuth) | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/octet-stream | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## verify_blocks_handler | ||||
|  | ||||
| > models::VerifyBlocksResponse verify_blocks_handler(verify_blocks_request) | ||||
| Verify if multiple blocks exist on the server. | ||||
|  | ||||
| Returns a list of missing blocks. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **verify_blocks_request** | [**VerifyBlocksRequest**](VerifyBlocksRequest.md) | List of block hashes to verify | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::VerifyBlocksResponse**](VerifyBlocksResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/json | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/BlockUploadedResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/BlockUploadedResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # BlockUploadedResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **hash** | **String** |  |  | ||||
| **message** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/BlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/BlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # BlocksResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **blocks** | [**Vec<models::BlockInfo>**](BlockInfo.md) | List of blocks with their indices |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/DirListTemplate.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/DirListTemplate.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # DirListTemplate | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **cur_path** | **String** |  |  | ||||
| **lister** | [**models::DirLister**](DirLister.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/DirLister.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/DirLister.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # DirLister | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **files** | [**Vec<models::FileInfo>**](FileInfo.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/ErrorTemplate.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/ErrorTemplate.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # ErrorTemplate | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **cur_path** | **String** |  |  | ||||
| **err** | [**models::TemplateErr**](TemplateErr.md) |  |  | ||||
| **message** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/File.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/File.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # File | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **file_content** | [**std::path::PathBuf**](std::path::PathBuf.md) |  |  | ||||
| **file_hash** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FileDownloadRequest.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FileDownloadRequest.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FileDownloadRequest | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **file_name** | **String** | The custom filename to use for download |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										16
									
								
								rfs-client/openapi/docs/FileInfo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								rfs-client/openapi/docs/FileInfo.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| # FileInfo | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **is_file** | **bool** |  |  | ||||
| **last_modified** | **i64** |  |  | ||||
| **name** | **String** |  |  | ||||
| **path_uri** | **String** |  |  | ||||
| **progress** | **f32** |  |  | ||||
| **size** | **i64** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										71
									
								
								rfs-client/openapi/docs/FileManagementApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								rfs-client/openapi/docs/FileManagementApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,71 @@ | ||||
| # \FileManagementApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**get_file_handler**](FileManagementApi.md#get_file_handler) | **GET** /api/v1/file/{hash} | Retrieve a file by its hash from path, with optional custom filename in request body. | ||||
| [**upload_file_handler**](FileManagementApi.md#upload_file_handler) | **POST** /api/v1/file | Upload a file to the server. | ||||
|  | ||||
|  | ||||
|  | ||||
| ## get_file_handler | ||||
|  | ||||
| > std::path::PathBuf get_file_handler(hash, file_download_request) | ||||
| Retrieve a file by its hash from path, with optional custom filename in request body. | ||||
|  | ||||
| The file will be reconstructed from its blocks. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | File hash | [required] | | ||||
| **file_download_request** | [**FileDownloadRequest**](FileDownloadRequest.md) | Optional custom filename for download | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**std::path::PathBuf**](std::path::PathBuf.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/json | ||||
| - **Accept**: application/octet-stream, application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## upload_file_handler | ||||
|  | ||||
| > models::FileUploadResponse upload_file_handler(body) | ||||
| Upload a file to the server. | ||||
|  | ||||
| The file will be split into blocks and stored in the database. | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **body** | **std::path::PathBuf** | File data to upload | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::FileUploadResponse**](FileUploadResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| [bearerAuth](../README.md#bearerAuth) | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/octet-stream | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/FileUploadResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/FileUploadResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # FileUploadResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **file_hash** | **String** | The file hash |  | ||||
| **message** | **String** | Message indicating success |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										18
									
								
								rfs-client/openapi/docs/FlistBody.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								rfs-client/openapi/docs/FlistBody.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| # FlistBody | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **auth** | Option<**String**> |  | [optional] | ||||
| **email** | Option<**String**> |  | [optional] | ||||
| **identity_token** | Option<**String**> |  | [optional] | ||||
| **image_name** | **String** |  |  | ||||
| **password** | Option<**String**> |  | [optional] | ||||
| **registry_token** | Option<**String**> |  | [optional] | ||||
| **server_address** | Option<**String**> |  | [optional] | ||||
| **username** | Option<**String**> |  | [optional] | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										150
									
								
								rfs-client/openapi/docs/FlistManagementApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										150
									
								
								rfs-client/openapi/docs/FlistManagementApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,150 @@ | ||||
| # \FlistManagementApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**create_flist_handler**](FlistManagementApi.md#create_flist_handler) | **POST** /api/v1/fl |  | ||||
| [**get_flist_state_handler**](FlistManagementApi.md#get_flist_state_handler) | **GET** /api/v1/fl/{job_id} |  | ||||
| [**list_flists_handler**](FlistManagementApi.md#list_flists_handler) | **GET** /api/v1/fl |  | ||||
| [**preview_flist_handler**](FlistManagementApi.md#preview_flist_handler) | **GET** /api/v1/fl/preview/{flist_path} |  | ||||
| [**serve_flists**](FlistManagementApi.md#serve_flists) | **GET** /{path} | Serve flist files from the server's filesystem | ||||
|  | ||||
|  | ||||
|  | ||||
| ## create_flist_handler | ||||
|  | ||||
| > models::Job create_flist_handler(flist_body) | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **flist_body** | [**FlistBody**](FlistBody.md) |  | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::Job**](Job.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| [bearerAuth](../README.md#bearerAuth) | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: application/json | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## get_flist_state_handler | ||||
|  | ||||
| > models::FlistStateResponse get_flist_state_handler(job_id) | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **job_id** | **String** | flist job id | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::FlistStateResponse**](FlistStateResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| [bearerAuth](../README.md#bearerAuth) | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## list_flists_handler | ||||
|  | ||||
| > std::collections::HashMap<String, Vec<models::FileInfo>> list_flists_handler() | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
| This endpoint does not need any parameter. | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**std::collections::HashMap<String, Vec<models::FileInfo>>**](Vec.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## preview_flist_handler | ||||
|  | ||||
| > models::PreviewResponse preview_flist_handler(flist_path) | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **flist_path** | **String** | flist file path | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::PreviewResponse**](PreviewResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| ## serve_flists | ||||
|  | ||||
| > std::path::PathBuf serve_flists(path) | ||||
| Serve flist files from the server's filesystem | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **path** | **String** | Path to the flist file or directory to serve | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**std::path::PathBuf**](std::path::PathBuf.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/octet-stream, application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										37
									
								
								rfs-client/openapi/docs/FlistServingApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								rfs-client/openapi/docs/FlistServingApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| # \FlistServingApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**serve_flists**](FlistServingApi.md#serve_flists) | **GET** /{path} | Serve flist files from the server's filesystem | ||||
|  | ||||
|  | ||||
|  | ||||
| ## serve_flists | ||||
|  | ||||
| > models::ResponseResult serve_flists(path) | ||||
| Serve flist files from the server's filesystem | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **path** | **String** | Path to the flist file or directory to serve | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::ResponseResult**](ResponseResult.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										15
									
								
								rfs-client/openapi/docs/FlistState.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								rfs-client/openapi/docs/FlistState.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| # FlistState | ||||
|  | ||||
| ## Enum Variants | ||||
|  | ||||
| | Name | Description | | ||||
| |---- | -----| | ||||
| | FlistStateAccepted |  | | ||||
| | FlistStateCreated |  | | ||||
| | FlistStateInProgress |  | | ||||
| | FlistStateStarted |  | | ||||
| | String |  | | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FlistStateAccepted.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FlistStateAccepted.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FlistStateAccepted | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **accepted** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FlistStateCreated.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FlistStateCreated.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FlistStateCreated | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **created** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FlistStateInProgress.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FlistStateInProgress.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FlistStateInProgress | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **in_progress** | [**models::FlistStateInfo**](FlistStateInfo.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/FlistStateInfo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/FlistStateInfo.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # FlistStateInfo | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **msg** | **String** |  |  | ||||
| **progress** | **f32** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FlistStateResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FlistStateResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FlistStateResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **flist_state** | [**models::FlistState**](FlistState.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/FlistStateStarted.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/FlistStateStarted.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # FlistStateStarted | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **started** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/HealthResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/HealthResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # HealthResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **msg** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/Job.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/Job.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # Job | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **id** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/ListBlocksParams.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/ListBlocksParams.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # ListBlocksParams | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **page** | Option<**i32**> | Page number (1-indexed) | [optional][default to 1] | ||||
| **per_page** | Option<**i32**> | Number of items per page | [optional][default to 50] | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										14
									
								
								rfs-client/openapi/docs/ListBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								rfs-client/openapi/docs/ListBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| # ListBlocksResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **blocks** | **Vec<String>** | List of block hashes |  | ||||
| **page** | **i32** | Current page number |  | ||||
| **per_page** | **i32** | Number of items per page |  | ||||
| **total** | **i64** | Total number of blocks |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/PreviewResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/PreviewResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # PreviewResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **checksum** | **String** |  |  | ||||
| **content** | **Vec<String>** |  |  | ||||
| **metadata** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										17
									
								
								rfs-client/openapi/docs/ResponseError.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								rfs-client/openapi/docs/ResponseError.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| # ResponseError | ||||
|  | ||||
| ## Enum Variants | ||||
|  | ||||
| | Name | Description | | ||||
| |---- | -----| | ||||
| | ResponseErrorBadRequest |  | | ||||
| | ResponseErrorConflict |  | | ||||
| | ResponseErrorForbidden |  | | ||||
| | ResponseErrorNotFound |  | | ||||
| | ResponseErrorTemplateError |  | | ||||
| | ResponseErrorUnauthorized |  | | ||||
| | String |  | | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorBadRequest.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorBadRequest.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorBadRequest | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **bad_request** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorConflict.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorConflict.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorConflict | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **conflict** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorForbidden.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorForbidden.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorForbidden | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **forbidden** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorNotFound.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorNotFound.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorNotFound | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **not_found** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorTemplateError.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorTemplateError.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorTemplateError | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **template_error** | [**models::ErrorTemplate**](ErrorTemplate.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorUnauthorized.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseErrorUnauthorized.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseErrorUnauthorized | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **unauthorized** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										20
									
								
								rfs-client/openapi/docs/ResponseResult.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								rfs-client/openapi/docs/ResponseResult.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| # ResponseResult | ||||
|  | ||||
| ## Enum Variants | ||||
|  | ||||
| | Name | Description | | ||||
| |---- | -----| | ||||
| | ResponseResultBlockUploaded |  | | ||||
| | ResponseResultDirTemplate |  | | ||||
| | ResponseResultFileUploaded |  | | ||||
| | ResponseResultFlistCreated |  | | ||||
| | ResponseResultFlistState |  | | ||||
| | ResponseResultFlists |  | | ||||
| | ResponseResultPreviewFlist |  | | ||||
| | ResponseResultRes |  | | ||||
| | ResponseResultSignedIn |  | | ||||
| | String |  | | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultBlockUploaded.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultBlockUploaded.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultBlockUploaded | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **block_uploaded** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultDirTemplate.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultDirTemplate.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultDirTemplate | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **dir_template** | [**models::DirListTemplate**](DirListTemplate.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFileUploaded.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFileUploaded.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultFileUploaded | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **file_uploaded** | [**models::FileUploadResponse**](FileUploadResponse.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlistCreated.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlistCreated.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultFlistCreated | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **flist_created** | [**models::Job**](Job.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlistState.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlistState.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultFlistState | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **flist_state** | [**models::FlistState**](FlistState.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlists.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultFlists.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultFlists | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **flists** | [**std::collections::HashMap<String, Vec<models::FileInfo>>**](Vec.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultPreviewFlist.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultPreviewFlist.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultPreviewFlist | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **preview_flist** | [**models::PreviewResponse**](PreviewResponse.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultRes.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultRes.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultRes | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **res** | [**std::path::PathBuf**](std::path::PathBuf.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultSignedIn.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/ResponseResultSignedIn.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # ResponseResultSignedIn | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **signed_in** | [**models::SignInResponse**](SignInResponse.md) |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/SignInBody.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/SignInBody.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # SignInBody | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **password** | **String** |  |  | ||||
| **username** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/SignInResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/SignInResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # SignInResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **access_token** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										34
									
								
								rfs-client/openapi/docs/SystemApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								rfs-client/openapi/docs/SystemApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| # \SystemApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**health_check_handler**](SystemApi.md#health_check_handler) | **GET** /api/v1 |  | ||||
|  | ||||
|  | ||||
|  | ||||
| ## health_check_handler | ||||
|  | ||||
| > models::HealthResponse health_check_handler() | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
| This endpoint does not need any parameter. | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**models::HealthResponse**](HealthResponse.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/TemplateErr.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/TemplateErr.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # TemplateErr | ||||
|  | ||||
| ## Enum Variants | ||||
|  | ||||
| | Name | Description | | ||||
| |---- | -----| | ||||
| | TemplateErrBadRequest |  | | ||||
| | TemplateErrInternalServerError |  | | ||||
| | TemplateErrNotFound |  | | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrBadRequest.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrBadRequest.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # TemplateErrBadRequest | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **bad_request** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrInternalServerError.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrInternalServerError.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # TemplateErrInternalServerError | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **internal_server_error** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrNotFound.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/TemplateErrNotFound.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # TemplateErrNotFound | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **not_found** | **String** |  |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/UploadBlockParams.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/UploadBlockParams.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # UploadBlockParams | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **file_hash** | **String** | File hash associated with the block |  | ||||
| **idx** | **i64** | Block index within the file |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/UserBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/UserBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # UserBlocksResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **all_blocks** | **i64** | Total number of all blocks |  | ||||
| **blocks** | [**Vec<models::BlockInfo>**](BlockInfo.md) | List of blocks with their indices |  | ||||
| **total** | **i64** | Total number of blocks |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								rfs-client/openapi/docs/VerifyBlock.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								rfs-client/openapi/docs/VerifyBlock.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # VerifyBlock | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **block_hash** | **String** | Block hash to verify |  | ||||
| **block_index** | **i64** | Block index within the file |  | ||||
| **file_hash** | **String** | File hash associated with the block |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/VerifyBlocksRequest.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/VerifyBlocksRequest.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # VerifyBlocksRequest | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **blocks** | [**Vec<models::VerifyBlock>**](VerifyBlock.md) | List of blocks to verify |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/docs/VerifyBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/docs/VerifyBlocksResponse.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| # VerifyBlocksResponse | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **missing** | **Vec<String>** | List of block hashes that are missing on the server |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
							
								
								
									
										38
									
								
								rfs-client/openapi/docs/WebsiteServingApi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								rfs-client/openapi/docs/WebsiteServingApi.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| # \WebsiteServingApi | ||||
|  | ||||
| All URIs are relative to *http://localhost* | ||||
|  | ||||
| Method | HTTP request | Description | ||||
| ------------- | ------------- | ------------- | ||||
| [**serve_website_handler**](WebsiteServingApi.md#serve_website_handler) | **GET** /api/v1/website/{website_hash}/{path} |  | ||||
|  | ||||
|  | ||||
|  | ||||
| ## serve_website_handler | ||||
|  | ||||
| > std::path::PathBuf serve_website_handler(website_hash, path) | ||||
|  | ||||
|  | ||||
| ### Parameters | ||||
|  | ||||
|  | ||||
| Name | Type | Description  | Required | Notes | ||||
| ------------- | ------------- | ------------- | ------------- | ------------- | ||||
| **website_hash** | **String** | flist hash of the website directory | [required] | | ||||
| **path** | **String** | Path to the file within the website directory, defaults to index.html if empty | [required] | | ||||
|  | ||||
| ### Return type | ||||
|  | ||||
| [**std::path::PathBuf**](std::path::PathBuf.md) | ||||
|  | ||||
| ### Authorization | ||||
|  | ||||
| No authorization required | ||||
|  | ||||
| ### HTTP request headers | ||||
|  | ||||
| - **Content-Type**: Not defined | ||||
| - **Accept**: application/octet-stream, application/json | ||||
|  | ||||
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) | ||||
|  | ||||
							
								
								
									
										57
									
								
								rfs-client/openapi/git_push.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								rfs-client/openapi/git_push.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | ||||
| #!/bin/sh | ||||
| # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ | ||||
| # | ||||
| # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" | ||||
|  | ||||
| git_user_id=$1 | ||||
| git_repo_id=$2 | ||||
| release_note=$3 | ||||
| git_host=$4 | ||||
|  | ||||
| if [ "$git_host" = "" ]; then | ||||
|     git_host="github.com" | ||||
|     echo "[INFO] No command line input provided. Set \$git_host to $git_host" | ||||
| fi | ||||
|  | ||||
| if [ "$git_user_id" = "" ]; then | ||||
|     git_user_id="GIT_USER_ID" | ||||
|     echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" | ||||
| fi | ||||
|  | ||||
| if [ "$git_repo_id" = "" ]; then | ||||
|     git_repo_id="GIT_REPO_ID" | ||||
|     echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" | ||||
| fi | ||||
|  | ||||
| if [ "$release_note" = "" ]; then | ||||
|     release_note="Minor update" | ||||
|     echo "[INFO] No command line input provided. Set \$release_note to $release_note" | ||||
| fi | ||||
|  | ||||
| # Initialize the local directory as a Git repository | ||||
| git init | ||||
|  | ||||
| # Adds the files in the local repository and stages them for commit. | ||||
| git add . | ||||
|  | ||||
| # Commits the tracked changes and prepares them to be pushed to a remote repository. | ||||
| git commit -m "$release_note" | ||||
|  | ||||
| # Sets the new remote | ||||
| git_remote=$(git remote) | ||||
| if [ "$git_remote" = "" ]; then # git remote not defined | ||||
|  | ||||
|     if [ "$GIT_TOKEN" = "" ]; then | ||||
|         echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." | ||||
|         git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git | ||||
|     else | ||||
|         git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git | ||||
|     fi | ||||
|  | ||||
| fi | ||||
|  | ||||
| git pull origin master | ||||
|  | ||||
| # Pushes (Forces) the changes in the local repository up to the remote repository | ||||
| echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" | ||||
| git push origin master 2>&1 | grep -v 'To https' | ||||
							
								
								
									
										64
									
								
								rfs-client/openapi/src/apis/authentication_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								rfs-client/openapi/src/apis/authentication_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`sign_in_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum SignInHandlerError { | ||||
|     Status401(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn sign_in_handler(configuration: &configuration::Configuration, sign_in_body: models::SignInBody) -> Result<models::SignInResponse, Error<SignInHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_sign_in_body = sign_in_body; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/signin", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     req_builder = req_builder.json(&p_sign_in_body); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SignInResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SignInResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<SignInHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										385
									
								
								rfs-client/openapi/src/apis/block_management_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										385
									
								
								rfs-client/openapi/src/apis/block_management_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,385 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`check_block_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum CheckBlockHandlerError { | ||||
|     Status404(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`get_block_downloads_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetBlockDownloadsHandlerError { | ||||
|     Status404(), | ||||
|     Status500(), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`get_block_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetBlockHandlerError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`get_blocks_by_hash_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetBlocksByHashHandlerError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`get_user_blocks_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetUserBlocksHandlerError { | ||||
|     Status401(), | ||||
|     Status500(), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`list_blocks_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum ListBlocksHandlerError { | ||||
|     Status400(), | ||||
|     Status500(), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`upload_block_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum UploadBlockHandlerError { | ||||
|     Status400(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`verify_blocks_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum VerifyBlocksHandlerError { | ||||
|     Status400(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn check_block_handler(configuration: &configuration::Configuration, hash: &str) -> Result<(), Error<CheckBlockHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_hash = hash; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/block/{hash}", configuration.base_path, hash=crate::apis::urlencode(p_hash)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::HEAD, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         Ok(()) | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<CheckBlockHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn get_block_downloads_handler(configuration: &configuration::Configuration, hash: &str) -> Result<models::BlockDownloadsResponse, Error<GetBlockDownloadsHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_hash = hash; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/block/{hash}/downloads", configuration.base_path, hash=crate::apis::urlencode(p_hash)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlockDownloadsResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlockDownloadsResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetBlockDownloadsHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn get_block_handler(configuration: &configuration::Configuration, hash: &str) -> Result<reqwest::Response, Error<GetBlockHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_hash = hash; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/block/{hash}", configuration.base_path, hash=crate::apis::urlencode(p_hash)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         Ok(resp) | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetBlockHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// If the hash is a file hash, returns all blocks with their block index related to that file. If the hash is a block hash, returns the block itself. | ||||
| pub async fn get_blocks_by_hash_handler(configuration: &configuration::Configuration, hash: &str) -> Result<models::BlocksResponse, Error<GetBlocksByHashHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_hash = hash; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/blocks/{hash}", configuration.base_path, hash=crate::apis::urlencode(p_hash)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlocksResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlocksResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetBlocksByHashHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn get_user_blocks_handler(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::UserBlocksResponse, Error<GetUserBlocksHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_page = page; | ||||
|     let p_per_page = per_page; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/user/blocks", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref param_value) = p_page { | ||||
|         req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); | ||||
|     } | ||||
|     if let Some(ref param_value) = p_per_page { | ||||
|         req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]); | ||||
|     } | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     if let Some(ref token) = configuration.bearer_access_token { | ||||
|         req_builder = req_builder.bearer_auth(token.to_owned()); | ||||
|     }; | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserBlocksResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserBlocksResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetUserBlocksHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn list_blocks_handler(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::ListBlocksResponse, Error<ListBlocksHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_page = page; | ||||
|     let p_per_page = per_page; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/blocks", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref param_value) = p_page { | ||||
|         req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); | ||||
|     } | ||||
|     if let Some(ref param_value) = p_per_page { | ||||
|         req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]); | ||||
|     } | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListBlocksResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListBlocksResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<ListBlocksHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// If the block already exists, the server will return a 200 OK response. If the block is new, the server will return a 201 Created response. | ||||
| pub async fn upload_block_handler(configuration: &configuration::Configuration, file_hash: &str, idx: i64, body: std::path::PathBuf) -> Result<models::BlockUploadedResponse, Error<UploadBlockHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_file_hash = file_hash; | ||||
|     let p_idx = idx; | ||||
|     let p_body = body; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/block", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); | ||||
|  | ||||
|     req_builder = req_builder.query(&[("file_hash", &p_file_hash.to_string())]); | ||||
|     req_builder = req_builder.query(&[("idx", &p_idx.to_string())]); | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     if let Some(ref token) = configuration.bearer_access_token { | ||||
|         req_builder = req_builder.bearer_auth(token.to_owned()); | ||||
|     }; | ||||
|     let file_content = std::fs::read(&p_body).map_err(|e| Error::Io(e))?; | ||||
|     req_builder = req_builder.body(file_content); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlockUploadedResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlockUploadedResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<UploadBlockHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// Returns a list of missing blocks. | ||||
| pub async fn verify_blocks_handler(configuration: &configuration::Configuration, verify_blocks_request: models::VerifyBlocksRequest) -> Result<models::VerifyBlocksResponse, Error<VerifyBlocksHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_verify_blocks_request = verify_blocks_request; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/block/verify", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     req_builder = req_builder.json(&p_verify_blocks_request); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyBlocksResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VerifyBlocksResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<VerifyBlocksHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										51
									
								
								rfs-client/openapi/src/apis/configuration.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								rfs-client/openapi/src/apis/configuration.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct Configuration { | ||||
|     pub base_path: String, | ||||
|     pub user_agent: Option<String>, | ||||
|     pub client: reqwest::Client, | ||||
|     pub basic_auth: Option<BasicAuth>, | ||||
|     pub oauth_access_token: Option<String>, | ||||
|     pub bearer_access_token: Option<String>, | ||||
|     pub api_key: Option<ApiKey>, | ||||
| } | ||||
|  | ||||
| pub type BasicAuth = (String, Option<String>); | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct ApiKey { | ||||
|     pub prefix: Option<String>, | ||||
|     pub key: String, | ||||
| } | ||||
|  | ||||
|  | ||||
| impl Configuration { | ||||
|     pub fn new() -> Configuration { | ||||
|         Configuration::default() | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl Default for Configuration { | ||||
|     fn default() -> Self { | ||||
|         Configuration { | ||||
|             base_path: "http://localhost".to_owned(), | ||||
|             user_agent: Some("OpenAPI-Generator/0.2.0/rust".to_owned()), | ||||
|             client: reqwest::Client::new(), | ||||
|             basic_auth: None, | ||||
|             oauth_access_token: None, | ||||
|             bearer_access_token: None, | ||||
|             api_key: None, | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										106
									
								
								rfs-client/openapi/src/apis/file_management_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								rfs-client/openapi/src/apis/file_management_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,106 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`get_file_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetFileHandlerError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`upload_file_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum UploadFileHandlerError { | ||||
|     Status400(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| /// The file will be reconstructed from its blocks. | ||||
| pub async fn get_file_handler(configuration: &configuration::Configuration, hash: &str, file_download_request: models::FileDownloadRequest) -> Result<reqwest::Response, Error<GetFileHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_hash = hash; | ||||
|     let p_file_download_request = file_download_request; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/file/{hash}", configuration.base_path, hash=crate::apis::urlencode(p_hash)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     req_builder = req_builder.json(&p_file_download_request); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         Ok(resp) | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetFileHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// The file will be split into blocks and stored in the database. | ||||
| pub async fn upload_file_handler(configuration: &configuration::Configuration, body: std::path::PathBuf) -> Result<models::FileUploadResponse, Error<UploadFileHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_body = body; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/file", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     if let Some(ref token) = configuration.bearer_access_token { | ||||
|         req_builder = req_builder.bearer_auth(token.to_owned()); | ||||
|     }; | ||||
|     let file_content = std::fs::read(&p_body).map_err(|e| Error::Io(e))?; | ||||
|     req_builder = req_builder.body(file_content); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FileUploadResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FileUploadResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<UploadFileHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										244
									
								
								rfs-client/openapi/src/apis/flist_management_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										244
									
								
								rfs-client/openapi/src/apis/flist_management_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,244 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`create_flist_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum CreateFlistHandlerError { | ||||
|     Status401(models::ResponseError), | ||||
|     Status403(models::ResponseError), | ||||
|     Status409(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`get_flist_state_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum GetFlistStateHandlerError { | ||||
|     Status401(models::ResponseError), | ||||
|     Status403(models::ResponseError), | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`list_flists_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum ListFlistsHandlerError { | ||||
|     Status401(models::ResponseError), | ||||
|     Status403(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`preview_flist_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum PreviewFlistHandlerError { | ||||
|     Status400(models::ResponseError), | ||||
|     Status401(models::ResponseError), | ||||
|     Status403(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
| /// struct for typed errors of method [`serve_flists`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum ServeFlistsError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn create_flist_handler(configuration: &configuration::Configuration, flist_body: models::FlistBody) -> Result<models::Job, Error<CreateFlistHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_flist_body = flist_body; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/fl", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     if let Some(ref token) = configuration.bearer_access_token { | ||||
|         req_builder = req_builder.bearer_auth(token.to_owned()); | ||||
|     }; | ||||
|     req_builder = req_builder.json(&p_flist_body); | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Job`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Job`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<CreateFlistHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn get_flist_state_handler(configuration: &configuration::Configuration, job_id: &str) -> Result<models::FlistStateResponse, Error<GetFlistStateHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_job_id = job_id; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/fl/{job_id}", configuration.base_path, job_id=crate::apis::urlencode(p_job_id)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|     if let Some(ref token) = configuration.bearer_access_token { | ||||
|         req_builder = req_builder.bearer_auth(token.to_owned()); | ||||
|     }; | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FlistStateResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FlistStateResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<GetFlistStateHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn list_flists_handler(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, Vec<models::FileInfo>>, Error<ListFlistsHandlerError>> { | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/fl", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, Vec<models::FileInfo>>`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, Vec<models::FileInfo>>`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<ListFlistsHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn preview_flist_handler(configuration: &configuration::Configuration, flist_path: &str) -> Result<models::PreviewResponse, Error<PreviewFlistHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_flist_path = flist_path; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/fl/preview/{flist_path}", configuration.base_path, flist_path=crate::apis::urlencode(p_flist_path)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PreviewResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<PreviewFlistHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub async fn serve_flists(configuration: &configuration::Configuration, path: &str) -> Result<reqwest::Response, Error<ServeFlistsError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_path = path; | ||||
|  | ||||
|     let uri_str = format!("{}/{path}", configuration.base_path, path=crate::apis::urlencode(p_path)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         Ok(resp) | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<ServeFlistsError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										63
									
								
								rfs-client/openapi/src/apis/flist_serving_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								rfs-client/openapi/src/apis/flist_serving_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`serve_flists`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum ServeFlistsError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn serve_flists(configuration: &configuration::Configuration, path: &str) -> Result<models::ResponseResult, Error<ServeFlistsError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_path = path; | ||||
|  | ||||
|     let uri_str = format!("{}/{path}", configuration.base_path, path=crate::apis::urlencode(p_path)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ResponseResult`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ResponseResult`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<ServeFlistsError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										121
									
								
								rfs-client/openapi/src/apis/mod.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								rfs-client/openapi/src/apis/mod.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,121 @@ | ||||
| use std::error; | ||||
| use std::fmt; | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct ResponseContent<T> { | ||||
|     pub status: reqwest::StatusCode, | ||||
|     pub content: String, | ||||
|     pub entity: Option<T>, | ||||
| } | ||||
|  | ||||
| #[derive(Debug)] | ||||
| pub enum Error<T> { | ||||
|     Reqwest(reqwest::Error), | ||||
|     Serde(serde_json::Error), | ||||
|     Io(std::io::Error), | ||||
|     ResponseError(ResponseContent<T>), | ||||
| } | ||||
|  | ||||
| impl <T> fmt::Display for Error<T> { | ||||
|     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||||
|         let (module, e) = match self { | ||||
|             Error::Reqwest(e) => ("reqwest", e.to_string()), | ||||
|             Error::Serde(e) => ("serde", e.to_string()), | ||||
|             Error::Io(e) => ("IO", e.to_string()), | ||||
|             Error::ResponseError(e) => ("response", format!("status code {}", e.status)), | ||||
|         }; | ||||
|         write!(f, "error in {}: {}", module, e) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl <T: fmt::Debug> error::Error for Error<T> { | ||||
|     fn source(&self) -> Option<&(dyn error::Error + 'static)> { | ||||
|         Some(match self { | ||||
|             Error::Reqwest(e) => e, | ||||
|             Error::Serde(e) => e, | ||||
|             Error::Io(e) => e, | ||||
|             Error::ResponseError(_) => return None, | ||||
|         }) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl <T> From<reqwest::Error> for Error<T> { | ||||
|     fn from(e: reqwest::Error) -> Self { | ||||
|         Error::Reqwest(e) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl <T> From<serde_json::Error> for Error<T> { | ||||
|     fn from(e: serde_json::Error) -> Self { | ||||
|         Error::Serde(e) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl <T> From<std::io::Error> for Error<T> { | ||||
|     fn from(e: std::io::Error) -> Self { | ||||
|         Error::Io(e) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub fn urlencode<T: AsRef<str>>(s: T) -> String { | ||||
|     ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() | ||||
| } | ||||
|  | ||||
| pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { | ||||
|     if let serde_json::Value::Object(object) = value { | ||||
|         let mut params = vec![]; | ||||
|  | ||||
|         for (key, value) in object { | ||||
|             match value { | ||||
|                 serde_json::Value::Object(_) => params.append(&mut parse_deep_object( | ||||
|                     &format!("{}[{}]", prefix, key), | ||||
|                     value, | ||||
|                 )), | ||||
|                 serde_json::Value::Array(array) => { | ||||
|                     for (i, value) in array.iter().enumerate() { | ||||
|                         params.append(&mut parse_deep_object( | ||||
|                             &format!("{}[{}][{}]", prefix, key, i), | ||||
|                             value, | ||||
|                         )); | ||||
|                     } | ||||
|                 }, | ||||
|                 serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), | ||||
|                 _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return params; | ||||
|     } | ||||
|  | ||||
|     unimplemented!("Only objects are supported with style=deepObject") | ||||
| } | ||||
|  | ||||
| /// Internal use only | ||||
| /// A content type supported by this client. | ||||
| #[allow(dead_code)] | ||||
| enum ContentType { | ||||
|     Json, | ||||
|     Text, | ||||
|     Unsupported(String) | ||||
| } | ||||
|  | ||||
| impl From<&str> for ContentType { | ||||
|     fn from(content_type: &str) -> Self { | ||||
|         if content_type.starts_with("application") && content_type.contains("json") { | ||||
|             return Self::Json; | ||||
|         } else if content_type.starts_with("text/plain") { | ||||
|             return Self::Text; | ||||
|         } else { | ||||
|             return Self::Unsupported(content_type.to_string()); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub mod authentication_api; | ||||
| pub mod block_management_api; | ||||
| pub mod file_management_api; | ||||
| pub mod flist_management_api; | ||||
| pub mod system_api; | ||||
| pub mod website_serving_api; | ||||
|  | ||||
| pub mod configuration; | ||||
							
								
								
									
										59
									
								
								rfs-client/openapi/src/apis/system_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								rfs-client/openapi/src/apis/system_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`health_check_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum HealthCheckHandlerError { | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn health_check_handler(configuration: &configuration::Configuration, ) -> Result<models::HealthResponse, Error<HealthCheckHandlerError>> { | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1", configuration.base_path); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|     let content_type = resp | ||||
|         .headers() | ||||
|         .get("content-type") | ||||
|         .and_then(|v| v.to_str().ok()) | ||||
|         .unwrap_or("application/octet-stream"); | ||||
|     let content_type = super::ContentType::from(content_type); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         let content = resp.text().await?; | ||||
|         match content_type { | ||||
|             ContentType::Json => serde_json::from_str(&content).map_err(Error::from), | ||||
|             ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::HealthResponse`"))), | ||||
|             ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::HealthResponse`")))), | ||||
|         } | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<HealthCheckHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										53
									
								
								rfs-client/openapi/src/apis/website_serving_api.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								rfs-client/openapi/src/apis/website_serving_api.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
|  | ||||
| use reqwest; | ||||
| use serde::{Deserialize, Serialize, de::Error as _}; | ||||
| use crate::{apis::ResponseContent, models}; | ||||
| use super::{Error, configuration, ContentType}; | ||||
|  | ||||
|  | ||||
| /// struct for typed errors of method [`serve_website_handler`] | ||||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum ServeWebsiteHandlerError { | ||||
|     Status404(models::ResponseError), | ||||
|     Status500(models::ResponseError), | ||||
|     UnknownValue(serde_json::Value), | ||||
| } | ||||
|  | ||||
|  | ||||
| pub async fn serve_website_handler(configuration: &configuration::Configuration, website_hash: &str, path: &str) -> Result<reqwest::Response, Error<ServeWebsiteHandlerError>> { | ||||
|     // add a prefix to parameters to efficiently prevent name collisions | ||||
|     let p_website_hash = website_hash; | ||||
|     let p_path = path; | ||||
|  | ||||
|     let uri_str = format!("{}/api/v1/website/{website_hash}/{path}", configuration.base_path, website_hash=crate::apis::urlencode(p_website_hash), path=crate::apis::urlencode(p_path)); | ||||
|     let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||||
|  | ||||
|     if let Some(ref user_agent) = configuration.user_agent { | ||||
|         req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||||
|     } | ||||
|  | ||||
|     let req = req_builder.build()?; | ||||
|     let resp = configuration.client.execute(req).await?; | ||||
|  | ||||
|     let status = resp.status(); | ||||
|  | ||||
|     if !status.is_client_error() && !status.is_server_error() { | ||||
|         Ok(resp) | ||||
|     } else { | ||||
|         let content = resp.text().await?; | ||||
|         let entity: Option<ServeWebsiteHandlerError> = serde_json::from_str(&content).ok(); | ||||
|         Err(Error::ResponseError(ResponseContent { status, content, entity })) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										11
									
								
								rfs-client/openapi/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								rfs-client/openapi/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| #![allow(unused_imports)] | ||||
| #![allow(clippy::too_many_arguments)] | ||||
|  | ||||
| extern crate serde_repr; | ||||
| extern crate serde; | ||||
| extern crate serde_json; | ||||
| extern crate url; | ||||
| extern crate reqwest; | ||||
|  | ||||
| pub mod apis; | ||||
| pub mod models; | ||||
							
								
								
									
										36
									
								
								rfs-client/openapi/src/models/block.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								rfs-client/openapi/src/models/block.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct Block { | ||||
|     #[serde(rename = "data")] | ||||
|     pub data: std::path::PathBuf, | ||||
|     #[serde(rename = "hash")] | ||||
|     pub hash: String, | ||||
|     #[serde(rename = "index")] | ||||
|     pub index: i64, | ||||
|     #[serde(rename = "size")] | ||||
|     pub size: i32, | ||||
| } | ||||
|  | ||||
| impl Block { | ||||
|     pub fn new(data: std::path::PathBuf, hash: String, index: i64, size: i32) -> Block { | ||||
|         Block { | ||||
|             data, | ||||
|             hash, | ||||
|             index, | ||||
|             size, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										38
									
								
								rfs-client/openapi/src/models/block_downloads_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								rfs-client/openapi/src/models/block_downloads_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// BlockDownloadsResponse : Response for block downloads endpoint | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct BlockDownloadsResponse { | ||||
|     /// Block hash | ||||
|     #[serde(rename = "block_hash")] | ||||
|     pub block_hash: String, | ||||
|     /// Size of the block in bytes | ||||
|     #[serde(rename = "block_size")] | ||||
|     pub block_size: i64, | ||||
|     /// Number of times the block has been downloaded | ||||
|     #[serde(rename = "downloads_count")] | ||||
|     pub downloads_count: i64, | ||||
| } | ||||
|  | ||||
| impl BlockDownloadsResponse { | ||||
|     /// Response for block downloads endpoint | ||||
|     pub fn new(block_hash: String, block_size: i64, downloads_count: i64) -> BlockDownloadsResponse { | ||||
|         BlockDownloadsResponse { | ||||
|             block_hash, | ||||
|             block_size, | ||||
|             downloads_count, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										34
									
								
								rfs-client/openapi/src/models/block_info.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								rfs-client/openapi/src/models/block_info.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// BlockInfo : Block information with hash and index | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct BlockInfo { | ||||
|     /// Block hash | ||||
|     #[serde(rename = "hash")] | ||||
|     pub hash: String, | ||||
|     /// Block index within the file | ||||
|     #[serde(rename = "index")] | ||||
|     pub index: i64, | ||||
| } | ||||
|  | ||||
| impl BlockInfo { | ||||
|     /// Block information with hash and index | ||||
|     pub fn new(hash: String, index: i64) -> BlockInfo { | ||||
|         BlockInfo { | ||||
|             hash, | ||||
|             index, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/block_uploaded_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/block_uploaded_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct BlockUploadedResponse { | ||||
|     #[serde(rename = "hash")] | ||||
|     pub hash: String, | ||||
|     #[serde(rename = "message")] | ||||
|     pub message: String, | ||||
| } | ||||
|  | ||||
| impl BlockUploadedResponse { | ||||
|     pub fn new(hash: String, message: String) -> BlockUploadedResponse { | ||||
|         BlockUploadedResponse { | ||||
|             hash, | ||||
|             message, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/blocks_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/blocks_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// BlocksResponse : Response for blocks by hash endpoint | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct BlocksResponse { | ||||
|     /// List of blocks with their indices | ||||
|     #[serde(rename = "blocks")] | ||||
|     pub blocks: Vec<models::BlockInfo>, | ||||
| } | ||||
|  | ||||
| impl BlocksResponse { | ||||
|     /// Response for blocks by hash endpoint | ||||
|     pub fn new(blocks: Vec<models::BlockInfo>) -> BlocksResponse { | ||||
|         BlocksResponse { | ||||
|             blocks, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/dir_list_template.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/dir_list_template.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct DirListTemplate { | ||||
|     #[serde(rename = "cur_path")] | ||||
|     pub cur_path: String, | ||||
|     #[serde(rename = "lister")] | ||||
|     pub lister: Box<models::DirLister>, | ||||
| } | ||||
|  | ||||
| impl DirListTemplate { | ||||
|     pub fn new(cur_path: String, lister: models::DirLister) -> DirListTemplate { | ||||
|         DirListTemplate { | ||||
|             cur_path, | ||||
|             lister: Box::new(lister), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/dir_lister.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/dir_lister.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct DirLister { | ||||
|     #[serde(rename = "files")] | ||||
|     pub files: Vec<models::FileInfo>, | ||||
| } | ||||
|  | ||||
| impl DirLister { | ||||
|     pub fn new(files: Vec<models::FileInfo>) -> DirLister { | ||||
|         DirLister { | ||||
|             files, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										33
									
								
								rfs-client/openapi/src/models/error_template.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								rfs-client/openapi/src/models/error_template.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct ErrorTemplate { | ||||
|     #[serde(rename = "cur_path")] | ||||
|     pub cur_path: String, | ||||
|     #[serde(rename = "err")] | ||||
|     pub err: Box<models::TemplateErr>, | ||||
|     #[serde(rename = "message")] | ||||
|     pub message: String, | ||||
| } | ||||
|  | ||||
| impl ErrorTemplate { | ||||
|     pub fn new(cur_path: String, err: models::TemplateErr, message: String) -> ErrorTemplate { | ||||
|         ErrorTemplate { | ||||
|             cur_path, | ||||
|             err: Box::new(err), | ||||
|             message, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/file.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/file.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct File { | ||||
|     #[serde(rename = "file_content")] | ||||
|     pub file_content: std::path::PathBuf, | ||||
|     #[serde(rename = "file_hash")] | ||||
|     pub file_hash: String, | ||||
| } | ||||
|  | ||||
| impl File { | ||||
|     pub fn new(file_content: std::path::PathBuf, file_hash: String) -> File { | ||||
|         File { | ||||
|             file_content, | ||||
|             file_hash, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/file_download_request.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/file_download_request.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// FileDownloadRequest : Request for file download with custom filename | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FileDownloadRequest { | ||||
|     /// The custom filename to use for download | ||||
|     #[serde(rename = "file_name")] | ||||
|     pub file_name: String, | ||||
| } | ||||
|  | ||||
| impl FileDownloadRequest { | ||||
|     /// Request for file download with custom filename | ||||
|     pub fn new(file_name: String) -> FileDownloadRequest { | ||||
|         FileDownloadRequest { | ||||
|             file_name, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										42
									
								
								rfs-client/openapi/src/models/file_info.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								rfs-client/openapi/src/models/file_info.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FileInfo { | ||||
|     #[serde(rename = "is_file")] | ||||
|     pub is_file: bool, | ||||
|     #[serde(rename = "last_modified")] | ||||
|     pub last_modified: i64, | ||||
|     #[serde(rename = "name")] | ||||
|     pub name: String, | ||||
|     #[serde(rename = "path_uri")] | ||||
|     pub path_uri: String, | ||||
|     #[serde(rename = "progress")] | ||||
|     pub progress: f32, | ||||
|     #[serde(rename = "size")] | ||||
|     pub size: i64, | ||||
| } | ||||
|  | ||||
| impl FileInfo { | ||||
|     pub fn new(is_file: bool, last_modified: i64, name: String, path_uri: String, progress: f32, size: i64) -> FileInfo { | ||||
|         FileInfo { | ||||
|             is_file, | ||||
|             last_modified, | ||||
|             name, | ||||
|             path_uri, | ||||
|             progress, | ||||
|             size, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										34
									
								
								rfs-client/openapi/src/models/file_upload_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								rfs-client/openapi/src/models/file_upload_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// FileUploadResponse : Response for file upload | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FileUploadResponse { | ||||
|     /// The file hash | ||||
|     #[serde(rename = "file_hash")] | ||||
|     pub file_hash: String, | ||||
|     /// Message indicating success | ||||
|     #[serde(rename = "message")] | ||||
|     pub message: String, | ||||
| } | ||||
|  | ||||
| impl FileUploadResponse { | ||||
|     /// Response for file upload | ||||
|     pub fn new(file_hash: String, message: String) -> FileUploadResponse { | ||||
|         FileUploadResponse { | ||||
|             file_hash, | ||||
|             message, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										48
									
								
								rfs-client/openapi/src/models/flist_body.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								rfs-client/openapi/src/models/flist_body.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistBody { | ||||
|     #[serde(rename = "auth", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub auth: Option<Option<String>>, | ||||
|     #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub email: Option<Option<String>>, | ||||
|     #[serde(rename = "identity_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub identity_token: Option<Option<String>>, | ||||
|     #[serde(rename = "image_name")] | ||||
|     pub image_name: String, | ||||
|     #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub password: Option<Option<String>>, | ||||
|     #[serde(rename = "registry_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub registry_token: Option<Option<String>>, | ||||
|     #[serde(rename = "server_address", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub server_address: Option<Option<String>>, | ||||
|     #[serde(rename = "username", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] | ||||
|     pub username: Option<Option<String>>, | ||||
| } | ||||
|  | ||||
| impl FlistBody { | ||||
|     pub fn new(image_name: String) -> FlistBody { | ||||
|         FlistBody { | ||||
|             auth: None, | ||||
|             email: None, | ||||
|             identity_token: None, | ||||
|             image_name, | ||||
|             password: None, | ||||
|             registry_token: None, | ||||
|             server_address: None, | ||||
|             username: None, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										29
									
								
								rfs-client/openapi/src/models/flist_state.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								rfs-client/openapi/src/models/flist_state.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||||
| #[serde(untagged)] | ||||
| pub enum FlistState { | ||||
|     FlistStateAccepted(Box<models::FlistStateAccepted>), | ||||
|     FlistStateStarted(Box<models::FlistStateStarted>), | ||||
|     FlistStateInProgress(Box<models::FlistStateInProgress>), | ||||
|     FlistStateCreated(Box<models::FlistStateCreated>), | ||||
|     FlistStateFailed(String), | ||||
| } | ||||
|  | ||||
| impl Default for FlistState { | ||||
|     fn default() -> Self { | ||||
|         Self::FlistStateAccepted(Default::default()) | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_accepted.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_accepted.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateAccepted { | ||||
|     #[serde(rename = "Accepted")] | ||||
|     pub accepted: String, | ||||
| } | ||||
|  | ||||
| impl FlistStateAccepted { | ||||
|     pub fn new(accepted: String) -> FlistStateAccepted { | ||||
|         FlistStateAccepted { | ||||
|             accepted, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_created.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_created.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateCreated { | ||||
|     #[serde(rename = "Created")] | ||||
|     pub created: String, | ||||
| } | ||||
|  | ||||
| impl FlistStateCreated { | ||||
|     pub fn new(created: String) -> FlistStateCreated { | ||||
|         FlistStateCreated { | ||||
|             created, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_in_progress.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_in_progress.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateInProgress { | ||||
|     #[serde(rename = "InProgress")] | ||||
|     pub in_progress: Box<models::FlistStateInfo>, | ||||
| } | ||||
|  | ||||
| impl FlistStateInProgress { | ||||
|     pub fn new(in_progress: models::FlistStateInfo) -> FlistStateInProgress { | ||||
|         FlistStateInProgress { | ||||
|             in_progress: Box::new(in_progress), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										30
									
								
								rfs-client/openapi/src/models/flist_state_info.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rfs-client/openapi/src/models/flist_state_info.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateInfo { | ||||
|     #[serde(rename = "msg")] | ||||
|     pub msg: String, | ||||
|     #[serde(rename = "progress")] | ||||
|     pub progress: f32, | ||||
| } | ||||
|  | ||||
| impl FlistStateInfo { | ||||
|     pub fn new(msg: String, progress: f32) -> FlistStateInfo { | ||||
|         FlistStateInfo { | ||||
|             msg, | ||||
|             progress, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateResponse { | ||||
|     #[serde(rename = "flist_state")] | ||||
|     pub flist_state: Box<models::FlistState>, | ||||
| } | ||||
|  | ||||
| impl FlistStateResponse { | ||||
|     pub fn new(flist_state: models::FlistState) -> FlistStateResponse { | ||||
|         FlistStateResponse { | ||||
|             flist_state: Box::new(flist_state), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_started.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/flist_state_started.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct FlistStateStarted { | ||||
|     #[serde(rename = "Started")] | ||||
|     pub started: String, | ||||
| } | ||||
|  | ||||
| impl FlistStateStarted { | ||||
|     pub fn new(started: String) -> FlistStateStarted { | ||||
|         FlistStateStarted { | ||||
|             started, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/health_response.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/health_response.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct HealthResponse { | ||||
|     #[serde(rename = "msg")] | ||||
|     pub msg: String, | ||||
| } | ||||
|  | ||||
| impl HealthResponse { | ||||
|     pub fn new(msg: String) -> HealthResponse { | ||||
|         HealthResponse { | ||||
|             msg, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										27
									
								
								rfs-client/openapi/src/models/job.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								rfs-client/openapi/src/models/job.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct Job { | ||||
|     #[serde(rename = "id")] | ||||
|     pub id: String, | ||||
| } | ||||
|  | ||||
| impl Job { | ||||
|     pub fn new(id: String) -> Job { | ||||
|         Job { | ||||
|             id, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user