Expand description
§autogen-stedi
Auto-generated, strongly-typed, async Rust client for the Stedi APIs.
Every request/response type and API method is generated directly from Stedi’s public
OpenAPI specs with
openapi-generator, so the surface stays faithful to the
APIs and updates automatically when a spec changes. A thin hand-written StediClient adds
API-key authentication and hands you a per-service
Configuration with the correct base URL already set.
§Why one module per service?
Stedi publishes several independent APIs, each with its own base URL
(claims.us.stedi.com, healthcare.us.stedi.com, …) and its own spec. Each is vendored into
its own top-level module — claims, core, enrollment, event_destinations,
healthcare, manager, payers — so their (otherwise colliding) model names stay
isolated. Every service is a Cargo feature: enabling only what you use skips compiling the rest
entirely, models included.
§Quick start
use autogen_stedi::StediClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = StediClient::new("your-api-key");
// `client.healthcare()` returns a `Configuration` pointed at the Healthcare API,
// ready to pass to any function in `autogen_stedi::healthcare::apis`.
let _config = client.healthcare();
Ok(())
}§Authentication
All Stedi APIs authenticate with an API key sent in the Authorization header as
Key <api-key>. StediClient wires this up for every service:
use autogen_stedi::StediClient;
let client = StediClient::new("your-api-key");Each client.<service>() accessor returns the generated Configuration for that service. The
base URL (including the dated API version, e.g. /2024-04-01) is baked in from the spec; you can
still override base_path on the returned value to point at a proxy or mock server.
§Error handling
Calls return Result<T, apis::Error<E>>, where E is the endpoint-specific error enum.
Each service module exposes its own apis::Error, which separates transport errors,
(de)serialization errors, and structured API error responses (carrying the HTTP status and body).
§Feature flags
By default all services are enabled. To reduce compile time, select only what you need
(and a TLS backend — native-tls or rustls):
[dependencies]
autogen-stedi = { version = "0.1", default-features = false, features = ["healthcare", "native-tls"] }Re-exports§
pub use client::StediClient;
Modules§
- claims
- client
- Hand-written entry point that adds authentication on top of the generated per-service
configurations. This is the only file (besides
lib.rs) that is not generated. - core
- enrollment
- event_
destinations - healthcare
- manager
- payers