datto_api/lib.rs
1//! Datto RMM API Client
2//!
3//! Auto-generated Rust client for the Datto RMM REST API.
4//!
5//! # Example
6//!
7//! ```no_run
8//! use datto_api::{DattoClient, Platform, Credentials};
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
12//! let client = DattoClient::new(
13//! Platform::Merlot,
14//! Credentials {
15//! api_key: std::env::var("DATTO_API_KEY")?,
16//! api_secret: std::env::var("DATTO_API_SECRET")?,
17//! },
18//! ).await?;
19//!
20//! // Use the client...
21//! Ok(())
22//! }
23//! ```
24
25mod client;
26mod platforms;
27
28pub use client::{Credentials, DattoClient, Error};
29pub use platforms::{Platform, PlatformParseError};
30
31// Generated API types
32#[cfg(has_generated_api)]
33mod generated {
34 include!(concat!(env!("OUT_DIR"), "/generated.rs"));
35}
36
37#[cfg(has_generated_api)]
38pub use generated::*;