Expand description
The Rust client for the HEY API.
Types, routes and service methods are generated from the Smithy model in the
repository’s spec/ directory; everything else in this crate is the plumbing they
share: authentication, retries, redirects, the response cache, pagination and account
scope. All of it sends through one http::HttpClient, which an application may
replace with its own; the reqwest feature, on by default, ships one.
use hey_sdk::{Client, Config, StaticTokenProvider};
let client = Client::new(Config::default(), StaticTokenProvider::new(std::env::var("HEY_TOKEN").unwrap()))?;
for mailbox in client.boxes().list().await?.iter() {
println!("{} ({})", mailbox.name, mailbox.kind);
}Re-exports§
pub use auth::AuthStrategy;pub use auth::BearerAuth;pub use auth::StaticTokenProvider;pub use auth::TokenProvider;pub use client::Client;pub use client::ClientBuilder;pub use client::Response;pub use config::Config;pub use error::Error;pub use error::ErrorCode;pub use form::FormResponse;pub use http::HttpClient;pub use operation::Operation;pub use pagination::Page;pub use types::Date;pub use types::DateTime;pub use types::SensitiveString;pub use version::API_VERSION;pub use version::VERSION;
Modules§
- auth
- cache
- client
- config
- error
- form
- Talking to HEY’s form-backed endpoints, and what they answer with. Several parts of HEY have no JSON surface: a workflow is created by posting a form and reading the record back out of the redirect the browser would have followed.
- http
- The HTTP layer the client sends on, and the seam for replacing it.
- models
- The request and response types HEY speaks, generated from the model.
- oauth
- observability
- What the SDK tells an application about the calls it makes: which operation is running, which HTTP requests it takes, and what each one answered.
- operation
- pagination
- resilience
- Three ways to stop a struggling HEY from taking the caller down with it: a circuit breaker that gives up on an operation that keeps failing, a bulkhead that caps how many calls of one kind run at once, and a rate limiter that keeps the caller inside a budget of its own.
- route
- routes
- Every modelled route, generated from the model.
- security
- services
- The service handles a
crate::Clienthands out, one per resource. Their methods are generated from the model; the modules here add the hand-written conveniences on top and re-export the generated service they extend. - types
- url
- version