1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! # ironflow-sdk
//!
//! Type-safe Rust SDK for the [Ironflow](https://gitlab.com/ThomasTartrau/ironflow)
//! workflow engine API. Generated from the OpenAPI specification via
//! [progenitor](https://github.com/oxidecomputer/progenitor), with ergonomic
//! wrappers for authentication and SSE event streaming.
//!
//! # Quick start
//!
//! ```no_run
//! use ironflow_sdk::IronflowClient;
//!
//! # async fn example() -> Result<(), ironflow_sdk::Error> {
//! let client = IronflowClient::new("https://ironflow.example.com", "my-api-key");
//!
//! let runs = client.list_runs().await?;
//! for run in &runs.data {
//! # let _ = run;
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Authentication
//!
//! The SDK uses Bearer token authentication. Pass your API key when creating
//! the client -- it is attached to every request automatically.
//!
//! # SSE Event Streaming
//!
//! ```no_run
//! use ironflow_sdk::IronflowClient;
//! use futures_util::StreamExt;
//!
//! # async fn example() -> Result<(), ironflow_sdk::Error> {
//! let client = IronflowClient::new("https://ironflow.example.com", "my-api-key");
//! let mut stream = client.events(None, None).await?;
//!
//! while let Some(event) = stream.next().await {
//! match event {
//! Ok(ev) => { /* handle event */ }
//! Err(e) => { /* handle error */ }
//! }
//! }
//! # Ok(())
//! # }
//! ```
pub use ClientBuilder;
pub use IronflowClient;
pub use Error;
pub use types;