files-sdk
Rust SDK for the Files.com REST API.
Status: Alpha - Full API coverage (288 endpoints), core functionality tested
Overview
Comprehensive, idiomatic Rust SDK for Files.com cloud storage platform. Provides type-safe, async operations across the entire Files.com API including file operations, user management, sharing, automation, and administration.
Highlights
- Complete Coverage - All 288 API endpoints implemented across 90+ handlers
- Idiomatic Rust - Builder patterns, strong typing, and Result-based error handling
- Async First - Built on tokio for high-performance async I/O
- Type Safe - Leverages Rust's type system to catch errors at compile time
- Well Tested - 56 integration tests, 177 mock tests, 52 unit tests
- Modular Design - Domain-organized modules for easy navigation
- Observable - Optional tracing support for debugging HTTP requests
Installation
Add to your Cargo.toml
:
[]
= "0.1"
# Optional: Enable tracing for HTTP-level debugging
= { = "0.1", = ["tracing"] }
Or install from git:
[]
= { = "https://github.com/joshrotenberg/files-idk-rs" }
Quick Start
use ;
async
Features
Core Capabilities
- ✅ Complete API Coverage - All 288 endpoints across 90+ handlers
- ✅ Type Safety - Full Rust type system with Result-based error handling
- ✅ Async/Await - Built on tokio for efficient async operations
- ✅ Builder Pattern - Ergonomic client configuration
- ✅ Comprehensive Errors - 14 error types matching HTTP status codes
- ✅ Pagination - Cursor-based pagination support
- ✅ Tracing - Optional HTTP-level debugging (feature:
tracing
)
API Modules
Files (files::
)
- File upload/download, copy, move, delete
- Folder operations with recursive support
- File comments and reactions
- File migrations
Users (users::
)
- User management, groups, permissions
- API keys, sessions, public keys
- Group memberships
Sharing (sharing::
)
- Bundles (share links)
- File requests, inbox uploads
- Bundle notifications and recipients
Automation (automation::
)
- Automations and automation runs
- Behaviors (webhooks, auto-encrypt)
- Remote servers and syncs
Admin (admin::
)
- Site settings and configuration
- History, invoices, payments
- Usage statistics
Logs (logs::
)
- API request logs, SFTP/FTP action logs
- Automation logs, sync logs
- Settings change tracking
Messages (messages::
)
- Messages and notifications
- Notification exports
Storage (storage::
)
- Projects, snapshots, locks
- File priorities
Security (security::
)
- GPG keys, SFTP host keys
- Clickwraps
AS2 (as2::
)
- AS2 stations, partners, keys
- Incoming/outgoing messages
Advanced (advanced::
)
- Form field sets, share groups
- SIEM HTTP destinations
Optional Tracing
Enable detailed HTTP debugging:
use ;
async
Control verbosity:
RUST_LOG=files_sdk=debug
RUST_LOG=files_sdk=trace
Architecture
Domain-Driven Organization
files_sdk::
├── files:: File and folder operations
├── users:: User and access management
├── sharing:: Bundles and file requests
├── automation:: Automations and behaviors
├── admin:: Site administration
├── logs:: Activity logging
├── messages:: Notifications
├── storage:: Projects and snapshots
├── security:: Keys and authentication
├── as2:: AS2 protocol support
└── advanced:: Advanced features
Low-Level API - Direct handler access for full control
use ;
let client = builder.api_key.build?;
let handler = new;
handler.upload_file.await?;
Testing
56 Integration Tests across core modules:
- Files: 38 tests (upload, download, folders, comments)
- Users: 12 tests (users, groups, API keys, sessions)
- Sharing: 3 tests (bundles)
- Admin: 2 tests (site settings)
- Automation: 4 tests (automations, behaviors)
177 Mock Tests providing comprehensive unit coverage
Run tests:
# Unit tests
# Mock tests
# Integration tests (requires FILES_API_KEY)
FILES_API_KEY=your_key
Error Handling
Comprehensive error types:
Development Status
✅ Complete
- Full API coverage (288 endpoints, 90 handlers)
- Type-safe client with builder pattern
- Comprehensive error handling
- Pagination support
- Integration test framework
- Optional tracing
- Mock test suite
🚧 In Progress
- Files.com account for real API testing
- Performance optimization
- Additional examples
📋 Planned
- High-level convenience APIs
- Retry logic with exponential backoff
- crates.io publication
- Complete documentation
Contributing
This SDK is in active development. Contributions welcome!
License
MIT OR Apache-2.0