51 行
1.7 KiB
Rust
51 行
1.7 KiB
Rust
|
|
use serde::{Deserialize, Serialize};
|
||
|
|
|
||
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase")]
|
||
|
|
pub enum ConflictAction {
|
||
|
|
Copy,
|
||
|
|
Rename,
|
||
|
|
Skip,
|
||
|
|
Ask,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase")]
|
||
|
|
pub enum SourceCleanupPolicy {
|
||
|
|
Keep,
|
||
|
|
Recycle,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct FileTransferPlanItem {
|
||
|
|
/// Opaque, short-lived mapping held by the local client. Never a raw path.
|
||
|
|
pub source_path_token: String,
|
||
|
|
/// Display-only value for local review; never used as an execution path.
|
||
|
|
pub display_source_path: String,
|
||
|
|
pub destination_relative_path: String,
|
||
|
|
pub size_bytes: u64,
|
||
|
|
pub category_reason: String,
|
||
|
|
pub conflict_action: ConflictAction,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct FileTransferPlan {
|
||
|
|
pub plan_id: String,
|
||
|
|
/// Locally bound profile. A remote value must never select the executor.
|
||
|
|
pub profile_id: String,
|
||
|
|
pub source_selection_id: String,
|
||
|
|
pub nas_target_id: String,
|
||
|
|
pub items: Vec<FileTransferPlanItem>,
|
||
|
|
pub total_bytes: u64,
|
||
|
|
pub conflict_count: u32,
|
||
|
|
pub warning_count: u32,
|
||
|
|
pub source_cleanup_policy: SourceCleanupPolicy,
|
||
|
|
pub expires_at: String,
|
||
|
|
}
|