Expand description
Automation operations
Automations enable scheduled or event-driven file operations without manual intervention. Create workflows that automatically process files based on schedules, file events, or webhooks.
§Features
- Schedule automated file operations (copy, move, delete)
- Trigger actions on file events (upload, download, modify)
- Configure recurring tasks (daily, weekly, monthly)
- Set up webhook-triggered automations
- Manage syncs with remote servers
- Import files from external URLs
§Automation Types
create_folder
- Create directories automaticallydelete_file
- Delete files matching patternscopy_file
- Copy files to destinationsmove_file
- Move files between locationsrun_sync
- Execute sync operationsimport_file
- Import from external URLs
§Example
use files_sdk::{FilesClient, AutomationHandler};
let client = FilesClient::builder()
.api_key("your-api-key")
.build()?;
let handler = AutomationHandler::new(client);
// Create automation to copy uploaded files to archive daily
let automation = handler.create(
"copy_file",
Some("/uploads/*.pdf"),
Some("/archive/"),
None,
Some("day"),
Some("/uploads"),
Some("daily")
).await?;
println!("Created automation ID: {}", automation.id.unwrap());
// Manually trigger the automation
handler.manual_run(automation.id.unwrap()).await?;
Structs§
- Automation
Entity - An Automation entity
- Automation
Handler - Handler for automation operations
Enums§
- Automation
Trigger - Automation trigger type
- Automation
Type - Automation type enum