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
//! A Monzo client in pure rust.
//!
//! It's ergonomic, strongly-typed, and asynchronous.
//!
//!
//! In order to use this client, you will first need to get an access token and/or refresh token for the Monzo API (see [the docs](https://docs.monzo.com/))
//!
//! ## Usage
//! ```no_run
//! use monzo::Client;
//!
//! #[tokio::main]
//! async fn main() -> monzo::Result<()> {
//! // You can create a simple monzo client using only an access token
//! let quick_client = Client::new("ACCESS_TOKEN");
//!
//! // get a list of accounts
//! let accounts = quick_client.accounts().await?;
//!
//! // get the id of one of the accounts
//! let account_id = &accounts[0].id;
//!
//! // get the balance of that account
//! let balance = quick_client.balance(account_id).await?;
//!
//! // If you have a refresh token and client credentials
//! // you can create or upgrade a client which is capable
//! // of refreshing its own access token.
//! let mut refreshable_client =
//! quick_client.with_refresh_tokens("CLIENT_ID", "CLIENT_SECRET", "REFRESH_TOKEN");
//!
//! refreshable_client.refresh_auth().await?;
//!
//! Ok(())
//! }
//! ```
doctest!;
pub use Client;
pub use ;
pub use ;
pub use inner as inner_client;
pub use Error;
/// Result type for all methods in this crate which can fail.
pub type Result<T> = Result;