mountos-admin-sdk 1.29.0

Rust SDK for mountOS, a cross-platform, forkable, time-traveling distributed filesystem over object storage. Automate accounts, users, volumes, forks, quotas, and audit logs.
Documentation
//! Rust SDK for the mountOS provider API.
//!
//! Wraps the appserv provider API (`/api/v1/*`) with ED25519 JWT authentication.
//! Construct a [`Client`] from a [`Config`] and call typed methods grouped by
//! resource, e.g. `client.accounts.list(..)`.
//!
//! ```no_run
//! use mountos_admin_sdk::{Client, Config};
//!
//! # async fn run() -> Result<(), mountos_admin_sdk::Error> {
//! let client = Client::new(Config::new(
//!     "https://appserv.example.com",
//!     "<base64 ED25519 key>",
//! ))?;
//!
//! let account = client.accounts.get(1).await?;
//! println!("{}", account.name);
//! # Ok(())
//! # }
//! ```
//!
//! Public structs and enums are `#[non_exhaustive]`. Build a struct with `new(required...)`,
//! `Default` and the `with_<field>` setters, not with a struct literal:
//!
//! ```
//! use mountos_admin_sdk::{AccountListOptions, CreateAccountRequest};
//!
//! let req = CreateAccountRequest::new("Acme").with_description("Demo account");
//! let opts = AccountListOptions::default().with_page(1).with_limit(10);
//! # let _ = (req, opts);
//! ```
//!
//! The `private_key` is a base64-encoded ED25519 key - either a 32-byte seed or
//! a 64-byte seed+public-key. JWT tokens are signed locally and cached for ~55
//! minutes (1h TTL with a 5-minute refresh margin).

#![forbid(unsafe_code)]
// Public structs and enums stay non_exhaustive so a new field or variant is not a breaking change.
#![warn(clippy::exhaustive_structs, clippy::exhaustive_enums)]

// Compiles and runs the README snippets as doc tests.
#[cfg(doctest)]
#[doc = include_str!("../README.md")]
struct ReadmeDoctests;

mod auth;
// Generated files are not rustfmt-clean by construction.
#[rustfmt::skip]
mod client_gen;
mod compat;
mod dashboard_user;
mod errors;
mod http;
mod providers;
#[rustfmt::skip]
mod types_gen;

pub use client_gen::*;
pub use compat::{DrainPairStorageResponse, Pair, PairState, UpdateVolumePairConfigRequest};
pub use dashboard_user::sign_dashboard_user;
pub use errors::Error;
pub use providers::*;
pub use types_gen::*;

// Re-exported so callers can build `serde_json::Value` fields (e.g.
// `provider_info`) without taking their own version-matched dependency.
pub use serde_json;