Skip to main content

fizzy_sdk/
lib.rs

1//! The Rust client for the [Fizzy](https://fizzy.do) API.
2//!
3//! Types, routes and service methods are generated from the Smithy model in the
4//! repository's `spec/` directory; everything else in this crate is the plumbing they
5//! share: authentication, retries, redirects, the response cache, pagination and the
6//! account scope. All of it sends through one [`http::HttpClient`], which an application
7//! may replace with its own; the `reqwest` feature, on by default, ships one.
8//!
9//! ```no_run
10//! use fizzy_sdk::{Client, Config};
11//!
12//! # async fn run() -> Result<(), fizzy_sdk::Error> {
13//! let token = std::env::var("FIZZY_TOKEN").unwrap_or_default();
14//! let client = Client::builder(Config::default().with_env())
15//!     .access_token(token)
16//!     .build()?;
17//! let account = client.for_account("999")?;
18//! for board in account.boards().list().await?.iter() {
19//!     println!("{} ({})", board.name, board.id);
20//! }
21//! # Ok(())
22//! # }
23//! ```
24
25#![forbid(unsafe_code)]
26#![cfg_attr(docsrs, feature(doc_cfg))]
27
28pub mod auth;
29pub mod cache;
30pub mod client;
31pub mod config;
32pub mod error;
33mod generated;
34pub mod http;
35pub mod magic_link;
36pub mod observability;
37pub mod operation;
38pub mod pagination;
39mod raw;
40pub mod resilience;
41pub mod route;
42pub mod security;
43mod trace;
44pub mod types;
45pub mod url;
46pub mod version;
47pub mod webhooks;
48
49pub use auth::{AuthStrategy, BearerAuth, CookieAuth, NoAuth, StaticTokenProvider, TokenProvider};
50pub use client::{AccountClient, Client, ClientBuilder, RequestOptions, Response, Scope};
51pub use config::Config;
52pub use error::{Error, ErrorCode};
53pub use http::HttpClient;
54pub use magic_link::MagicLinkFlow;
55pub use operation::Operation;
56pub use pagination::Page;
57pub use types::{DateTime, SensitiveString};
58pub use version::{API_VERSION, VERSION};
59
60/// The request and response types Fizzy speaks, generated from the model.
61pub mod models {
62    pub use crate::generated::types::*;
63}
64
65/// Every modelled route, generated from the model.
66pub mod routes {
67    pub use crate::generated::routes::*;
68    pub use crate::route::{Pagination, ParamKind, ParamRole, Retry, Route, RouteParam};
69}
70
71/// The service handles, one per group of operations, generated from the model.
72pub mod services {
73    pub use crate::generated::services::*;
74}
75
76/// Which fields of which types the model marks sensitive, generated from the model.
77pub mod redaction {
78    pub use crate::generated::redaction::PATHS;
79}