stately_files/request.rs
1//! Request types for file management endpoints.
2
3use serde::Deserialize;
4use utoipa::{IntoParams, ToSchema};
5
6/// Request body for saving file content directly.
7#[derive(Debug, Deserialize, ToSchema)]
8pub struct FileSaveRequest {
9 /// File content as string.
10 pub content: String,
11 /// Optional filename. Defaults to "unnamed.txt" if not provided.
12 pub name: Option<String>,
13}
14
15/// Query parameters for listing files.
16#[derive(Debug, Deserialize, IntoParams, ToSchema)]
17#[into_params(parameter_in = Query)]
18pub struct FileListQuery {
19 /// Path to list files from, relative to the uploads directory.
20 /// If not provided, lists the root uploads directory.
21 pub path: Option<String>,
22}
23
24/// Query parameters for downloading files.
25#[derive(Debug, Deserialize, IntoParams, ToSchema)]
26#[into_params(parameter_in = Query)]
27pub struct FileDownloadQuery {
28 /// Specific version UUID to download.
29 /// If not provided, returns the latest version.
30 pub version: Option<String>,
31}