Add 91 integration tests (all #[ignore]) mirroring the JavaScript SDK's integration test suite. Tests cover all endpoints: ping, apps, fields, records, files, lists, and reports with success, auth, access, and not-found scenarios. Add 7 runnable examples (cargo run --example <name>) for quick manual smoke testing against a real Onspring instance. Both use env vars (API_BASE_URL, SANDBOX_API_KEY, TEST_*) matching the JavaScript SDK setup. Also rename crate to onspring-api-sdk-rust with [lib] name = "onspring" so imports remain `use onspring::*`.
17 lines
444 B
Rust
17 lines
444 B
Rust
use onspring::OnspringClient;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> onspring::Result<()> {
|
|
let base_url = std::env::var("API_BASE_URL").expect("API_BASE_URL is required");
|
|
let api_key = std::env::var("SANDBOX_API_KEY").expect("SANDBOX_API_KEY is required");
|
|
|
|
let client = OnspringClient::builder(&api_key)
|
|
.base_url(&base_url)
|
|
.build();
|
|
|
|
client.ping().await?;
|
|
println!("Connected to the Onspring API successfully.");
|
|
|
|
Ok(())
|
|
}
|