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
//! # braze
//!
//! Unofficial Rust SDK for Braze APIs.
//!
//! ```no_run
//! use braze::Client;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::builder()
//! .api_key(std::env::var("BRAZE_API_KEY")?)
//! .base_url("https://rest.iad-01.braze.com")
//! .build()?;
//! # let _ = client;
//! # Ok(())
//! # }
//! ```
//!
//! Per-API examples are in the module docs.
//!
//! The REST API key and the instance's REST endpoint (`base_url`) are under
//! *Settings → APIs and Identifiers* in the Braze dashboard. The SDK takes
//! both as values; where they come from is up to the application. The SDK
//! doesn't retry; see [`Error::is_retryable`] and [`Error::retry_after`].
//!
//! ## Cargo features
//!
//! None are enabled by default. [`generated`] is always compiled in full.
//!
//! - `export`, `messaging` — one per API.
//! - `trace` — `#[tracing::instrument]` on public async methods.
//!
//! ```toml
//! braze = { version = "0.3", features = ["export", "messaging"] }
//! ```
/// Re-export, so callers use the same `chrono` version as the generated types.
pub use chrono;
/// Re-export, so callers use the same `reqwest` version as
/// [`Builder::default_headers`] and `.header()` / `.headers()`.
pub use header;
/// Re-export; [`Credentials::api_key`] is a [`SecretString`](secrecy::SecretString).
pub use secrecy;
pub use ;
pub use ;
pub use RequestBuilder;
/// The raw `progenitor` crate, for endpoints the wrapper doesn't cover yet.
pub use braze_generated as generated;