Expand description
The Rust client for the Fizzy 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 the
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 fizzy_sdk::{Client, Config};
let token = std::env::var("FIZZY_TOKEN").unwrap_or_default();
let client = Client::builder(Config::default().with_env())
.access_token(token)
.build()?;
let account = client.for_account("999")?;
for board in account.boards().list().await?.iter() {
println!("{} ({})", board.name, board.id);
}Re-exports§
pub use auth::AuthStrategy;pub use auth::BearerAuth;pub use auth::CookieAuth;pub use auth::NoAuth;pub use auth::StaticTokenProvider;pub use auth::TokenProvider;pub use client::AccountClient;pub use client::Client;pub use client::ClientBuilder;pub use client::RequestOptions;pub use client::Response;pub use client::Scope;pub use config::Config;pub use error::Error;pub use error::ErrorCode;pub use http::HttpClient;pub use magic_link::MagicLinkFlow;pub use operation::Operation;pub use pagination::Page;pub use types::DateTime;pub use types::SensitiveString;pub use version::API_VERSION;pub use version::VERSION;
Modules§
- auth
- How credentials go on a request. Fizzy takes a bearer token (
Authorization: Bearer) for API access tokens, or a session cookie (Cookie: session_token=) for a session signed in through a magic link. There is no OAuth and no refresh: a 401 is final. - cache
- The
ETagresponse cache: a trait, an in-memory implementation and a file-backed one. - client
- The client, its builder, the account-scoped client and the request pipeline they share: hooks, credentials, retries, redirects and the response cache.
- config
- What a client is configured with, and where it reads that from.
- error
- The one error type every call answers with, its categories and their exit codes.
- http
- The HTTP layer the client sends on, and the seam for replacing it.
- magic_
link - Signing in without a password. Fizzy sends a code to an email address and, once the
person types it back, hands out a session token for
crate::CookieAuth. - models
- The request and response types Fizzy speaks, generated from the model.
- 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
- A request that has not been sent yet, and the retry policy it carries.
- pagination
- Pages, the cursors between them, and the walks that read them all.
- redaction
- Which fields of which types the model marks sensitive, generated from the model.
- resilience
- Three ways to stop a struggling Fizzy 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
- The route table’s row type: what the model says about one operation.
- routes
- Every modelled route, generated from the model.
- security
- HTTPS enforcement, origin comparison and header redaction.
- services
- The service handles, one per group of operations, generated from the model.
- types
- The scalar types the model speaks that Rust has no single spelling for.
- url
- Recognizing pasted Fizzy URLs offline.
- version
- The SDK and API versions, and the
User-Agentbuilt from them. - webhooks
- Verifying what Fizzy posts to a webhook. Every delivery carries an
X-Webhook-Signatureheader: the hex HMAC-SHA256 of the raw body under the webhook’s secret.