datto-api
Auto-generated Rust client for the Datto RMM API.
Installation
Add to your Cargo.toml:
[]
= { = "../path/to/datto-rmm/crates/datto-api" }
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use ;
async
Platforms
The Datto RMM API is hosted on multiple regional platforms:
use Platform;
let platforms = ;
// Parse from string
let platform: Platform = "merlot".parse?;
Authentication
The client automatically handles OAuth 2.0 token management:
- Tokens are cached and reused
- Automatic refresh before expiry (5 minute buffer)
- Thread-safe token state management
use ;
let client = new.await?;
// Get a valid token (refreshes if needed)
let token = client.ensure_token.await?;
Error Handling
use Error;
match client.some_operation.await
Building
The Rust client uses progenitor to generate API types at build time from the OpenAPI spec.
# Ensure the spec exists
# Build the crate
Known Limitations
OpenAPI 3.1.0 Support: The Datto RMM API uses OpenAPI 3.1.0, which is not yet fully supported by progenitor. The crate compiles and provides:
- Platform configuration
- OAuth token management
- HTTP client with authentication
However, the auto-generated API types are not available until progenitor adds 3.1.0 support. For now, you can make custom requests using the HTTP client directly.
License
MIT